Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted as Plain Text by DDD ( 10 years ago )
-(void)call_WebService
{
    AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager manager];
    [manager GET:@"http://MYURLSHAERE" parameters:nil success:^(AFHTTPRequestOperation *operation, id responseObject) {
        NSLog(@"JSON: %@", responseObject);
        
        
        AllItem=[responseObject objectForKey:@"content"];
        
        
        NSLog(@"first== %@",[AllItem objectAtIndex:0]);
        
        for (int i=0; i<=[AllItem count]; i++) {
            
           NSDictionary *temp=[AllItem objectAtIndex:i];
            [brands addObject:[temp objectForKey:@"name"]];
            [brandsID addObject:[temp objectForKey:@"id"]];
            
            
            
            NSLog(@"all item %@",brands);
            
            
            
        }
        
        
        
        
    } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
        NSLog(@"Error: %@", error);
    }];
    

    
}

 

Revise this Paste

Your Name: Code Language: