i have this application that has a username & password . however i need to make it log in on a particular site and add a user and check profiles..i was told that i must use GET to add a user or query and parse the returning data's in json.
What are the particular steps that i will do?
i have tried some ways but it really didn't help at all
i searched on google but it seems that the one's that i found is not the one that i need.
thanks in advance :)
PS:im new to programming so please be gentle on me.(dived right in to ios dev.)
i have created the app and it goes like this
edited: i modified it a bit
- (IBAction)getDataPressed
{
if([myRequest_ isExecuting])
{
return;
}
if(myRequest_ != nil)
{
[myRequest_ release];
}
myRequest_ = [[ASIHTTPRequest alloc]initWithURL:[NSURL URLWithString:URL_PATH]];
myRequest_.delegate = self;
[myRequest_ startAsynchronous];
}
#pragma ASI Delegate methods
- (void)requestFinished:(ASIHTTPRequest *)request
{
NSLog(@"Request finished successfully");
NSLog(@"%@",[request responseString]);
NSDictionary *responseDictionary = [[request responseString]JSONValue];
NSDictionary *arrayElement = [responseDictionary objectForKey:@"user"];
NSString *ID = [arrayElement valueForKeyPath:@"id"];
NSLog(@"id: %d",ID);
NSString *usr = [arrayElement valueForKeyPath:@"usr"];
NSLog(@"usr: %@",usr);
NSString *gd = [arrayElement valueForKeyPath:@"gd"];
NSLog(@"gd: %@",gd);
NSString *age = [arrayElement valueForKeyPath:@"ag"];
NSLog(@"ag: %@",age);
NSString *st = [arrayElement valueForKeyPath:@"st"];
NSLog(@"st: %@",st);
NSString *lf = [arrayElement valueForKeyPath:@"lf"];
NSLog(@"lf: %@",lf);
NSString *da = [arrayElement valueForKeyPath:@"da"];
NSLog(@"da: %d",da);
for(NSString *value in [arrayElement allValues]){
NSLog(@"Found Value %@",value);
label.text = value;
[value release];
[super release];
}
}
- (void)requestFailed:(ASIHTTPRequest *)request
{
NSLog(@"Request failed");
}
-(void)dealloc {
[super dealloc];
}
@end
still the same im getting the values but when i press the get data at the app. it closes. i need help pls. thanks i want the values to be posted on the label