This is my code:
NSMutableArray* notifications = [NSMutableArray arrayWithObjects:myObject.dictionary, nil];
After creating the NSMutableArray I do this:
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:notifications options:NSJSONWritingPrettyPrinted error:&writeError];
How can I add other objects to the NSMutableArray notification?
I know I can do something like:
NSMutableArray* notifications = [NSMutableArray arrayWithObjects:object1.dictionary, object2.dictionary, object3.dictionary, nil];
but I want to add them after the creation of the NSMutableArray.
myObject contains this:
-(NSDictionary *)dictionary {
return [NSDictionary dictionaryWithObjectsAndKeys:self.name,@"name",self.category,@"category",self.note, @"note",self.dueDate, @"dueDate",self.creationDate, @"creationDate", nil];}
arrayWithObject:object.dictionary.. I update my questionnotification, but as you can see, when I create the NSMutableArraynotificationI usearrayWithObjects:myObject.dictionary. How can I add another one in the same way?[notifications addObjectsFromArray: [NSMutableArray arrayWithObject: object.dictionary]]?