osx - "Save As" does not work for my NSPersistentDocument application -
i have os x application uses subclass of nspersistentdocument
store data. core data persistent store type sqlite. relying on standard menu commands created when create new project document-based application core data in xcode.
this application exists 2 years , evolving. today discovered "save as" not work in newest version. behavior follows:
- i create new document , enter data.
- i save document, close it, re-open it. fine. select "save as", choose new name , location file. gets renamed , can enter more data.
- i save document, close it, re-open , empty.
- when open original document, changes should in saved-as document there.
- the application not crash or produce errors.
i pretty sure once worked correctly. tried first "official" version of program, , behavior same (wrong).
edit: created new xcode project of same type, 1 core data entity. behavior same. difference application new project automatically used new "duplicate" menu command introduced 10.7 lion instead of "save as". have press option key select "save as".
i tested on 10.9.3, on 2 different macs. have idea at?
edit 2: appears related specific accounts (my account on 2 machines). works correctly on account.
for false behavior comes binary-store (we use sqlite in our application). therefor don't think change mentioned in dts-answer same issue. (we build against 10.8-sdk). furthermore happens on machines, luckily have access machine breaks.
for undocumented method, overwriting
- (bool)_writesafelytourl:(nsurl*)url oftype:(nsstring*)type forsaveoperation:(nssaveoperationtype)operation forcetemporarydirectory:(bool)forcetemporary error:(nserror **)error { return [super _writesafelytourl:url oftype:type forsaveoperation:operation forcetemporarydirectory:yes error:error]; }
to use yes forcetemporarydirectory:-parameter solved problem on machine error happens. not recommended real use, while trying find cause of problem.
i posted question cocoa-dev-mailing list too: http://lists.apple.com/archives/cocoa-dev/2014/jun/msg00358.html maybe has more information.
Comments
Post a Comment