當我創建UITouch的一類類這是我的代碼:崩潰使用類別
- (id)initInView:(UIView *)view;
{
CGRect frame = view.frame;
CGPoint centerPoint = CGPointMake(frame.size.width * 0.5f, frame.size.height * 0.5f);
return [self initAtPoint:centerPoint inView:view];
}
- (id)initAtPoint:(CGPoint)point inWindow:(UIWindow *)window;
{
self = [super init];
if (self == nil) {
return nil;
}
// Create a fake tap touch
_tapCount = 1;
_locationInWindow = point;
_previousLocationInWindow = _locationInWindow;
UIView *hitTestView = [window hitTest:_locationInWindow withEvent:nil];
_window = [window retain];
_view = [hitTestView retain];
if ([self respondsToSelector:@selector(setGestureView:)]) {
[self setGestureView:hitTestView];
}
_phase = UITouchPhaseBegan;
_touchFlags._firstTouchForView = 1;
_touchFlags._isTap = 1;
_timestamp = [[NSProcessInfo processInfo] systemUptime];
return self;
}
- (id)initAtPoint:(CGPoint)point inView:(UIView *)view;
{
return [self initAtPoint:[view.window convertPoint:point fromView:view] inWindow:view.window];
}
- (void)setPhase:(UITouchPhase)phase;
{
_phase = phase;
_timestamp = [[NSProcessInfo processInfo] systemUptime];
}
,但是當我把它稱爲我得到這個崩潰 - [UITouch initAtPoint:inView:]:無法識別的選擇發送到實例 我該如何解決這個問題?
爲什麼投降? – HDNZ 2014-11-04 07:55:30