Search code examples
iphonewordnik

example of usage for wordnik


Does anyone have an example in Objective C that uses the wordnik apis? The repo on Git hub offers a set of classes with pretty much no explanation of how to put together the pieces (rather than what libs you need to make it compile)


Solution

  • you should be able to get data from the API pretty easily:

    1. Include the ASI & JSON code in your project
    2. Ensure you have Foundation.framework, CoreServices.framework, libz.1.2.3.dylib, SystemConfiguration.framework
    3. In your code initializer, import ApplicationConstants.h and set your API key:
        Import "ApplicationConstants.h"
    
        ...
        API_KEY = @"{YOUR_API_KEY}";
    
    1. make some calls:
        WordService *ws;
    
        ws = [[WordService alloc] init];
        NSArray* definitions = [ws fetchDefinitions:@"dog"];    
        Word *w = [ws fetchRandomWord:TRUE];
    

    There will be a proper sdk in objective-c and other languages for the purposes of aggregating some of the basic Wordnik API calls.

    Tony