1

I'm using Kumulos to store a database for my iPhone app and everything works well except the select method.

This method is called when I perform a select on database :

-(void) kumulosAPI:(Kumulos*)kumulos apiOperation:(KSAPIOperation*)operation crissDidCompleteWithResult:(NSArray*)theResults;
{
   NSString *poche =  [theResults objectAtIndex:0];
   NSLog("%@",poche);
}

As you can see the method return the NSArray and this is what I am getting from the log console.

2011-03-23 00:59:18.844 GpsProject[8708:207] {
    location = "Rue de Lisieux";
    name = tayeul;
    timeCreated = "2011-03-22 17:31:32 +0000";
    timeUpdated = "1999-11-30 00:00:00 +0000";
    userID = 10;
}

but I want this data not in one NSString, I want it separate. For example I need the "location"... I can't get it.

Rodia
  • 1,407
  • 8
  • 22
  • 29
bobby grenier
  • 2,090
  • 2
  • 14
  • 11

2 Answers2

1

The results array looks more like an array of NSDictionary. So you can easily access the individual elements using the Key value for the dictionary. For example if you want to access location you can do so by

 NSString *location = [[theResults objectAtIndex:0] objectForKey:@"location"];

Hope this helps.

visakh7
  • 26,380
  • 8
  • 55
  • 69
0

The object in the array might be a dictionary. Try:

NSString *poche =  [[theResults objectAtIndex:0] objectForKey:@"location"];
NSLog("%@",poche);

I don't have any idea about kumulos so above is just a guess.

Hemant
  • 19,486
  • 24
  • 91
  • 127