views:

16

answers:

1

Hello,

I try to use this library http://github.com/eczarny/xmlrpc to retrieve information from an xml-rpc server.

The connection is ok and I can see the parsed object display in the console but I don't know how to read the response object even if I tried a lot.

Here is the console result of NSLog(@"%@", [response object]); (response is a XMLRPCResponse) :

{
stations =     {
        0 =         {
            IdStation = 2;
            Message = "everything ok!";
        };
        1 =         {
            IdStation = 1;
            Message = "everything ok!";
        };
};
}

I want to list all stations and get id and message but I can't get it.

Is anyone can help me ?

Thanks,

David

A: 

Ah, I found the solution.

Here it is :

NSDictionary *allStations = [parsedObject objectForKey:@"stations"];
NSArray *keys = [allStations allKeys];

for (NSString *key in keys)
{
   NSDictionary *currentStation = [allStations objectForKey:key];
   [station setIdStation:
             [NSNumber numberWithInt:
                        [currentStation objectForKey:@"IdStation"]
             ]
    ];
}

Hope it can help a beginner like me !

Joshua, thanks to tried to help me.

Dragouf