I have an iOS app that reads this php code:
$result = mysql_query("SELECT id, SUM(points) AS POINTS FROM tags WHERE id='$userudid' GROUP BY originudid");
$resultarray = array();
while($obj = mysql_fetch_object($result)) {
$resultarray[] = $obj;
}
Echo $json->encode($resultarray);
its called/received in iOS as this:
self.myPoints = [NSDictionary dictionaryWithJSONString:responseString error:&outError];
where myPoints is an NSDictionary and im using the TouchJSON library to convert the json string to an NSDictionary...but isKindOfClass is not recognizing it as such:
NSLog(@"the pointsdict is:%@",myPoints);
NSLog(@"Is of type NSArray?: %@", ([myPoints isKindOfClass:[NSString class]])? @"Yes" : @"No");
I log the responseString returned by ASIHTTPRequest method as such:
the responsestring is:
[{"originudid":"F6869FB4-2EBE-5D43-A62D-5D4007646764","PUNTOS":"2"}]
And logging the object itself results in this:
the pointsdict is:(
{
POINTS = 2;
id = "F6869FB4-2EBE-5D43-A62D-5D4007646764";
}
)
but its not recognized as a dictionary, isKindOfClass says its an NSArray. Is this because im taking the mysql_fetch_object obj$ and putting it into a $resultarray[] ?
So how should i fetch the data and return it?