Hi
I have a peculiar problem where my NSNotification seems to die in UIAlertView delegate function
I have four options present in a UIAlertView and to handle them i used its delegate class so that at each options I can do some different task. One of those task is to send some data to the server. For that I am using asynchronous request and also I have a loading view popping up whenever user select the option of uploading the data . In the loading view i have a activityindicator scroller which keeps rotating. I close the loading view as soon as I get any response from the server. This i did with NSNotification. But the following code is not working
The problem is the loading screen stops suddenly when I choose the option above. In ideal scenario it should stop when I again call
[[NSNotificationCenter defaultCenter] postNotificationName:NTF_LOADING_SCREEN_SHOULD_HIDE object:nil userInfo:loadDict];
which I am calling once I get the response from the server. But in my case the loading screen simply dies before i get any response from the server.
Can anyone suggest some ways
I have a peculiar problem where my NSNotification seems to die in UIAlertView delegate function
I have four options present in a UIAlertView and to handle them i used its delegate class so that at each options I can do some different task. One of those task is to send some data to the server. For that I am using asynchronous request and also I have a loading view popping up whenever user select the option of uploading the data . In the loading view i have a activityindicator scroller which keeps rotating. I close the loading view as soon as I get any response from the server. This i did with NSNotification. But the following code is not working
Code:
#pragma mark -
#pragma mark UIAlertViewDelegate methods
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
if(buttonIndex == 2)
{
//Save to server
if([self checkemail])
{
return;
}
//get loading screen up
NSDictionary* loadDict = [NSDictionary dictionaryWithObject:@"Loading..." forKey:@"text"];
[[NSNotificationCenter defaultCenter] postNotificationName:NTF_LOADING_SCREEN_SHOULD_SHOW object:nil userInfo:loadDict];
//request url
[self requestForUploading];
[userManager isLabeltobeShown:4];
}
The problem is the loading screen stops suddenly when I choose the option above. In ideal scenario it should stop when I again call
[[NSNotificationCenter defaultCenter] postNotificationName:NTF_LOADING_SCREEN_SHOULD_HIDE object:nil userInfo:loadDict];
which I am calling once I get the response from the server. But in my case the loading screen simply dies before i get any response from the server.
Can anyone suggest some ways