-1
這裏我試圖從mywebpage獲取html,bt somethng是錯誤的..這裏是我的代碼..我已經在我的controller.h文件中聲明瞭html字符串。NSURLConnection sendAsynchronousRequest NSData不能訪問外側塊
[NSURLConnection sendAsynchronousRequest:urlRequest queue:queue completionHandler:^(NSURLResponse *responde,NSData *Data,NSError *error){
html=[[NSString alloc] initWithData:Data encoding:NSUTF8StringEncoding];
//NSLog(@"%@",html); //WORKING
}];
NSLog(@"%@",html); //NOT WORKING
那麼我應該怎麼做才能訪問已存儲的數據我的HTML變量從webserivce來的? – BaSha
在塊內部訪問它,如果需要,可以將數據發送到其他方法。 –