Skip to content

Instantly share code, notes, and snippets.

@kylebrowning
Created March 14, 2012 07:35
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kylebrowning/70fbec972e62000b2680 to your computer and use it in GitHub Desktop.
Save kylebrowning/70fbec972e62000b2680 to your computer and use it in GitHub Desktop.
- (IBAction)test:(id)sender {
DIOSNode *node = [[DIOSNode alloc] initWithDelegate:self];
NSMutableDictionary *nodeData = [NSMutableDictionary new];
[nodeData setValue:@"testtitle" forKey:@"title"];
NSDictionary *bodyValues = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"bodsdfasdfasdy", nil] forKeys:[NSArray arrayWithObjects:@"value", nil]];
NSDictionary *languageDict = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:bodyValues] forKey:@"und"];
[nodeData setValue:languageDict forKey:@"body"];
[nodeData setValue:@"article" forKey:@"type"];
[nodeData setValue:@"und" forKey:@"language"];
[nodeData setValue:@"admin" forKey:@"name"];
[nodeData setValue:@"7" forKey:@"uid"];
[node nodePost:nodeData];
// [node nodeGet:nodeData];
// [node nodePut:nodeData];
// [node nodeDelete:nodeData];
DIOSComment *comment = [[DIOSComment alloc] init];
NSMutableDictionary *commentData = [NSMutableDictionary new];
bodyValues = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"commentbody", nil] forKeys:[NSArray arrayWithObjects:@"value", nil]];
languageDict = [NSDictionary dictionaryWithObject:[NSArray arrayWithObject:bodyValues] forKey:@"und"];
[commentData setValue:languageDict forKey:@"comment_body"];
[commentData setValue:@"subjecte is changed" forKey:@"subject"];
[commentData setValue:@"und" forKey:@"language"];
// [commentData setValue:@"2" forKey:@"cid"];
[comment commentPost:commentData];
}
- (void)nodeGetDidFinish:(BOOL)status operation:(AFHTTPRequestOperation *)operation response:(id)response error:(NSError*)error {
[[[DIOSSession sharedSession] delegate] callDidFinish:status operation:operation response:response error:error];
}
- (void)nodePostDidFinish:(BOOL)status operation:(AFHTTPRequestOperation *)operation response:(id)response error:(NSError*)error {
[[[DIOSSession sharedSession] delegate] callDidFinish:status operation:operation response:response error:error];
}
- (void)nodePutDidFinish:(BOOL)status operation:(AFHTTPRequestOperation *)operation response:(id)response error:(NSError *)error {
[[[DIOSSession sharedSession] delegate] callDidFinish:status operation:operation response:response error:error];
}
- (void)nodeDeleteDidFinish:(BOOL)status operation:(AFHTTPRequestOperation *)operation response:(id)response error:(NSError *)error {
[[[DIOSSession sharedSession] delegate] callDidFinish:status operation:operation response:response error:error];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment