Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data app saving zero length files




On Nov 1, 2007, at 10:44 PM, Simon Fell wrote:

I've been able to re-pro this with a bare bones core data document app for the both the XML store and the binary store, the SQLLite store seems to be ok.
You can download the re-pro case from http://www.pocketsoap.com/osx/emptyFile.zip
run it, enter some text, select save, and choose either XML or binary format. look at the file, it'll be fine. now select save again, now the file will be 0k long. (radar #/5575683)


That appears to be a genuine, rather unpleasant, bug. Thanks for the report.

A trivial workaround for now would probably be simply to implement:


@implementation MyDocument

- (IBAction)saveDocument:(id)sender
{
    if ([[self managedObjectContext] hasChanges])
    {
	[super saveDocument:sender];
    }
}


This will at least prevent the user saving twice and triggering the bug. Perhaps also:



- (BOOL)validateUserInterfaceItem:(id < NSValidatedUserInterfaceItem >)item
{
if ([item action] == @selector(saveDocument:))
{
if ([[self managedObjectContext] hasChanges])
{
return YES;
}
return NO;
}
return [super validateUserInterfaceItem:item];
}



mmalc



_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >Core Data app saving zero length files (From: Simon Fell <email@hidden>)
 >Re: Core Data app saving zero length files (From: Simon Fell <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.