I have in tableView NSMutableArray “days” which contain 6 NSMutableArray (monday, tuesday…saturday)
Before I doing sort,this method is work
tuesday = [NSMutableArray arrayWithArray:[tuesday sortedArrayUsingComparator:^(id cont1, id cont2) { return [[(Lesson *) cont1 time1] compare:[(Lesson *) cont2 time1]]; }]];
but now I must doing [days objectAtIndex:0]=…. but how I do this if this expression is unacceptable
You can not assign an object to a
NSMutableArraywith the equal sign, use the following:EDIT:
In case you would like to add the new object to a particular position on the original mutable array (say position 0), you have to remove the old one by:
Ant then insert the new one by: