• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Where should I put data versioning code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Where should I put data versioning code?


  • Subject: Where should I put data versioning code?
  • From: Daniel Wambold <email@hidden>
  • Date: Wed, 01 Aug 2007 11:23:15 -0400

I am working on an NSPersistentDocument-based app and, on the advice received here, have worked out the code to keep data version information stored in the metadata of my data file. I figured that the best place to put version checking and updating code would start with the MyDocument object, but I can't seem to convince this object to send a message to other objects from the - (BOOL)readFromURL: (NSURL *)url ofType:(NSString *)fileType error:(NSError **)outError method. I tried putting an IBOutlet in the File's Owner class for MyDocument.nib in IB, but to no avail. The program seems to ignore the line of code (the debugger stops at the breakpoint on that line, then proceeds to the next line without ever reaching the breakpoint in the method called in the target object). Are the outlets not initialized here? I know this method is invoked after awakeFromNib....

Is there a reason I can't send a message to an arbitrary object from this method? Is there a better way to approach data versioning? The program can be configured to open the most recently used data file on launch, and I would like it to be able to verify that the data version is current before trying to read what might be an out-of-date data structure. I figured it was better to do this in the MyDocument object rather than with the controller object, which I assume expects a given data structure.... Apple's sample code ("Core Recipies > Sample Applications > Migration") handles the upgrade with an independent program, but I thought it would be better to integrate that function into the parent app.

Thanks for the ongoing help!
-Dan
_______________________________________________

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Where should I put data versioning code?
      • From: mmalc crawford <email@hidden>
  • Prev by Date: nsbitmapimagerep from nsview subclass, obtaining and drawing
  • Next by Date: Re: Where should I put data versioning code?
  • Previous by thread: Re: nsbitmapimagerep from nsview subclass, obtaining and drawing
  • Next by thread: Re: Where should I put data versioning code?
  • Index(es):
    • Date
    • Thread