0
我知道這個問題已多次報道(我點擊了幾十個問題/解決方案),但是,我真的沒有得到這個。AFNetworking和越來越wait_fences:未能收到答覆:10004003
我有一個POST請求通過AFJSONRequestOperation
。在成功的塊,我做到以下幾點:
NSString *errorString = [ErrorHandler getErrorMessage:[jsonDictionary valueForKey:@"ERROR"]];
UIAlertView *mainAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:errorString delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil];
[self performSelector:@selector(showAlert:) withObject:mainAlert afterDelay:.5]; // Doesn't work
[NSTimer scheduledTimerWithTimeInterval:0.05 target:self selector:@selector(showAlert:) userInfo:mainAlert repeats:NO]; // Doesn't work!
// Function that gets called
- (void)showAlert:(NSTimer *)timer
{
UIAlertView *mainAlert = timer.userInfo;
[mainAlert show];
}
我試圖與被貼在SO(performSelector
,並與一些我自己的想法沿NSTimer
)的多種解決方案。但是,我不斷得到這個臭名昭着的消息。除了初始化一些變量外,我沒有在viewDidLoad
方法中做任何事情。還有什麼可以爲此嘗試嗎?我正在爲iOS 5.0編程,並且正在模擬器上完成。