2015-03-02 164 views

回答

1

这是因为[theWeather getCurrent:]调用[operation start]这是一个异步方法。它只会发送请求以获取天气信息并立即返回,因此在数据仍在下载/解析时会显示UIAlertView

避免发生这种情况的一种方法是使getCurrent方法接受在解析数据后调用的successCallback。这个回调然后创建并显示UIAlertView

+0

哦,我明白了! 非常感谢! – Student 2015-03-02 21:40:17

+0

[接受答案:它是如何工作的?](http://meta.stackexchange.com/a/5235);-) – curlybracket 2015-03-02 21:44:36