ios - How is my code producing this crash: [NSConcreteData count]: unrecognized selector sent to instance -
i getting crash showing in bugsense:
-[nsconcretedata count]: unrecognized selector sent instance 0x14e57f10 - nsinvalidargumentexception
in code:
+ (nsmutablearray *)applyfilters:(nsmutablearray *)theitems fromfilter:(nsdictionary *)filters { nsmutablearray *items = [[nsmutablearray alloc] initwitharray:theitems]; if ([[filters allkeys] count] > 0) { nsmutablearray *tempfiltereditems = [[nsmutablearray alloc] init]; (nsstring *key in [filters allkeys]) { nsmutablestring *convertedkey = [nsmutablestring stringwithstring:key]; [convertedkey replaceoccurrencesofstring:@" " withstring:@"_" options:nscaseinsensitivesearch range:nsmakerange(0, [convertedkey length])]; nsarray *tempfilterattributes = [nsarray arraywitharray:filters[key]]; (nsdictionary *item in items) { if (![[item[convertedkey] componentsseparatedbystring:@"*"] firstobjectcommonwitharray:tempfilterattributes]) { if (![tempfiltereditems containsobject:item]) { [tempfiltereditems addobject:item]; } } } [items removeobjectsinarray:tempfiltereditems]; [tempfiltereditems removeallobjects]; } } return items; }
why/how happening?
stack trace is:
corefoundation <redacted> + 130 1 libobjc.a.dylib objc_exception_throw + 38 2 corefoundation <redacted> + 202 3 corefoundation <redacted> + 706 4 corefoundation _cf_forwarding_prep_0 + 24 5 corefoundation <redacted> + 28 6 video games +[helper applyfilters:fromfilter:] (helper.m:2862) 7 video games -[wishlistviewcontroller loadup] (wishlistviewcontroller.m:409) + 29303 8 video games -[wishlistviewcontroller viewwillappear:] (wishlistviewcontroller.m:363) + 27955 9 uikit <redacted> + 374 10 uikit <redacted> + 612 11 uikit <redacted> + 572 12 uikit <redacted> + 44 13 uikit <redacted> + 184 14 uikit <redacted> + 380 15 quartzcore <redacted> + 142 16 quartzcore <redacted> + 350 17 quartzcore <redacted> + 16 18 quartzcore <redacted> + 228 19 quartzcore <redacted> + 314 20 uikit <redacted> + 126 21 corefoundation <redacted> + 20 22 corefoundation <redacted> + 286 23 corefoundation <redacted> + 738 24 corefoundation cfrunlooprunspecific + 524 25 corefoundation cfrunloopruninmode + 106 26 graphicsservices gseventrunmodal + 138 27 uikit uiapplicationmain + 1136 28 video games main (main.m:16) + 888911 29 libdyld.dylib <redacted> + 2
the problem has nothing code provided. error messages says message count
sent class nsconcretedata
, same nsdata
, , such class method not exist.
suggest set exception breakpoint (in xcode select left breakpoint navigator, click +
left bottom, , select add exception breakpoint).
when execute app, stop @ faulty instruction.
edit (due stack trace provided now):
stack trace indeed says method applyfilters:fromfilter:
responsible crash. place message count
sent in method, statement [[filters allkeys] count]
. looks count
sent nsconcretedata
object, , not nsarray
object might have expected. 1 reason argument filters
, should nsdictionary
, object of different type.
when app stops @ exception breakpoint, please check class of instance filters
.
Comments
Post a Comment