Sto usando AFJSONRequestOperation
richiedere un server e analizzare la risposta JSON restituito, ma durante l'analisi, ho ottenuto questo errore:NSDebugDescription = "Il testo JSON non è stato avviato con array o oggetto e opzione per consentire ai frammenti non impostati.";
NSDebugDescription = "JSON text did not start with array or object and option to allow fragments not set.";
ho controllato l'API ed è la restituzione dei dati JSON:
header('Content-type: text/json');
$arr[] = array("Message" => "update succeeded");
echo '{"Result":'.json_encode($arr).'}';
Qualche idea su come sistemarlo?
EDIT
Ho provato a chiamare l'API da browser e comprendono la richiesta nel URL, e così ho ottenuto una risposta valida JSON:
{"Result":[{"Message":"update succeeded"}]}
Potresti pubblicare la stringa JSON ricevuta da 'AFJSONRequestoperation'. –
Salve, il JSON che ho inserito nel blocco di errore è '(null)' – Malloc
puoi eseguire l'api nel browser e includere la risposta alla domanda? –