iphone - Initializing NSMutableDictionary to create a filter -
iphone - Initializing NSMutableDictionary to create a filter -
this continuation question had post yesterday: initializing nsmutabledictionary
(it's stupid question, don't see i'm doing wrong.)
i liked thought of having "all" listed in tableview pops when filter button pressed in order indicate no filter applied. info model class sorted correctly nsmutablearray so:
nsarray *anarray = [dmgr.categorydictionary allkeys]; self.categoriesarray = [anarray sortedarrayusingselector:@selector(localizedcaseinsensitivecompare:)]; [self.categoriesarray insertobject:@"all" atindex:0]; // line causes crash but want add together "all" alternative categoriesarray show in uitableview. when seek run it, crashes @ line because of
nsarrayi insertobject:atindex:]: unrecognized selector sent instance 0x59baba0 *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nsarrayi insertobject:atindex:]: unrecognized selector sent instance 0x59baba0' any help appreciated. thanks!
sortedarrayusingselector: returns immutable array why can't add together it. mutable copy.
self.categoriesarray = [nsmutablearray arraywitharray:[anarray sortedarrayusingselector:@selector(localizedcaseinsensitivecompare:)]]; iphone nsmutablearray
Comments
Post a Comment