当我创建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