I developed a small application that is stored locally in iOS by archiving an array of user objects containing:
@property (nonatomic, copy) NSString *name; @property (nonatomic, copy) NSString *dateCreated; @property (nonatomic, copy) NSString *desc; @property (nonatomic, copy) NSString *url;
I want to synchronize the specified archive using iCloud, and I believe that the recommended mechanism is through a subclass of UIDocument. All the UIDocument examples that I found used a single instance with one single NSString, so I got a little confused how to synchronize the entire array of user objects, but using UIDocument (for example, I do it locally through NSCoding).
Should I create an array of UIDocument objects containing the above properties, should I create an instance of UIDocument containing 1 instance of the data object described above, and then create an array containing all instances, or should it contain one single UIDocument full array of user objects?
I did some research, but I'm still confused. As a result, I will need to synchronize only one file containing an array of the specified user objects.
Thank you in advance for your help.
Today I have a custom class, as described above, with 4 lines called Snippet, and in my Root view controller. I have a list of NSMutableArray names in which I add every new instance of this Snippet class.
self.list = [[NSMutableArray alloc] init]; Snippet *newEntry = [[Snippet alloc] init]; [self.list addObject:newEntry];
Should I create a subclass of UI Document that owns an array of custom objects?