苹果拒绝我的应用程序与崩溃日志,表明他们已经在iOS 8.0.2的iPhone 6上测试它。我使用相同的iPhone 6和8.0.2测试了我的应用程序,它的工作原理非常完美。我通过iTunesConnect与testflight一起尝试了它,假设这与苹果的测试完全相同 - 显然不是!苹果拒绝 - 无法重现崩溃
有没有人有一个想法,我怎么能解决这个问题(在与审查小组的接触已经有,但他们无法帮助,因为他们说他们没有技术支持,只是测试的应用程序。
我的问题是(从我的角度来看反正怪):它崩溃时,它添加了持久性存储:
NSError *error = nil;
_persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]];
if (![_persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL options:nil error:&error]) {
/*
Replace this implementation with code to handle the error appropriately. abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development.
Typical reasons for an error here include:
* The persistent store is not accessible;
* The schema for the persistent store is incompatible with current managed object model.
Check the error message to determine what the actual problem was.
If the persistent store is not accessible, there is typically something wrong with the file path. Often, a file URL is pointing into the application's resources directory instead of a writeable directory.
If you encounter schema incompatibility errors during development, you can reduce their frequency by:
* Simply deleting the existing store:
[[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]
* Performing automatic lightweight migration by passing the following dictionary as the options parameter:
@{NSMigratePersistentStoresAutomaticallyOption:@YES, NSInferMappingModelAutomaticallyOption:@YES}
Lightweight migration will only work for a limited set of schema changes; consult "Core Data Model Versioning and Data Migration Programming Guide" for details.
*/
NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
abort();
}
显然,它崩溃,因为我在那里有abort()
声明还,但我不确定该怎么做(即处理该问题 - 只需删除并尝试再次添加商店?)
由于它在我的iPhone上完美运行,我假设它不是源代码中列出的问题之一(如目录,模型等),我是对吗? 我现在正苦苦挣扎几天,任何帮助或想法都不胜感激!
你改变了模型吗?尝试安装旧版本,添加一些数据,然后更新应用程序,也许你有一些数据迁移的问题。 – jcesarmobile 2014-10-06 06:05:29
检查此链接:http://stackoverflow.com/questions/13806849/handling-errors-in-addpersistentstorewithtype – kabarga 2014-10-06 06:10:30
感谢您的意见。我没有改变模型,当我测试它时它工作正常 - 所以我认为这不可能是原因。 – Red 2014-10-06 06:14:43