Fixes for new properties in MPAppDelegate_Store
[FIXED] Properties in categories aren't synthesized. Using fancy new PearlAssociateObjectProperty from Pearl now to make a fake property. [FIXED] Show overlay on UI thread. [FIXED] ONLY_ACTIVE_ARCH = NO because weird codesign errors happen on second build with it set to YES. modified: External/Pearl
This commit is contained in:
parent
5e40258f54
commit
de36cf8645
@ -6,6 +6,7 @@
|
|||||||
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
|
<inspection_tool class="LossyEncoding" enabled="true" level="WARNING" enabled_by_default="true" />
|
||||||
<inspection_tool class="MethodIsLaterInTheScope" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="MethodIsLaterInTheScope" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="OCNotLocalizedStringInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="OCNotLocalizedStringInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
|
<inspection_tool class="OCUnusedMacroInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="OCUnusedMethodInspection" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
<inspection_tool class="UnusedLocalVariable" enabled="false" level="WARNING" enabled_by_default="false" />
|
||||||
<inspection_tool class="UnusedParameter" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
<inspection_tool class="UnusedParameter" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
|
||||||
|
2
External/Pearl
vendored
2
External/Pearl
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 5b51c3360c5e173390678899f99ab89c903465de
|
Subproject commit ee6fff8dd4b5374c6b21c68392b5db1bf2819333
|
2
External/UbiquityStoreManager
vendored
2
External/UbiquityStoreManager
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 22dabd3ad6f3f04bc747aebffd46a57c7f28aabd
|
Subproject commit c392d8df05e29a73250430cd48f5595a559f19f9
|
@ -9,17 +9,13 @@
|
|||||||
#import <objc/runtime.h>
|
#import <objc/runtime.h>
|
||||||
#import "MPAppDelegate_Store.h"
|
#import "MPAppDelegate_Store.h"
|
||||||
|
|
||||||
@interface MPAppDelegate_Shared ()
|
|
||||||
|
|
||||||
@property(nonatomic, strong) PearlAlert *handleCloudContentAlert;
|
|
||||||
@property(nonatomic, strong) PearlAlert *fixCloudContentAlert;
|
|
||||||
@property(nonatomic, strong) PearlOverlay *storeLoading;
|
|
||||||
|
|
||||||
@end
|
|
||||||
|
|
||||||
@implementation MPAppDelegate_Shared (Store)
|
@implementation MPAppDelegate_Shared (Store)
|
||||||
|
PearlAssociatedObjectProperty(PearlAlert*, HandleCloudContentAlert, handleCloudContentAlert);
|
||||||
|
PearlAssociatedObjectProperty(PearlAlert*, FixCloudContentAlert, fixCloudContentAlert);
|
||||||
|
PearlAssociatedObjectProperty(PearlOverlay*, StoreLoading, storeLoading);
|
||||||
|
PearlAssociatedObjectProperty(NSManagedObjectContext*, PrivateManagedObjectContext, privateManagedObjectContext);
|
||||||
|
PearlAssociatedObjectProperty(NSManagedObjectContext*, MainManagedObjectContext, mainManagedObjectContext);
|
||||||
|
|
||||||
static char privateManagedObjectContextKey, mainManagedObjectContextKey;
|
|
||||||
|
|
||||||
#pragma mark - Core Data setup
|
#pragma mark - Core Data setup
|
||||||
|
|
||||||
@ -68,13 +64,13 @@ static char privateManagedObjectContextKey, mainManagedObjectContextKey;
|
|||||||
- (NSManagedObjectContext *)mainManagedObjectContextIfReady {
|
- (NSManagedObjectContext *)mainManagedObjectContextIfReady {
|
||||||
|
|
||||||
[self storeManager];
|
[self storeManager];
|
||||||
return objc_getAssociatedObject( self, &mainManagedObjectContextKey );
|
return self.mainManagedObjectContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (NSManagedObjectContext *)privateManagedObjectContextIfReady {
|
- (NSManagedObjectContext *)privateManagedObjectContextIfReady {
|
||||||
|
|
||||||
[self storeManager];
|
[self storeManager];
|
||||||
return objc_getAssociatedObject( self, &privateManagedObjectContextKey );
|
return self.privateManagedObjectContext;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)migrateStoreForManager:(UbiquityStoreManager *)storeManager {
|
- (void)migrateStoreForManager:(UbiquityStoreManager *)storeManager {
|
||||||
@ -245,7 +241,7 @@ static char privateManagedObjectContextKey, mainManagedObjectContextKey;
|
|||||||
|
|
||||||
- (void)saveContexts {
|
- (void)saveContexts {
|
||||||
|
|
||||||
NSManagedObjectContext *mainManagedObjectContext = objc_getAssociatedObject(self, &mainManagedObjectContextKey);
|
NSManagedObjectContext *mainManagedObjectContext = self.mainManagedObjectContext;
|
||||||
[mainManagedObjectContext performBlockAndWait:^{
|
[mainManagedObjectContext performBlockAndWait:^{
|
||||||
NSError *error = nil;
|
NSError *error = nil;
|
||||||
if (![mainManagedObjectContext save:&error])
|
if (![mainManagedObjectContext save:&error])
|
||||||
@ -274,11 +270,14 @@ static char privateManagedObjectContextKey, mainManagedObjectContextKey;
|
|||||||
|
|
||||||
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager willLoadStoreIsCloud:(BOOL)isCloudStore {
|
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager willLoadStoreIsCloud:(BOOL)isCloudStore {
|
||||||
|
|
||||||
if (![self.storeLoading isVisible])
|
dispatch_async(dispatch_get_main_queue(), ^{
|
||||||
self.storeLoading = [PearlOverlay showOverlayWithTitle:@"Loading..."];
|
if (![self.storeLoading isVisible])
|
||||||
|
self.storeLoading = [PearlOverlay showOverlayWithTitle:@"Loading..."];
|
||||||
|
});
|
||||||
|
|
||||||
objc_setAssociatedObject( self, &privateManagedObjectContextKey, nil, OBJC_ASSOCIATION_RETAIN );
|
// FIXME
|
||||||
objc_setAssociatedObject( self, &mainManagedObjectContextKey, nil, OBJC_ASSOCIATION_RETAIN );
|
//self.privateManagedObjectContext = nil;
|
||||||
|
//self.mainManagedObjectContext = nil;
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didLoadStoreForCoordinator:(NSPersistentStoreCoordinator *)coordinator
|
- (void)ubiquityStoreManager:(UbiquityStoreManager *)manager didLoadStoreForCoordinator:(NSPersistentStoreCoordinator *)coordinator
|
||||||
@ -305,8 +304,8 @@ static char privateManagedObjectContextKey, mainManagedObjectContextKey;
|
|||||||
NSManagedObjectContext *mainManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
|
NSManagedObjectContext *mainManagedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSMainQueueConcurrencyType];
|
||||||
mainManagedObjectContext.parentContext = privateManagedObjectContext;
|
mainManagedObjectContext.parentContext = privateManagedObjectContext;
|
||||||
|
|
||||||
objc_setAssociatedObject( self, &privateManagedObjectContextKey, privateManagedObjectContext, OBJC_ASSOCIATION_RETAIN );
|
self.privateManagedObjectContext = privateManagedObjectContext;
|
||||||
objc_setAssociatedObject( self, &mainManagedObjectContextKey, mainManagedObjectContext, OBJC_ASSOCIATION_RETAIN );
|
self.mainManagedObjectContext = mainManagedObjectContext;
|
||||||
|
|
||||||
[self.handleCloudContentAlert cancelAlert];
|
[self.handleCloudContentAlert cancelAlert];
|
||||||
[self.fixCloudContentAlert cancelAlert];
|
[self.fixCloudContentAlert cancelAlert];
|
||||||
|
@ -5540,7 +5540,7 @@
|
|||||||
"$(inherit)",
|
"$(inherit)",
|
||||||
"\"$(SRCROOT)/../../../External\"/**",
|
"\"$(SRCROOT)/../../../External\"/**",
|
||||||
);
|
);
|
||||||
ONLY_ACTIVE_ARCH = YES;
|
ONLY_ACTIVE_ARCH = NO;
|
||||||
OTHER_LDFLAGS = "-ObjC";
|
OTHER_LDFLAGS = "-ObjC";
|
||||||
PRODUCT_NAME = "${TARGET_NAME}";
|
PRODUCT_NAME = "${TARGET_NAME}";
|
||||||
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
"PROVISIONING_PROFILE[sdk=iphoneos*]" = "";
|
||||||
|
Loading…
Reference in New Issue
Block a user