I am having one array where i am fetching data from database for some specific value,and hence the key where that particular value is not there,it is fetching null value in the array.
Now,my question is how can i eliminate that null value from the array? I tried to fetch the nsarray value to nsstring and then to another array,but then it is not fetching the whole array,but takes the last indexed value.
Please help me out. Thank you.
I am attaching code for further reference :
NSString *url = [NSString stringWithFormat:@"webservice from where i m fetching data"];
NSLog(url);
NSMutableURLRequest *request=[NSMutableURLRequest requestWithURL:[NSURL URLWithString:url]];
[request setHTTPMethod: @"POST"];
NSData *returnData = [ NSURLConnection sendSynchronousRequest:request returningResponse: nil error: nil ];
NSString *returnString = [[NSString alloc] initWithData:returnData encoding: NSUTF8StringEncoding];
dataArray=[[returnString JSONValue] retain];
[self setAlldetails:dataArray];
nsarray *InteName = [alldetails valueForKey:@"IntelligenceName"];
So the array fetches value for array InteName like this :
(
"00:00:00",
"00:00:00",
"17:15:00",
"17:15:00",
"17:15:00",
"17:15:00",
"00:00:00",
"00:00:00",
"17:15:00",
"17:15:00",
"17:15:00",
"17:15:00",
"<null>",
"<null>",
"<null>",
"<null>",
"<null>",
"<null>",
"<null>",
"<null>",
"<null>"
)
so now,i want to remove occurance of the value null.
any guesses??
Got the solution while doing T & E :