mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-27 00:01:00 +08:00
Fix crash under iOS 5.0.x due to attempt to use unavailable NSURLIsExcludedFromBackupKey symbol. fixes #1015
This commit is contained in:
@@ -147,18 +147,8 @@ static RKManagedObjectStore *defaultStore = nil;
|
||||
persistentStore = [self.persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nilOrConfigurationName URL:storeURL options:seedOptions error:error];
|
||||
if (! persistentStore) return nil;
|
||||
|
||||
/**
|
||||
Exclude the SQLite database from iCloud Backups to conform to the iCloud Data Storage Guidelines
|
||||
|
||||
See https://developer.apple.com/icloud/documentation/data-storage/
|
||||
*/
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED
|
||||
BOOL success = [storeURL setResourceValue:@(YES) forKey:NSURLIsExcludedFromBackupKey error:error];
|
||||
if (!success) {
|
||||
RKLogError(@"Failed to exclude SQLite store at path '%@' from iCloud Backup: %@", storePath, *error);
|
||||
return nil;
|
||||
}
|
||||
#endif
|
||||
// Exclude the SQLite database from iCloud Backups to conform to the iCloud Data Storage Guidelines
|
||||
RKSetExcludeFromBackupAttributeForItemAtPath(storePath);
|
||||
|
||||
return persistentStore;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user