Join Todd Perkins for an in-depth discussion in this video Opening, closing, and saving documents, part of iOS App Development: Apple iCloud API (2013).
Now that we have everything set up we are going to look at opening and saving…and closing a UI document.…So we go to Data.m and we are going to import CloudDocument, and then…we'll create a static property that will be of type CloudDocument, and we'll…call this cloudDoc.…Scroll down into getAllNotes, and right below where we instantiate all notes,…we'll instantiate cloudDoc, and that's going to be CloudDocument, we are going to…allocate it, and then we are going to call initWithFileURL, and the URL is going…to come from self notesURL.…
So remember that's the URL to the file that we want to save.…Then, what we are going to do is try to open that file, and if we can't open the…file because it doesn't exist, then we are going to create the file.…So call cloudDoc openWithCompletionHandler, press return to have Xcode write out…the block for you and then, and then in here we want to see if success is false.…Remember success is going to return true if the file was loaded successfully.…So if it wasn't loaded, and this is probably going to be because the file…
- Understanding the class structure of an app
- Building the data model and constants
- Making your app compatible with the Apple Developer portal
- Connecting to iCloud
- Understanding the UIDocument class
- Handling document metadata class
- Opening, closing, saving, and deleting documents from iCloud
Skill Level Intermediate
iOS 6 App Development New Featureswith Simon Allardice2h 29m Intermediate
1. Building the Note-Taking App
2. Preparing the App to Use iCloud
3. Working with iCloud Key-Value Pairs
4. Working with iCloud Documents
Next steps2m 41s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.