Skip to content

Commit

Permalink
Fix nullability annotations in Xcode 6
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyarnold committed Jun 18, 2015
1 parent 3c304ff commit e37f2ac
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 32 deletions.
18 changes: 9 additions & 9 deletions MagicalRecord/Categories/DataImport/MagicalImportFunctions.h
Expand Up @@ -9,19 +9,19 @@
#import <Foundation/Foundation.h>
#import <MagicalRecord/MagicalRecordXcode7CompatibilityMacros.h>

__MR_nonnull NSDate *MR_adjustDateForDST(NSDate *__MR_nonnull date);
__MR_nonnull NSDate *MR_dateFromString(NSString *__MR_nonnull value, NSString *__MR_nonnull format);
__MR_nonnull NSDate *MR_dateFromNumber(NSNumber *__MR_nonnull value, BOOL milliseconds);
__MR_nonnull NSNumber *MR_numberFromString(NSString *__MR_nonnull value);
__MR_nonnull NSString *MR_attributeNameFromString(NSString *__MR_nonnull value);
__MR_nonnull NSString *MR_primaryKeyNameFromString(NSString *__MR_nonnull value);
NSDate * __MR_nonnull MR_adjustDateForDST(NSDate *__MR_nonnull date);
NSDate * __MR_nonnull MR_dateFromString(NSString *__MR_nonnull value, NSString *__MR_nonnull format);
NSDate * __MR_nonnull MR_dateFromNumber(NSNumber *__MR_nonnull value, BOOL milliseconds);
NSNumber * __MR_nonnull MR_numberFromString(NSString *__MR_nonnull value);
NSString * __MR_nonnull MR_attributeNameFromString(NSString *__MR_nonnull value);
NSString * __MR_nonnull MR_primaryKeyNameFromString(NSString *__MR_nonnull value);

#if TARGET_OS_IPHONE
#import <UIKit/UIKit.h>
__MR_nullable UIColor *MR_colorFromString(NSString *__MR_nonnull serializedColor);
UIColor * __MR_nullable MR_colorFromString(NSString *__MR_nonnull serializedColor);
#else
#import <AppKit/AppKit.h>
__MR_nullable NSColor *MR_colorFromString(NSString *__MR_nonnull serializedColor);
NSColor * __MR_nullable MR_colorFromString(NSString *__MR_nonnull serializedColor);
#endif

__MR_nullable NSInteger *MR_newColorComponentsFromString(NSString *__MR_nonnull serializedColor);
NSInteger * __MR_nullable MR_newColorComponentsFromString(NSString *__MR_nonnull serializedColor);
Expand Up @@ -16,21 +16,21 @@
@param block Block that is passed a managed object context.
*/
- (void)MR_saveWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block;
- (void)MR_saveWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block;

/**
Creates a child context for the current context that you can make changes within, before saving up through all parent contexts to the main queue context, and finally to the saving context. This method will return immediately, and execute the save initially on a background thread, and then on the appropriate thread for each context it saves.
@param block Block that is passed a managed object context.
@param completion Completion block that is called once all contexts have been saved, or if an error is encountered.
*/
- (void)MR_saveWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(MR_nullable MRSaveCompletionHandler)completion;
- (void)MR_saveWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(MR_nullable MRSaveCompletionHandler)completion;

/**
Creates a child context for the current context that you can make changes within, before saving up through all parent contexts to the main queue context, and finally to the saving context. This method will not return until the save has completed, blocking the thread it is called on.
@param block Block that is passed a managed object context.
*/
- (void)MR_saveWithBlockAndWait:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block;
- (void)MR_saveWithBlockAndWait:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block;

