【问题标题】:Missing context for method declaration in IOS 8 for MWPhotoBrowserIOS 8 中 MWPhotoBrowser 的方法声明缺少上下文
【发布时间】:2014-09-19 06:58:43
【问题描述】:

在迁移到 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

【问题讨论】:

    标签: objective-c xcode ios8 xcode6 mwphotobrowser


    【解决方案1】:

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

    【讨论】:

      猜你喜欢
      • 2016-02-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-08-17
      • 1970-01-01
      相关资源
      最近更新 更多