缺少IOS 8中MWPhotoBrowser方法声明的上下文

时间:2014-09-19 06:58:43

标签: objective-c xcode ios8 xcode6 mwphotobrowser

移动到IOS 8和XCODE 6后,我遇到MWPhoto库问题。此错误发生在PSTCollectionView类中。我想知道为什么它会返回Missing context for method declaration错误。您可以在下面找到错误的代码和图像。

#import <objc/runtime.h>
- (NSMethodSignature *)methodSignatureForSelector:(SEL)selector {
    NSMethodSignature *signature = [super methodSignatureForSelector:selector];
    if (!signature) {
        NSString *selString = NSStringFromSelector(selector);
        if ([selString hasPrefix:@"_"]) {
            SEL cleanedSelector = NSSelectorFromString([selString substringFromIndex:1]);
            signature = [super methodSignatureForSelector:cleanedSelector];
        }
    }
    return signature;
}

- (void)forwardInvocation:(NSInvocation *)invocation {
    NSString *selString = NSStringFromSelector([invocation selector]);
    if ([selString hasPrefix:@"_"]) {
        SEL cleanedSelector = NSSelectorFromString([selString substringFromIndex:1]);
        if ([self respondsToSelector:cleanedSelector]) {
            invocation.selector = cleanedSelector;
            [invocation invokeWithTarget:self];
        }
    }else {
        [super forwardInvocation:invocation];
    }
}

@end

enter image description here

1 个答案:

答案 0 :(得分:9)

我从github更新PSTCollectionView,现在工作正常 https://github.com/steipete/PSTCollectionView