NSString *urlString=[NSString stringWithFormat:@"http://192.168.178.1/iBus/appService/_getMarker.php"];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
NSError *error = [[NSError alloc] init];
NSHTTPURLResponse *responseCode = nil;
NSData *dataConnect;
dataConnect = [NSURLConnection sendSynchronousRequest:request returningResponse:&responseCode error:&error];//connect todata
NSDictionary * jsonObj;
if (responseCode) {//if connect(response)
NSLog(@"%@",dataConnect);//here is return data
NSLog(@"%@",[NSJSONSerialization JSONObjectWithData:dataConnect options:kNilOptions error:nil]);//here is return NULL!!!
}
Его возвращение NSData но не кодировать JSONв JSON xCode5 не кодирует
Вот утомительной консоль 2014-12-18 13: 14: 00.997 IBUS [2689: 58536] (нуль)
Вот мой выход JSON: http://notes.io/Zd3
Вы получаете данные в dataConnect? –
Вы должны использовать параметр ошибки в JSONObjectWithData: options: error: method и посмотреть, что он возвращает. – rdelmar
Вы проверили его в браузере? его даже не дает ответа на браузер, который я проверил. См. Это: http://192.168.178.1/iBus/appService/_getMarker.php – cyberlobe