NSData Sync Download
NSString * Path =@"http://10.0.100.8/sns/my/user_list.php"; //go to URL objectNsurl * url =[Nsurl Urlwithstring:path]; //Transfer DataNSData * data =[NSData Datawithcontentsofurl:url]; if(data) {IDobj =[nsjsonserialization jsonobjectwithdata:data options:nsjsonreadingmutablecontainers Error:nil]; //This is a synchronous request request and the response is togetherNSLog (@"%@", obj); } //simultaneous downloads can clog the thread's main threads---display UIUialertview* Alert = [[Uialertview alloc]initwithtitle:@"Enter the main interface"Message:nilDelegate: Nil Cancelbuttontitle:nil Otherbuttontitles:@"Determine", nil]; [Alert show];
nsconnection Sync Download
NSString * Path =@"http://10.0.100.8/sns/my/user_list.php"; //go to URL objectNsurl * url =[Nsurl Urlwithstring:path]; //Transfer DataNSData * data =[NSData Datawithcontentsofurl:url]; if(data) {IDobj =[nsjsonserialization jsonobjectwithdata:data options:nsjsonreadingmutablecontainers Error:nil]; //This is a synchronous request request and response one goNSLog (@"%@", obj); } //simultaneous downloads can clog the thread's main threads---display UIUialertview* Alert = [[Uialertview alloc]initwithtitle:@"Enter the main interface"Message:nilDelegate: Nil Cancelbuttontitle:nil Otherbuttontitles:@"Determine", nil]; [Alert show];
Simultaneous download of NSData and nsconnection