views:

19

answers:

1

Hi,

I have an application in which I am getting XML as below. How to parse the following XML such that I need to maintain two separate arrays for 'id' and 'last updated'. In idArray I want to maintain all the ids and in updatedArrays I want to maintain all the dates.How to do that? Both id and lastUpdate are within a single tag as below.

id="[email protected]" lastUpdate="08/27/2010 04:15:42PM"

A: 

can u tell me the link or response string so i can help you;

hold the response after parse in array and then do in like this nsmutablearray *idarray = [[nsmutablearray alloc]init]; nsmutablearray *lastUpdatearray = [[nsmutablearray alloc]init]; (for i=0;i<[array count];i++){

[idarray addobject:[[ array objectatindex:i]valueforkey:@"id"]]; [lastUpdatearray addobject:[[ array objectatindex:i]valueforkey:@"lastUpdate"]] }

GhostRider
@GhostRider resopnse from web service is already given above as <user>[email protected] lastUpdate="08/27/2010 04:15:42PM"</user> As data coming from web service hw can u access elements using valueforkey:@"id"? When you parse the tag you will get {[email protected] lastUpdate="08/27/2010 04:15:42PM"} as a single element.And I want maintain two separate arrays for id and lastUpdate.
Vijay
@GhostRider resopnse from already givel above as <user>[email protected] lastUpdate="08/27/2010 04:15:42PM"</user> As data coming from web service hw can u access elements using valueforkey:@"id"? When you parse the tag you will get {[email protected] lastUpdate="08/27/2010 04:15:42PM"} as a single elememt.And I want maintain two separate arrays for id and lastUpdate.
Vijay
yes u got dictionary on every index of array and above code is used for access and make two diffrent array
GhostRider