我正在尝试将通知附加touchesBegan
到 a之外C4Shape
,但我什么也没得到。我添加了一个C4Shape
并尝试在设置底部添加其他通知。问题是唯一被调用的通知是touchesBegan
.
我还尝试添加手势 a la http://www.c4ios.com/examples/listenFor.php但是当我这样做时,touchesBegan
通知会从该对象停止。
#import "C4WorkSpace.h"
@implementation C4WorkSpace {
C4Shape * topthing;
}
-(void)setup {
C4Font * f = [C4Font fontWithName:@"ArialRoundedMTBold" size:50.0f];
topthing = [C4Shape shapeFromString:@"touch me" withFont:f];
[topthing setCenter:CGPointMake(self.canvas.center.x, self.canvas.height/6)];
[self.canvas addSubview:topthing];
[topthing setAnimationDuration:2.0];
[self listenFor:@"touchesBegan" fromObject:topthing andRunMethod:@"bangg:"];
[self listenFor:@"tapped" fromObject:topthing andRunMethod:@"bangg:"];
[self listenFor:@"longPress" fromObject:topthing andRunMethod:@"bangg:"];
[self listenFor:@"swipedRight" fromObject:topthing andRunMethod:@"bangg:"];
[self runMethod:@"fffff" afterDelay:1.0];
}
-(void) fffff {
[topthing rect:CGRectMake(0, 0, self.canvas.width, self.canvas.height/3)];
[topthing setAnimationDuration:0.0];
}
- (void) bangg:(NSNotification *) notification {
C4Log(@"%@", [notification name]);
}
@end