views:

59

answers:

1

Hi Guys,

I am not sure why the following line:

addDetails.Address = [addDetails.Address stringByReplacingOccurrencesOfRegex:@" +" withString:@" "];

causes an "Unrecognized Selector Sent to Instance" error, closing my iPhone App in my Simulator(XCode).

What's wrong with my code?

A: 

stringByReplacingOccurrencesOfRegex:withString: is a NSString category defined in RegexKitLite.h of RegexKitLite lib. Looks like you haven't add this category into your project properly see:
http://regexkit.sourceforge.net/RegexKitLite/#AddingRegexKitLitetoyourProject
or addDetails.Address is not NSString.

Vladimir
Oh Yes! That solved the problem!The problem was with the way the libraries were added. I had simply just added the 'RegexKitLite.h' file without getting the dynamic library in. Thanks Vladimir!
Susanth