• 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
CoreData UIManagedDocument saving/closing questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CoreData UIManagedDocument saving/closing questions


  • Subject: CoreData UIManagedDocument saving/closing questions
  • From: email@hidden
  • Date: Tue, 28 Aug 2012 22:17:59 -0400

This is on iOS 5 and higher.

I have an iOS app that can open separate data files (one open at a time) using a UIManagedDocument subclass.

When I do a -saveToURL:forSaveOperation:completionHandler

do I need to that inside a:

[[UIApplication sharedApplication] beginBackgroundTaskWithExpirationHandler:

block in case the application enters the background and will be terminated before the save operation completes? Or does UIManagedDocument take care of that for me?

Also, my app delegate's

- (void)applicationDidEnterBackground:(UIApplication *)application

do I need to call:

- (void)closeWithCompletionHandler:(void (^)(BOOL success))completionHandler


and then reopen it in:

- (void)applicationWillEnterForeground:(UIApplication *)application


Or can I just call:

-saveToURL:forSaveOperation:completionHandler

in

- (void)applicationDidEnterBackground:(UIApplication *)application

without worrying about closing the file if the app is later terminated?

Thanks,
Dave

_______________________________________________

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: CoreData UIManagedDocument saving/closing questions
      • From: email@hidden
  • Prev by Date: Re: Cocoa-dev Digest, Vol 9, Issue 619
  • Next by Date: Re: Binding NSSegmentedControl selection to user defaults
  • Previous by thread: Re: Cocoa-dev Digest, Vol 9, Issue 619
  • Next by thread: Re: CoreData UIManagedDocument saving/closing questions
  • Index(es):
    • Date
    • Thread