Trying to recall a CoreData stored entry on program start (iPhone)

I have created a program which stores data in a database created using CoreData. I want to add the ability to for the user to close the app while editing in the modal view and be presented with the same entry and view on app relaunch.
So far, I have tried storing the various data from the modal view into NSUserDefaults, including the IndexPath of the entry, and recalling the IndexPath on launch. The IndexPath doesn't seem to get stored or restored properly.
[defaults setObject:indexPath forKey:@"IndexPath"];
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSIndexPath *indexPath = (NSIndexPath *)[defaults objectForKey:@"IndexPath"];
Is there a better way to do this in general?

Did you register? For example (from one of my apps):
NSNumber *defaultArmDelay = [NSNumber numberWithFloat:5.0];
NSDictionary *resourceDict = [NSDictionary dictionaryWithObject:defaultArmDelay forKey:ArmingDelayKey];
[[NSUserDefaults standardUserDefaults] registerDefaults:resourceDict];

Similar Messages

Maybe you are looking for

  • Getting error when attempting to install CS5.5 on Windows 7 64 bit

    Hi, I'm receiving the errors below when attempting to install Adobe CS5.5, but only for Adobe Acrobat and some other components of the suite.  I am now trying to install just Acrobat Pro through the Suite and it fails.  The error log is below.  Pleas

  • How do I get iWork on OSX 10.8 to sync with iCloud docs created in iOS?

    There's lots of support about accessing docs already stored in iCloud from iOS, but I can't find anything beyond the basic "turn iCloud on" support for the desktop. I have an iPad (uptodate iOS and iWork apps) and lots of docs stored in iCloud. I can

  • Patch Solaris 9/10 box..VVM

    I am patching Solaris 9 & 10 servers tonight and we use Veritas Volume Manager for disk mirroring. Before patching do I need to work with mirror break or anything like that ? or else can i go ahead and do the patching directly irrespective of Veritas

  • Previous button and then End of Timeline

    Is there a way to have a previous button go to the previous slide, but stop at the end of the timeline instead of playing from the beginning?  So say slide 1 plays for 3 seconds then stops.  If you hit next you're on Slide 2.  There's a Previous butt

  • Why have file sizes in Pages increased since upgrading to latest version?

    Hi, I use Pages to compose a monthly newsletter for my yacht club. For that purpose I preferred it to Word because it was so easy to add, resize and position photographs. Before circulating the newsletter to club members, I convert the file to PDF fo