I would like to have an array of model and a field of this model is a mutable array.
Let's say, for example ,in my Model.h
I have :
@interface myModel : NSObject
@property (assign,nonatomic) NSString* name;
@property (assign,nonatomic) NSString* time;
@property (assign,nonatomic) NSMutableArray * songs;
@end
then my view controller I have:
NSMutableArray * Storage;
myModel * arr;
arr =[[alarmModel alloc] init];
arr.name=@"pippo";
arr.time=@"01:00:00";
arr.songs=[NSMutableArray arrayWithObjects:@"pippo",@"pluto",@"paperino", nil];
[storage addObject:arr];
[storage writeToFile:filePath atomically:YES]
the last command return "NO" it means that write to file failed. Is it possible to do what I want to do?