This question already has answers here:
Xcode - How to fix 'NSUnknownKeyException', reason: … this class is not key value coding-compliant for the key X" error?
                                
                                    (69个答案)
                                
                        
                                4年前关闭。
            
                    
我正在为我的iPhone应用程序集成Tapjoy Publisher SDK。

[TapjoyConnect requestTapjoyConnect:TAPJOY_ID secretKey:TAPJOY_SECRET_KEY];


崩溃描述。

*由于未捕获的异常'NSUnknownKeyException'而终止应用程序,原因:'[setValue:forUndefinedKey:]:此类不符合键closeButton的键值编码标准。

任何帮助将不胜感激。
谢谢

最佳答案

确保您添加了Tapjoy Publisher Library而不是广告lib。
这是

#import "TapjoyConnect.h"

[TapjoyConnect requestTapjoyConnect:TAPJOY_APP_ID secretKey:TAPJOY_APP_SECRECT_KEY];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(getFullScreenAd:) name:TJC_FULL_SCREEN_AD_RESPONSE_NOTIFICATION object:nil];


- (void)getFullScreenAd:(NSNotification*)notifyObj
{
    // Displays a full screen ad, showing the current featured app.
    [TapjoyConnect showFullScreenAd];

}

-(void)showTapJoyAds
{
    // This method asks the tapjoy server for the featured app object.
    [TapjoyConnect getFullScreenAd];
}