From 376953ae56366b9b74fbc415f72238e53d007f4c Mon Sep 17 00:00:00 2001 From: Maarten Billemont Date: Fri, 4 May 2012 18:54:58 +0200 Subject: [PATCH] iCloud sync fixes. [REMOVED] OS X: Disabled ability to add new sites from OS X until I have time to implement it properly without causing duplicates etc. [MOVED] iCloud and Core Data support was centralised to iOS and OS X to make sure both platforms always use the same container configuration. [FIXED] iCloud sync problems. [REMOVED] iCloud KV is not used/needed. --- External/InAppSettingsKit | 2 +- External/Pearl | 2 +- MasterPassword-Mac.xcodeproj/project.pbxproj | 24 +++ .../xcschemes/MasterPassword.xcscheme | 6 + MasterPassword-iOS.xcodeproj/project.pbxproj | 3 - .../MasterPassword (Development).xcscheme | 10 +- MasterPassword/MPAppDelegate_Key.h | 24 ++- MasterPassword/MPAppDelegate_Key.m | 185 ++++++++++++++++++ MasterPassword/MPElementGeneratedEntity.m | 11 +- MasterPassword/MPTypes.m | 14 +- MasterPassword/Mac/MPAppDelegate.h | 7 - MasterPassword/Mac/MPAppDelegate.m | 112 +---------- .../Mac/MPPasswordWindowController.h | 1 + .../Mac/MPPasswordWindowController.m | 56 ++++-- .../Mac/MPPasswordWindowController.xib | 115 ++++++++++- MasterPassword/Mac/MasterPassword-Info.plist | 6 +- MasterPassword/MasterPassword.entitlements | 12 ++ MasterPassword/iOS/MPAppDelegate.h | 10 - MasterPassword/iOS/MPAppDelegate.m | 122 +----------- MasterPassword/iOS/MPMainViewController.m | 3 +- .../iOS/MasterPassword.entitlements | 4 +- 21 files changed, 439 insertions(+), 290 deletions(-) create mode 100644 MasterPassword/MasterPassword.entitlements diff --git a/External/InAppSettingsKit b/External/InAppSettingsKit index 5fd23fd7..3ae828f4 160000 --- a/External/InAppSettingsKit +++ b/External/InAppSettingsKit @@ -1 +1 @@ -Subproject commit 5fd23fd728d2e6e3216c6c2bd5a807d5316966d1 +Subproject commit 3ae828f48a63e505bcef7a9a9a78df567706eebc diff --git a/External/Pearl b/External/Pearl index 5736ed0c..e23abc67 160000 --- a/External/Pearl +++ b/External/Pearl @@ -1 +1 @@ -Subproject commit 5736ed0cb528aeabbad5cec1ae133c9002be2983 +Subproject commit e23abc67cd80ec03543eed48ffd97b30439b5c84 diff --git a/MasterPassword-Mac.xcodeproj/project.pbxproj b/MasterPassword-Mac.xcodeproj/project.pbxproj index a528f468..3853fe19 100644 --- a/MasterPassword-Mac.xcodeproj/project.pbxproj +++ b/MasterPassword-Mac.xcodeproj/project.pbxproj @@ -2142,6 +2142,7 @@ DAB8DA101503972100CED3BC /* PearlSCrypt.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PearlSCrypt.h; sourceTree = ""; }; DAB8DA111503972100CED3BC /* PearlSCrypt.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PearlSCrypt.m; sourceTree = ""; }; DAB8DA121503972100CED3BC /* README */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = README; sourceTree = ""; }; + DAD312C71553051900A3F9ED /* MasterPassword.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.xml; path = MasterPassword.entitlements; sourceTree = ""; }; DADEA5A41503C9DD00FD084E /* e_os.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = e_os.h; sourceTree = ""; }; DADEA5A51503C9DD00FD084E /* e_os2.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = e_os2.h; sourceTree = ""; }; DADEA5A91503CE3000FD084E /* _MWERKS_GUSI_prefix.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = _MWERKS_GUSI_prefix.h; sourceTree = ""; }; @@ -4025,6 +4026,7 @@ DAB8D992150374AD00CED3BC /* MasterPassword */ = { isa = PBXGroup; children = ( + DAD312C71553051900A3F9ED /* MasterPassword.entitlements */, DAB8D9B2150375C800CED3BC /* MasterPassword.xcdatamodeld */, DAB8D9B4150375C800CED3BC /* Mac */, DA600C2C150565FC008E9AB6 /* MPAppDelegate_Key.h */, @@ -6064,6 +6066,7 @@ DAB8D985150374AD00CED3BC /* Frameworks */, DAB8D986150374AD00CED3BC /* Resources */, DA60116B15060F11008E9AB6 /* CopyFiles */, + DAD312C9155305B200A3F9ED /* ShellScript */, ); buildRules = ( ); @@ -6809,6 +6812,23 @@ }; /* End PBXResourcesBuildPhase section */ +/* Begin PBXShellScriptBuildPhase section */ + DAD312C9155305B200A3F9ED /* ShellScript */ = { + isa = PBXShellScriptBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + inputPaths = ( + ); + outputPaths = ( + ); + runOnlyForDeploymentPostprocessing = 0; + shellPath = "/bin/bash -e"; + shellScript = "PATH+=:/usr/libexec\n\nsetPlistWithKey() {\n local key=$1 value=$2 plist=${3:-\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"}\n \n PlistBuddy -c \"Set :'$key' $value\" \"$plist\"\n}\ngetPlistWithKey() {\n local key=$1 plist=${2:-\"$BUILT_PRODUCTS_DIR/$INFOPLIST_PATH\"}\n \n PlistBuddy -c \"Print :'$key'\" \"$plist\"\n}\nsetSettingWithTitle() {\n local i title=$1 value=$2 plist=${3:-\"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Settings.bundle/Root.plist\"}\n \n for (( i=0; 1; ++i )); do\n PlistBuddy -c \"Print :PreferenceSpecifiers:$i\" \"$plist\" &>/dev/null || break\n echo \"Checking preference specifier $i\"\n \n [[ $(PlistBuddy -c \"Print :PreferenceSpecifiers:$i:Title\" \"$plist\" 2>/dev/null) = $title ]] || continue\n \n echo \"Correct title, setting value.\"\n PlistBuddy -c \"Set :PreferenceSpecifiers:$i:DefaultValue $value\" \"$plist\"\n break\n done\n}\n\nbuild=$(git describe --tags --always --dirty --long)\ntag=$(git describe --tags | sed 's/-\\([^-]*\\)-[^-]*$/.\\1/')\n\nsetPlistWithKey CFBundleVersion \"$build\"\nsetPlistWithKey CFBundleShortVersionString \"$tag\"\n\nsetSettingWithTitle \"Build\" \"$build\"\nsetSettingWithTitle \"Version\" \"$tag\"\nsetSettingWithTitle \"Copyright\" \"$(getPlistWithKey NSHumanReadableCopyright)\"\n"; + showEnvVarsInLog = 0; + }; +/* End PBXShellScriptBuildPhase section */ + /* Begin PBXSourcesBuildPhase section */ DAB8D984150374AD00CED3BC /* Sources */ = { isa = PBXSourcesBuildPhase; @@ -7529,6 +7549,8 @@ DAB8D9AA150374AD00CED3BC /* Debug */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_ENTITLEMENTS = MasterPassword/MasterPassword.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MasterPassword/Mac/MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword/Mac/MasterPassword-Info.plist"; @@ -7538,6 +7560,8 @@ DAB8D9AB150374AD00CED3BC /* Release */ = { isa = XCBuildConfiguration; buildSettings = { + CODE_SIGN_ENTITLEMENTS = MasterPassword/MasterPassword.entitlements; + CODE_SIGN_IDENTITY = "Mac Developer"; GCC_PRECOMPILE_PREFIX_HEADER = YES; GCC_PREFIX_HEADER = "MasterPassword/Mac/MasterPassword-Prefix.pch"; INFOPLIST_FILE = "MasterPassword/Mac/MasterPassword-Info.plist"; diff --git a/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword.xcscheme b/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword.xcscheme index f72579b2..5ea0bfdb 100644 --- a/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword.xcscheme +++ b/MasterPassword-Mac.xcodeproj/xcshareddata/xcschemes/MasterPassword.xcscheme @@ -56,6 +56,12 @@ ReferencedContainer = "container:MasterPassword-Mac.xcodeproj"> + + + + diff --git a/MasterPassword-iOS.xcodeproj/project.pbxproj b/MasterPassword-iOS.xcodeproj/project.pbxproj index bdf791cc..8c9e5ebf 100644 --- a/MasterPassword-iOS.xcodeproj/project.pbxproj +++ b/MasterPassword-iOS.xcodeproj/project.pbxproj @@ -4107,7 +4107,6 @@ "$(inherited)", "\"$(SRCROOT)/TestFlight\"", ); - OTHER_LDFLAGS = "-ObjC"; }; name = Debug; }; @@ -4126,7 +4125,6 @@ "$(inherited)", "\"$(SRCROOT)/TestFlight\"", ); - OTHER_LDFLAGS = "-ObjC"; }; name = AdHoc; }; @@ -4224,7 +4222,6 @@ "$(inherited)", "\"$(SRCROOT)/TestFlight\"", ); - OTHER_LDFLAGS = "-ObjC"; }; name = AppStore; }; diff --git a/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme b/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme index d0732f12..c185406a 100644 --- a/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme +++ b/MasterPassword-iOS.xcodeproj/xcshareddata/xcschemes/MasterPassword (Development).xcscheme @@ -39,8 +39,8 @@ + + + + @property (weak) IBOutlet NSTextField *siteField; @property (weak) IBOutlet NSTextField *contentField; +- (IBAction)empty:(id)sender; @end diff --git a/MasterPassword/Mac/MPPasswordWindowController.m b/MasterPassword/Mac/MPPasswordWindowController.m index def4c7c7..198df4ff 100644 --- a/MasterPassword/Mac/MPPasswordWindowController.m +++ b/MasterPassword/Mac/MPPasswordWindowController.m @@ -66,10 +66,17 @@ if (self.siteResults) for (MPElementEntity *element in self.siteResults) [mutableResults addObject:element.name]; - [mutableResults addObject:query]; +// [mutableResults addObject:query]; // For when the app should be able to create new sites. return mutableResults; } +- (BOOL)control:(NSControl *)control textView:(NSTextView *)fieldEditor doCommandBySelector:(SEL)commandSelector { + + dbg(@"Selector = %@", NSStringFromSelector(commandSelector)); + + return NO; +} + - (void)controlTextDidEndEditing:(NSNotification *)obj { if (obj.object == self.siteField) { @@ -92,24 +99,37 @@ }); }); - else - [[MPAppDelegate get].managedObjectContext performBlock:^{ - MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPElementGeneratedEntity class]) - inManagedObjectContext:[MPAppDelegate get].managedObjectContext]; - assert([element isKindOfClass:ClassFromMPElementType(element.type)]); - assert([MPAppDelegate get].keyHashHex); - - element.name = siteName; - element.mpHashHex = [MPAppDelegate get].keyHashHex; - - NSString *description = [element description]; - [element use]; - - dispatch_async(dispatch_get_main_queue(), ^{ - [self.contentField setStringValue:description? description: @""]; - }); - }]; + // For when the app should be able to create new sites. +// else +// [[MPAppDelegate get].managedObjectContext performBlock:^{ +// MPElementEntity *element = [NSEntityDescription insertNewObjectForEntityForName:NSStringFromClass([MPElementGeneratedEntity class]) +// inManagedObjectContext:[MPAppDelegate get].managedObjectContext]; +// assert([element isKindOfClass:ClassFromMPElementType(element.type)]); +// assert([MPAppDelegate get].keyHashHex); +// +// element.name = siteName; +// element.mpHashHex = [MPAppDelegate get].keyHashHex; +// +// NSString *description = [element description]; +// [element use]; +// +// dispatch_async(dispatch_get_main_queue(), ^{ +// [self.contentField setStringValue:description? description: @""]; +// }); +// }]; } } +- (IBAction)empty:(id)sender { + + for(NSEntityDescription *entity in [[MPAppDelegate managedObjectModel] entities]) { + NSFetchRequest *request = [NSFetchRequest new]; + [request setEntity:entity]; + NSError *error; + NSArray *results = [[MPAppDelegate managedObjectContext] executeFetchRequest:request error:&error]; + for(NSManagedObject *o in results) { + [[MPAppDelegate managedObjectContext] deleteObject:o]; + } + } +} @end diff --git a/MasterPassword/Mac/MPPasswordWindowController.xib b/MasterPassword/Mac/MPPasswordWindowController.xib index ecab011e..56b3ac85 100644 --- a/MasterPassword/Mac/MPPasswordWindowController.xib +++ b/MasterPassword/Mac/MPPasswordWindowController.xib @@ -3,20 +3,22 @@ 1070 11D50 - 2177 + 2182 1138.32 568.00 com.apple.InterfaceBuilder.CocoaPlugin - 2177 + 2182 NSTextField - NSTextFieldCell - NSWindowTemplate NSView - IBNSLayoutConstraint + NSWindowTemplate NSCustomObject + IBNSLayoutConstraint + NSButtonCell + NSButton + NSTextFieldCell com.apple.InterfaceBuilder.CocoaPlugin @@ -55,7 +57,7 @@ 268 {{140, 92}, {200, 22}} - + 2 _NS:9 YES @@ -63,7 +65,7 @@ -1804468671 138413120 - + LucidaGrande 13 1044 @@ -128,6 +130,30 @@ + + + 268 + {{384, 85}, {82, 32}} + + + 2 + _NS:9 + YES + + 67239424 + 134217728 + Empty + + _NS:9 + + -2038284033 + 129 + + + 200 + 25 + + {480, 134} @@ -168,6 +194,14 @@ 42 + + + empty: + + + + 48 + delegate @@ -385,6 +419,39 @@ + + + + 6 + 0 + + 6 + 1 + + 20 + + 1000 + 8 + 29 + 3 + + + + + 11 + 0 + + 11 + 1 + + 0.0 + + 1000 + 6 + 24 + 2 + + @@ -485,6 +552,29 @@ + + 44 + + + + + + + + 45 + + + + + 46 + + + + + 47 + + + @@ -495,7 +585,7 @@ com.apple.InterfaceBuilder.CocoaPlugin - + @@ -506,6 +596,8 @@ + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -528,12 +620,17 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin - 43 + 48 0 diff --git a/MasterPassword/Mac/MasterPassword-Info.plist b/MasterPassword/Mac/MasterPassword-Info.plist index 06da7650..4e80f7ee 100644 --- a/MasterPassword/Mac/MasterPassword-Info.plist +++ b/MasterPassword/Mac/MasterPassword-Info.plist @@ -9,7 +9,7 @@ CFBundleIconFile iTunesArtwork-Rounded.png CFBundleIdentifier - com.lyndir.lhunath.${PRODUCT_NAME:rfc1034identifier} + com.lyndir.lhunath.${PRODUCT_NAME:rfc1034identifier}.Mac CFBundleInfoDictionaryVersion 6.0 CFBundleName @@ -17,11 +17,11 @@ CFBundlePackageType APPL CFBundleShortVersionString - 1.0 + [auto] CFBundleSignature ???? CFBundleVersion - 1 + [auto] LSApplicationCategoryType public.app-category.productivity LSMinimumSystemVersion diff --git a/MasterPassword/MasterPassword.entitlements b/MasterPassword/MasterPassword.entitlements new file mode 100644 index 00000000..776574ec --- /dev/null +++ b/MasterPassword/MasterPassword.entitlements @@ -0,0 +1,12 @@ + + + + + com.apple.developer.ubiquity-container-identifiers + + $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword.1 + + com.apple.security.app-sandbox + + + diff --git a/MasterPassword/iOS/MPAppDelegate.h b/MasterPassword/iOS/MPAppDelegate.h index cfd9de43..e0b22571 100644 --- a/MasterPassword/iOS/MPAppDelegate.h +++ b/MasterPassword/iOS/MPAppDelegate.h @@ -10,16 +10,6 @@ @interface MPAppDelegate : PearlAppDelegate -@property (readonly, strong, nonatomic) NSManagedObjectContext *managedObjectContext; -@property (readonly, strong, nonatomic) NSManagedObjectModel *managedObjectModel; -@property (readonly, strong, nonatomic) NSPersistentStoreCoordinator *persistentStoreCoordinator; - -+ (NSManagedObjectModel *)managedObjectModel; -+ (NSManagedObjectContext *)managedObjectContext; - -- (void)saveContext; -- (NSURL *)applicationDocumentsDirectory; - - (void)showGuide; - (void)loadKey:(BOOL)animated; diff --git a/MasterPassword/iOS/MPAppDelegate.m b/MasterPassword/iOS/MPAppDelegate.m index 505f615b..74daf888 100644 --- a/MasterPassword/iOS/MPAppDelegate.m +++ b/MasterPassword/iOS/MPAppDelegate.m @@ -40,12 +40,12 @@ @synthesize keyHashHex; + (void)initialize { - + [MPiOSConfig get]; - + #ifdef DEBUG [PearlLogger get].autoprintLevel = PearlLogLevelDebug; -// [NSClassFromString(@"WebView") performSelector:NSSelectorFromString(@"_enableRemoteInspector")]; + // [NSClassFromString(@"WebView") performSelector:NSSelectorFromString(@"_enableRemoteInspector")]; #endif } @@ -186,7 +186,7 @@ viewStyle:UIAlertViewStyleDefault tappedButtonBlock:nil cancelTitle:nil otherTitles:[PearlStrings get].commonButtonOkay, nil]; #endif - + [[UIApplication sharedApplication] setStatusBarHidden:NO withAnimation:UIStatusBarAnimationSlide]; @@ -246,7 +246,7 @@ [self saveContext]; [TestFlight passCheckpoint:MPTestFlightCheckpointTerminated]; - + [[LocalyticsSession sharedLocalyticsSession] close]; [[LocalyticsSession sharedLocalyticsSession] upload]; @@ -263,118 +263,6 @@ [TestFlight passCheckpoint:MPTestFlightCheckpointDeactivated]; } -+ (NSManagedObjectContext *)managedObjectContext { - - return [[self get] managedObjectContext]; -} - -+ (NSManagedObjectModel *)managedObjectModel { - - return [[self get] managedObjectModel]; -} - -- (void)saveContext { - - [self.managedObjectContext performBlock:^{ - NSError *error = nil; - if ([self.managedObjectContext hasChanges] && ![self.managedObjectContext save:&error]) - err(@"Unresolved error %@", error); - }]; -} - -#pragma mark - Core Data stack - -- (NSManagedObjectModel *)managedObjectModel { - - if (__managedObjectModel) - return __managedObjectModel; - - NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"MasterPassword" withExtension:@"momd"]; - return __managedObjectModel = [[NSManagedObjectModel alloc] initWithContentsOfURL:modelURL]; -} - -- (NSManagedObjectContext *)managedObjectContext { - - if (__managedObjectContext) - return __managedObjectContext; - - NSPersistentStoreCoordinator *coordinator = [self persistentStoreCoordinator]; - if (coordinator) { - __managedObjectContext = [[NSManagedObjectContext alloc] initWithConcurrencyType:NSPrivateQueueConcurrencyType]; - __managedObjectContext.persistentStoreCoordinator = coordinator; - - [[NSNotificationCenter defaultCenter] addObserverForName:NSPersistentStoreDidImportUbiquitousContentChangesNotification - object:coordinator - queue:nil - usingBlock:^(NSNotification *note) { - dbg(@"Ubiquitous content change: %@", note); - - [__managedObjectContext performBlock:^{ - [__managedObjectContext mergeChangesFromContextDidSaveNotification:note]; - - [[NSNotificationCenter defaultCenter] postNotification: - [NSNotification notificationWithName:MPNotificationStoreUpdated - object:self userInfo:[note userInfo]]]; - }]; - }]; - } - - return __managedObjectContext; -} - -- (NSPersistentStoreCoordinator *)persistentStoreCoordinator { - - if (__persistentStoreCoordinator) - return __persistentStoreCoordinator; - - NSURL *storeURL = [[self applicationDocumentsDirectory] URLByAppendingPathComponent:@"MasterPassword.sqlite"]; - - __persistentStoreCoordinator = [[NSPersistentStoreCoordinator alloc] initWithManagedObjectModel:[self managedObjectModel]]; - [__persistentStoreCoordinator lock]; - NSError *error = nil; - if (![__persistentStoreCoordinator addPersistentStoreWithType:NSSQLiteStoreType configuration:nil URL:storeURL - options:[NSDictionary dictionaryWithObjectsAndKeys: - [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, - [NSNumber numberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, - [[[NSFileManager defaultManager] - URLForUbiquityContainerIdentifier:nil] - URLByAppendingPathComponent:@"store" - isDirectory:YES], NSPersistentStoreUbiquitousContentURLKey, - @"MasterPassword.store", NSPersistentStoreUbiquitousContentNameKey, - nil] - error:&error]) { - err(@"Unresolved error %@, %@", error, [error userInfo]); -#if DEBUG - wrn(@"Deleted datastore: %@", storeURL); - [[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil]; -#endif - - [TestFlight passCheckpoint:MPTestFlightCheckpointStoreIncompatible]; - - @throw [NSException exceptionWithName:error.domain reason:error.localizedDescription - userInfo:[NSDictionary dictionaryWithObject:error forKey:@"cause"]]; - } - - if (![[NSFileManager defaultManager] setAttributes:[NSDictionary dictionaryWithObject:NSFileProtectionComplete - forKey:NSFileProtectionKey] - ofItemAtPath:storeURL.path error:&error]) - err(@"Unresolved error %@, %@", error, [error userInfo]); - [__persistentStoreCoordinator unlock]; - - return __persistentStoreCoordinator; -} - -#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]; -} - - #pragma mark - TestFlight diff --git a/MasterPassword/iOS/MPMainViewController.m b/MasterPassword/iOS/MPMainViewController.m index d47880c5..a1ecb0ae 100644 --- a/MasterPassword/iOS/MPMainViewController.m +++ b/MasterPassword/iOS/MPMainViewController.m @@ -479,7 +479,8 @@ @"Go to %@ and set or change the password for your account to the password above.\n" @"Do this right away: if you forget, you may have trouble remembering which password to use to log into the site later on.", self.activeElement.name, self.activeElement.name)]; - + [[MPAppDelegate get] saveContext]; + [self.searchDisplayController setActive:NO animated:YES]; self.searchDisplayController.searchBar.text = self.activeElement.name; diff --git a/MasterPassword/iOS/MasterPassword.entitlements b/MasterPassword/iOS/MasterPassword.entitlements index 5757dc2a..294e5383 100644 --- a/MasterPassword/iOS/MasterPassword.entitlements +++ b/MasterPassword/iOS/MasterPassword.entitlements @@ -4,10 +4,8 @@ com.apple.developer.ubiquity-container-identifiers - $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword + $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword.1 - com.apple.developer.ubiquity-kvstore-identifier - $(TeamIdentifierPrefix)com.lyndir.lhunath.MasterPassword keychain-access-groups $(AppIdentifierPrefix)com.lyndir.lhunath.MasterPassword