0
@interface OOTRotaryWheel : UIControl
@property (weak) id <OOTRotaryProtocol> delegate;
@property (nonatomic, strong) UIView *container;
@property int numberOfSections;
@property CGAffineTransform startTransform;
@property (nonatomic, strong) NSMutableArray *sectors;
@property int currentSector;
@property (nonatomic, retain) UIImageView *mask;
- (id) initWithFrame:(CGRect)frame andDelegate:(id)del withSections:(int)sectionsNumber;
- (void)rotate;
- (void) buildSectorsEven;
- (void) buildSectorsOdd;
@end
를 추가 할 때UIImageView에 충돌 내하는 .m 파일에서 UITapGestureRecognizer
나는 이미지를 탭하면 내 init 메소드mask = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 58, 58)];
mask.image =[UIImage imageNamed:@"centerButton.png"];
mask.center = self.center;
mask.center = CGPointMake(mask.center.x, mask.center.y+3);
UITapGestureRecognizer *singleTap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(buttonPressedDown:)];
[mask addGestureRecognizer:singleTap];
[mask setMultipleTouchEnabled:YES];
[mask setUserInteractionEnabled:YES];
-(IBAction)buttonPressedDown
{
//Connect this IBAction to touchDown
mask.alpha = 0.5f;
NSLog(@"tapping the center of the earth");
}
, 그것이 내가 그린
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[OOTRotaryWheel buttonPressedDown:]: unrecognized selector sent to instance 0x71724e0'
*** First throw call stack:
이 메시지와 충돌
내 UI가 프로그래밍 방식으로 인터페이스 빌더에는 UI 요소가 없습니다. 내 UI는 스토리 보드이지만 비어 있습니다.
touchUpEvent를 어떻게 등록합니까? UIImage가 더 이상 터치되지 않을 때 알파를 변경하고 싶습니다. –
싱글탭이하는 일입니다. "탭"은 터치 다운으로 이어지는 터치입니다. 따라서 buttonPressedDown에 대한 호출은 터치 할 때까지 발생하지 않습니다. – rdelmar