ios - Copy NSMutableArray to NSArray in iPhone -
I am copying the contents of NSMutableArray to NSArray in the table section number of rows in the section
- (NSInteger) table view: (UITableView *) table view numberofrose injection: (NSInteger) section {if ([appDelegate.selectedCalenDAteEqualToString: @ "TODAY"]) {back to appDelegate.calenderSowArray.count; } And if ([appDelegate.selectedCalenDAteEqualToString: @ "this week"]) {// NSArray * newArr = [NSArray arrayWithArray: testArray]; NSArray * newArr = [NSArray arrayWithArray: [testArray objectAtIndex: section]]; New ARR return; } Using the above method, it does not show any object in the new array while testArray has two objects.
change
NSArray * newArr = [NSArray arrayWithArray: [testArray objectAtIndex: section]]; With
NSArray * newArr = [testArray copy];
Comments
Post a Comment