objective c - unrecognized selector sent to instance exception in iOS7 -


i have requirement check whether string contains particular string or not.for purpose using function of nsstring class called ccontainsstring. function works fine in ios8 without throwing kind of exception in case of ios7 throwing exception called

 unrecognized selector sent instance  

i have used try & catch block prevent exception may know why happening?

thanks in advance

you can check in framework header. enter image description here

- (bool)containsstring:(nsstring *)astring ns_available(10_10, 8_0); 

this method of containsstring exist after ios 8 obvious throw error in ios7....

please use below method ios7 , can use above method ios8:

if ([string rangeofstring:@"bla"].location != nsnotfound) {   nslog(@"charecter found"); }  

may can solve issue. thanks


Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -