[英]SIGABRT when launching app with CoreData on iPhone 3.1.3
我在我的iPhone應用程序上使用CoreData。 當我在運行iOS 3.1.3的舊1g iPhone上測試應用程序時,我在此方法中獲得了SIGABRT
#pragma mark - Application's Documents directory
/**
Returns the URL to the application's Documents directory.
*/
- (NSURL *)applicationDocumentsDirectory
{
return [[[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask] lastObject];
}
*** -[NSFileManager URLsForDirectory:inDomains:]: unrecognized selector sent to instance 0x106920
2011-04-08 23:49:26.311 TestApp[963:207] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[NSFileManager URLsForDirectory:inDomains:]: unrecognized selector sent to instance 0x106920'
2011-04-08 23:49:26.321 TestApp[963:207] Stack:...
我正在使用XCode 4.似乎不支持選擇器,但是我認為他們說CoreData應該在iOS> 3上工作.....所以為什么生成的代碼不能正常工作.. 。
URLsForDirectory僅適用於iOS 4.0及更高版本
由於代碼是不相關的核心數據,但對的NSFileManager類,這是因為可用的iOS 4.0的基礎方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.