I have the following line of code:
int insertIdx = (int)[self.itemsToDisplay indexForInsertingObject:item sortedUsingBlock:^(id a, id b) {
MWFeedItem *item1 = (MWFeedItem *) a;
MWFeedItem *item2 = (MWFeedItem *) b;
return [item1.date compare:item2.date];
}];
but XCode gives me the following warning on it:
NSMutableArray' may not respond to '-indexForInsertingObject:sortedUsingBlock:
how to get rid of this warning ? and could I know where excatly this method is defined in the SDK ?
thanks so much in advance …
-indexForInsertingObject:sortedUsingBlock:is not part of the official, public SDK. Since it looks like you haven’t declared and implemented a category onNSMutableArraythat contains that method, you could write one based on this blog post by Jayway Team. Having done that, it’s just a matter of importing the header file that declares the category.