I am new to iphone development.I am sorting an mutable array. For sorting
NSSortDescriptor *descriptor = [[NSSortDescriptor alloc] initWithKey:@"pubDate" ascending:NO];
[recent sortUsingDescriptors:[NSArray arrayWithObjects:descriptor, nil]];
recent1 = [recent sortedArrayUsingDescriptors:descriptor];
[descriptor release];
I am getting this error
Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '*** -[NSCFArray replaceObjectAtIndex:withObject:]: mutating method sent to immutable object'
The line
recent1 = [recent sortedArrayUsingDescriptors:descriptor];
show warnings
- "passing argument 1 of 'sortedarrayusingdescritors' from distinct objective c type " and
- "assignment from distinct objective c type"
I my code both recent and recent1 are NSMutable array.Wher do i go wrong?please help me out.Thanks.