Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

arnieterm

macrumors regular
Original poster
Aug 28, 2008
201
0
Hi
I am getting an NSArray mainScreenData through a web service [created in Microsoft .Net]
as shown below:
Code:
(
        {
        Name = EMAILS;
        Total = 5;
    },
    "",
    "",
    "",
    "",
    "",
    ""

When I try to iterate over this NSArray using a for loop, I am getting error.
The code for looping over this Array is:
Code:
for(int i=0;i<[mainScreenData count];i++)
	{
		@try {
			if( [  [mainScreenData objectAtIndex : i ]  isKindOfClass:[NSDictionary class]  ] ){
				strName =  [ [mainScreenData objectAtIndex:i] objectForKey:@"Name"];
				[strName length];
			}
		}
		@catch (NSException * e) {
			strName=@"";
		}
		@finally 
		{
			
		}
		@try 
		{			
			if( [  [mainScreenData objectAtIndex : i ]  isKindOfClass:[NSDictionary class]  ] ){
				strCount =  [ [mainScreenData objectAtIndex:i] objectForKey:@"Total"];			
				[strCount length];
			}
		}
		@catch (NSException * e)
		{			
			strCount=@"0";
		}
		@finally 
		{
			
		}
}
Is there a safe way to read this Array
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.