Xcode6环境下AQGridView编译错误:'too many arguments to function call, expected 0, have 4'

来源:互联网 发布:淘宝卖大米要什么手续 编辑:程序博客网 时间:2024/05/19 02:21

修改代码如下:

- (UIView *) _basicHitTest: (CGPoint) point withEvent: (UIEvent *) event{// STUPID STUPID RAT CREATURES// ===========================//// Problem: we want to do a default hit-test without UIScrollView's processing getting in the way.// UIScrollView implements _defaultHitTest:withEvent: for this, but we can't call that due to it//  being a private API.// Instead, we have to manufacture a call to our super-super class here, grr    /*Method method = class_getInstanceMethod( [UIView class], @selector(hitTest:withEvent:) );IMP imp = method_getImplementation( method );return ( (UIView *)imp(self, @selector(hitTest:withEvent:), point, event) ); // -[UIView hitTest:withEvent:]     */    SEL hitSelector = @selector(hitTest:withEvent:);    NSMethodSignature * signature = [self methodSignatureForSelector:hitSelector];    NSInvocation * invocation = [NSInvocation invocationWithMethodSignature:signature];    [invocation setTarget: self];    [invocation setSelector:hitSelector];    [invocation setArgument:&point atIndex:2];    [invocation setArgument:&event atIndex:3];    [invocation invoke];    NSValue    * ret_val  = nil;    NSUInteger   ret_size = [signature methodReturnLength];    if(  ret_size > 0 ) {        void * ret_buffer = malloc( ret_size );        [invocation getReturnValue:ret_buffer];        ret_val = [NSValue valueWithBytes:ret_buffer                                 objCType:[signature methodReturnType]];                free(ret_buffer);    }        // Copy the value into our UIView object    UIView * returnedView = nil;    [ret_val getValue:&returnedView];        return returnedView;}

参考:https://github.com/AlanQuatermain/AQGridView/pull/211/files?diff=split

0 0
原创粉丝点击