-2

我有 Xcode 6 的问题!

我在运行时遇到如下问题:

Terminating app due to uncaught exception 'NSUnknownKeyException', 
reason: '[<productDetailsView 0x7c29fa60> setValue:forUndefinedKey:]: 
this class is not key value coding-compliant for the key description.' 

应用程序在启动时崩溃:

Class STinAppPurchaseMngr.m  ------> STinAppPurchaseMngr: inAppPurchaseManager 

//Called when app start

    -(void)initialize:(STAppDelegate*)delegate {
    [self requestProductsWithCompletionHandler:^(BOOL success, NSArray *products) {
        if (success) {
            initialized_ = YES;
        } else {
            STLog(@"<Error> Unable to retrieve in-app purchase product list");
        }

    }];
    self.MyAppDelegate = delegate;

    [[productDetailsView sharedInstance] setMyAppDelegate:self.MyAppDelegate];   //Here I have Thread 1: signal SIGABRT
}


//Class productDetailsView.m ————&gt;productDetailsView : UIView

+(productDetailsView*) sharedInstance {

    static dispatch_once_t once;
    static productDetailsView * sharedInstance;
    dispatch_once(&once, ^{                           //Here I have Thread 1: signal SIGABRT
        sharedInstance = [[self alloc] init];     
    });
    return sharedInstance;
}

使用 Xcode 5,一切都可以完美运行!有人有这样的问题吗?如何解决?

谢谢

4

1 回答 1

1

productDetailsView真的定义了一个名为的属性description吗?如果是这样,您是否看到它的编译警告?(Xcode 6 似乎比以前使用description了更多问题,因为它在NSObject.

如果您没有描述属性,那就是问题所在,因为某些东西(可能在 xib 或故事板中)认为您有。

于 2014-09-20T21:59:01.960 回答