0

在我的应用程序中使用 Simperium 时,应用程序退出并出现以下错误:

+[NSString sp_md5StringFromData:]: unrecognized selector sent to class 0x19fdfd8

我已经调试了足够多的代码,知道它在[[Simperium alloc] initWithViewController:controller]方法中崩溃了,在下面的代码中:

UITabBarController *tabBarController = (UITabBarController *)self.window.rootViewController;
    UINavigationController *navController = (UINavigationController *)[tabBarController.viewControllers objectAtIndex:0];
    NotesViewController *controller = (NotesViewController *)[[navController viewControllers] objectAtIndex:0] ;    

self.simperium = [[Simperium alloc] initWithRootViewController:controller];

[self.simperium startWithAppID:@"my-app-ID-goes-here"
                            APIKey:@"the-API-key-would-go-here"
                             model:[self managedObjectModel]
                           context:[self managedObjectContext]
                       coordinator:[self persistentStoreCoordinator]];

我已经隐藏了 AppID 和 API 密钥 --- 这不是错误!:)

4

1 回答 1

1

A required category for NSString isn't being loaded. This will happen if you forget to add -ObjC to "Other Linker Flags" under the build settings for your project. If you add that flag and run it again, I think you'll have better luck.

于 2012-06-30T20:18:45.333 回答