Hi
I am getting an NSArray mainScreenData through a web service [created in Microsoft .Net]
as shown below:
When I try to iterate over this NSArray using a for loop, I am getting error.
The code for looping over this Array is:
Is there a safe way to read this Array
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
{
}
}