Possible Duplicate:
How to sort an NSMutableArray with custom objects in it?
Here i am sorting the NSMutableArray newsDataArray containing the NewsData Objects with int property newsID. This is working now . But how can i do this in a better way . Is there any better methods ...
NSSortDescriptor *sortDesc = [[NSSortDescriptor alloc] initWithKey:@"newsID" ascending:NO];
NSArray *tempArray = [newsDataArray sortedArrayUsingDescriptors:[NSArray arrayWithObject:sortDesc]];
NSMutableArray *sortedArray = [NSMutableArray arrayWithArray:tempArray];
NSLog(@"sortedArray=%@" ,sortedArray);
when i am using the following methods with block some error is showing. I want sorted newsDataArray as my final result .... Anyone give me a clear example ...