crash - Objective-c static analysis tool -


my crash reporting service showing large number of mystery crashes ios app. few reasons suspect code trying perform selector on object doesn't have particular selector.

how can statically analyze code find erronous selector?

i'm writing objective-c code using xcode 4.6 on os x 10.8. i'm ok tool doesn't pick things calling performselector selector built string etc. think basic tool work.

select "analyze" "product" menu in xcode. or press shift+command+b.

it's invaluable identifying routine memory management stuff in mrc. it's still useful arc programs.

you might want try setting exception breakpoint exceptions.

i'd refer debug , tune app section of xcode user guide. or ray wenderlich's my app crashed, what? series.


by way, while analyzer helps, don't think find incorrect selectors. might want share how you're using selectors, because you're using performselector, there better patterns. have use it, there other patterns more robust. or if absolutely need use selectors, add runtime respondstoselector checks. example:

nsassert([object respondstoselector:@selector(somemethod:)], @"%@ not respond selector somemethod:", object); 

or, conditionally perform selector if responds (this how perform method might conditional on particular ios version):

if ([object respondstoselector:@selector(somemethod:)])     [object performselector:@selector(somemethod:)]; 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -