In api sometime due to some error on server side app is getting html content with response. Api was executed properly but due to html content app is not able to parse response and shows error message. This same thing work fine in android because somehow android parser ignore html content and only prase json response. Same way I want to perform json parsing in objetive-C.
Below is content which is coming in api response.
( ! ) Warning: oci_execute(): ORA-01791: not a SELECTed expression in E:\wamp\www\GRABBER16\common.php on line 6 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0005 | 261072 | {main}( ) | ..\Delete_Dm_Group_Users.php:0 |
2 | 0.0117 | 1264824 | ExecutiveClass->executeQuery( ) | ..\Delete_Dm_Group_Users.php:27 |
3 | 0.0117 | 1264928 | oci_execute ( ) | ..\common.php:6 |
( ! ) Warning: oci_fetch_array(): ORA-24374: define not done before fetch or execute and fetch in E:\wamp\www\GRABBER16\common.php on line 8 | ||||
---|---|---|---|---|
Call Stack | ||||
# | Time | Memory | Function | Location |
1 | 0.0005 | 261072 | {main}( ) | ..\Delete_Dm_Group_Users.php:0 |
2 | 0.0117 | 1264824 | ExecutiveClass->executeQuery( ) | ..\Delete_Dm_Group_Users.php:27 |
3 | 0.0143 | 1265656 | oci_fetch_array ( ) | ..\common.php:8 |
{"STATUS":"1","MESSAGE":"No Users Found!","DATA":[]}
Below is code which I am using to parse data in application
NSError *err;
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:data options:0 error:&err];
But this response data always give error
Error Domain=NSCocoaErrorDomain Code=3840 "JSON text did not start with array or object and
option to allow fragments not set." UserInfo={NSDebugDescription=JSON text did not start with
array or object and option to allow fragments not set.}
Is there any way to ignore this error and parse data with json content.