wordnik / wordkit

34 stars 6 forks source link

runtime error looking for a NSString addition #9

Open gingersman opened 12 years ago

gingersman commented 12 years ago

I just installed the iOS framework to my project and I created a WNClient and a WNRandomWordRequest to retrieve a random word. The code compiles fine.

At runtime it seems that the method wn_stringByAddingURIPercentEscapes does not exist. I suppose is an addition to the NSString class that is missing. What did I do wrong?

Here is the error I got

[__NSCFString wn_stringByAddingURIPercentEscapes]: unrecognized selector sent to instance 0x84a1c90 2011-10-25 17:47:28.824 Cocos2DTest[4885:10d03] *\ Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString wn_stringByAddingURIPercentEscapes]: unrecognized selector sent to instance 0x84a1c90'

Thanks a lot!

jonzhan commented 12 years ago

I guess this might be a little late to help the original poster out, but just in case anybody else is facing the same challenge:

You need to hop into your target build settings and add the "-ObjC" linker flag under "Other Linker Flags". This tells XCode to link Objective-C categories that it finds inside your static library.