Skip to content

Commit

Permalink
added response example in README and main
Browse files Browse the repository at this point in the history
  • Loading branch information
connor committed Aug 8, 2012
1 parent 711f358 commit fd2417d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
Binary file not shown.
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ available):
id infoResult = [d info:@"cnnr.me"];


## Output

The return type of both method calls is an `NSDictionary` that mirrors
the JSON responses Domainr specifies [here](http://domai.nr/api/docs/json#search-api)
and [here](http://domai.nr/api/docs/json#info-api).

## Example

I have examples of the method calls in [main.m](https://github.com/connor/domainr-objectiveC/blob/master/main.m). The easiest way to see this in action is
Expand Down
6 changes: 6 additions & 0 deletions main.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,12 @@ int main (int argc, const char * argv[]) {
id searchResult = [d search:@"connor"];
NSLog(@"%@", searchResult);


// accessing a value at a specific key of the search method's response
NSString *domain = [searchResult objectForKey:@"query"];
NSLog(@"%@", domain);


// le info method
id infoResult = [d info:@"cnnr.me"];
NSLog(@"%@", infoResult);
Expand Down

0 comments on commit fd2417d

Please sign in to comment.