gpt4 book ai didi

ios - 什么是 [__NSCFString base64String] : unrecognized selector sent to instance?

转载 作者:行者123 更新时间:2023-11-28 21:42:15 31 4
gpt4 key购买 nike

[__NSCFString base64String]:发生无法识别的选择器发送到实例 尝试开发推送通知时。这是整个错误日志。

-[__NSCFString base64String]: unrecognized selector sent to instance 0x165263e0
2015-07-22 15:52:20.441 xxxx[1623:362933] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString base64String]: unrecognized selector sent to instance 0x165263e0'
*** First throw call stack:
(0x22705fef 0x30da9c8b 0x2270b409 0x22709327 0x22638e78 0x1caa99 0x1c4ba7 0x1bf7ed 0x1bf633 0x1af1d9 0x1ae757 0x1bec3f 0x1c64ed 0x13fdfd 0x260ea37b 0x260eb22d 0x2717d8f3 0x226cb7cb 0x226cb767 0x226c9d69 0x22616201 0x22616013 0x2a0e7201 0x25de2a09 0x145965 0x3135baaf)
libc++abi.dylib: terminating with uncaught exception of type NSException

以下是出处。

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{

[xxxx startSDKWithAppKey:@"xxxxxxxxxxxxxxxxxxxxxxxxxxxx" host:nil logEnabled:YES sandboxEnabled:NO];

[xxxx setDelegate:self];
[xxxx setSPTag:@"xxxx App"];

[xxxx handleApplication:application didFinishLaunchingWithOptions:launchOptions];

application.applicationIconBadgeNumber = 0;

return YES;
}

#pragma mark APNS notification
- (void)application:(UIApplication *)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData *)deviceToken
{

[xxxx handleApplication:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];

}

消除这些部分执行得很好。

[xxxx handleApplication:application didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];

不知道为什么会出现这个错误。请告诉我我应该如何...

最佳答案

在我看来你已经添加了类别头文件 NSString+Base64.hNSData+Base64.h 但你没有链接相应的实现 (.m) 文件。

NSString+Base64.mNSData+Base64.m 添加到 Xcode 目标,这可能会很好地解决您的问题。

但是,如果这些实现目标文件是库的一部分,那么您可能需要将 -ObjC 添加到 Other Linker Flags

关于ios - 什么是 [__NSCFString base64String] : unrecognized selector sent to instance?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31556425/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com