Skip to content
Browse files

added response example in README and main

  • Loading branch information...
1 parent 711f358 commit fd2417d4ea0698bd51064b34e1c537a3c805350f Connor Montgomery committed
View
BIN ....xcodeproj/project.xcworkspace/xcuserdata/cnnr.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
View
6 README.md
@@ -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
View
6 main.m
@@ -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);

0 comments on commit fd2417d

Please sign in to comment.
Something went wrong with that request. Please try again.