Reposting with more concise and focused question after original question went unanswered. Also adding more insight into the problem after another day of research:
I
Looks like there is no problem with your hidden code. If I were you, I would comment out all the code after the call ends, and uncomment them one by one to see what is the problem.
Try changing your code to this:
- (void)ctCallStateDidChange:(NSNotification *)notification
{
NSLog(@"121");
NSString *callInfo = [[notification userInfo] objectForKey:@"callState"];
if ([callInfo isEqualToString:CTCallStateDisconnected]) {
NSLog(@"before show");
[self.view viewWithTag:kNONEMERGENCYCALLSAVEDTOLOG_TAG].hidden = NO;
NSLog(@"after show");
}
}
Note:
NSNotification, not an NSDictionary==hidden propertyNO instead of falseUpdate: Got an idea: Could you try the following, please, in between the NSLogs?
dispatch_async(dispatch_get_main_queue(), ^{
[self.view viewWithTag:kNONEMERGENCYCALLSAVEDTOLOG_TAG].hidden = NO;
});
Reading the CTCallCenter doc, it seems the callEventHandler is dispatched on "the default priority global dispatch queue", which is not the main queue where all the UI stuff happens.
djibouti33,
Where you put this sentence to listen when a user taps a button that dials a phone number?on WillResignActive function?
this sentence --> [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ctCallStateDidChange:) name:@"CTCallStateDidChange" object:nil];
Thanks for your time,
Willy.
Hm... try to call [yourViewController.view setNeedsDisplay] after you change hidden property. Or avoid hidden, use alpha or addSubview: and removeFromSuperview methods instead.