@end
Expand Up @@ -81,12 +81,12 @@ typedef void (^MRSaveCompletionHandler)(BOOL contextDidSave, NSError * __MR_null
@interface NSManagedObjectContext (MagicalSavesDeprecated)

- (void) MR_save MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreAndWait");
- (void) MR_saveWithErrorCallback:(void __MR_nullable (^)(NSError * __MR_nullable error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveInBackgroundCompletion:(void __MR_nullable (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveInBackgroundErrorHandler:(void __MR_nullable (^)(NSError * __MR_nullable error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveInBackgroundErrorHandler:(void __MR_nullable (^)(NSError * __MR_nullable error))errorCallback completion:(void __MR_nullable (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveWithErrorCallback:(void (^ __MR_nullable)(NSError * __MR_nullable error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveInBackgroundCompletion:(void (^ __MR_nullable)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveInBackgroundErrorHandler:(void (^ __MR_nullable)(NSError * __MR_nullable error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveInBackgroundErrorHandler:(void (^ __MR_nullable)(NSError * __MR_nullable error))errorCallback completion:(void (^ __MR_nullable)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
- (void) MR_saveNestedContexts MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:");
- (void) MR_saveNestedContextsErrorHandler:(void __MR_nullable (^)(NSError * __MR_nullable error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:");
- (void) MR_saveNestedContextsErrorHandler:(void __MR_nullable (^)(NSError * __MR_nullable error))errorCallback completion:(void __MR_nullable (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:");
- (void) MR_saveNestedContextsErrorHandler:(void (^ __MR_nullable)(NSError * __MR_nullable error))errorCallback MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:");
- (void) MR_saveNestedContextsErrorHandler:(void (^ __MR_nullable)(NSError * __MR_nullable error))errorCallback completion:(void (^ __MR_nullable)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN_PLEASE_USE("3.0", "MR_saveToPersistentStoreWithCompletion:");

@end
Expand Up @@ -33,8 +33,8 @@ extern NSString * __MR_nonnull const kMagicalRecordPSCMismatchCouldNotRecreateSt
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;

+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void __MR_nullable (^)(void))completionHandler;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void __MR_nullable (^)(void))completionHandler;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionHandler;
+ (MR_nonnull NSPersistentStoreCoordinator *) MR_coordinatorWithiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionHandler;

- (MR_nullable NSPersistentStore *) MR_addInMemoryStore;
- (MR_nullable NSPersistentStore *) MR_addAutoMigratingSqliteStoreNamed:(MR_nonnull NSString *) storeFileName;
Expand All @@ -45,7 +45,7 @@ extern NSString * __MR_nonnull const kMagicalRecordPSCMismatchCouldNotRecreateSt

- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void __MR_nullable (^)(void))completionBlock;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void __MR_nullable (^)(void))completionBlock;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreNamed:(MR_nonnull NSString *)localStoreName cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionBlock;
- (void) MR_addiCloudContainerID:(MR_nonnull NSString *)containerID contentNameKey:(MR_nullable NSString *)contentNameKey localStoreAtURL:(MR_nonnull NSURL *)storeURL cloudStorePathComponent:(MR_nullable NSString *)subPathComponent completion:(void (^ __MR_nullable)(void))completionBlock;

@end
16 changes: 8 additions & 8 deletions MagicalRecord/Core/MagicalRecord+Actions.h
Expand Up @@ -15,21 +15,21 @@

/* For all background saving operations. These calls will be sent to a different thread/queue.
*/
+ (void) saveWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block;
+ (void) saveWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(MR_nullable MRSaveCompletionHandler)completion;
+ (void) saveWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block;
+ (void) saveWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(MR_nullable MRSaveCompletionHandler)completion;

/* For saving on the current thread as the caller, only with a seperate context. Useful when you're managing your own threads/queues and need a serial call to create or change data
*/
+ (void) saveWithBlockAndWait:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block;
+ (void) saveWithBlockAndWait:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block;

@end

@interface MagicalRecord (ActionsDeprecated)

+ (void) saveUsingCurrentThreadContextWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(MR_nullable MRSaveCompletionHandler)completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveUsingCurrentThreadContextWithBlockAndWait:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveInBackgroundWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveInBackgroundWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(void __MR_nullable (^)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveInBackgroundUsingCurrentContextWithBlock:(void __MR_nonnull (^)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(void __MR_nullable (^)(void))completion errorHandler:(void __MR_nullable (^)(NSError * __MR_nullable error))errorHandler MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveUsingCurrentThreadContextWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(MR_nullable MRSaveCompletionHandler)completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveUsingCurrentThreadContextWithBlockAndWait:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveInBackgroundWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveInBackgroundWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(void (^ __MR_nullable)(void))completion MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");
+ (void) saveInBackgroundUsingCurrentContextWithBlock:(void (^ __MR_nonnull)(NSManagedObjectContext * __MR_nonnull localContext))block completion:(void (^ __MR_nullable)(void))completion errorHandler:(void (^ __MR_nullable)(NSError * __MR_nullable error))errorHandler MR_DEPRECATED_WILL_BE_REMOVED_IN("3.0");

@end
4 changes: 2 additions & 2 deletions MagicalRecord/Core/MagicalRecord+iCloud.h
Expand Up @@ -25,7 +25,7 @@
contentNameKey:(MR_nullable NSString *)contentNameKey
localStoreNamed:(MR_nonnull NSString *)localStoreName
cloudStorePathComponent:(MR_nullable NSString *)pathSubcomponent
completion:(void __MR_nullable (^)(void))completion;
completion:(void (^ __MR_nullable)(void))completion;

+ (void)setupCoreDataStackWithiCloudContainer:(MR_nonnull NSString *)containerID
localStoreAtURL:(MR_nonnull NSURL *)storeURL;
Expand All @@ -39,6 +39,6 @@
contentNameKey:(MR_nullable NSString *)contentNameKey
localStoreAtURL:(MR_nonnull NSURL *)storeURL
cloudStorePathComponent:(MR_nullable NSString *)pathSubcomponent
completion:(void __MR_nullable (^)(void))completion;
completion:(void (^ __MR_nullable)(void))completion;

@end

0 comments on commit e37f2ac

Please sign in to comment.