【发布时间】:2014-01-31 13:32:54
【问题描述】:
我能够在我的项目中实现下面提到的库。 使用的库:: https://github.com/rolandleth/LTHPasscodeViewController
输入 pin 码并验证它是否正确后,我无法在输入 pin 码后直接切换到选项卡栏活动,但如果我在两者之间使用 NSNotification,我可以转移控制权。
我的代码:
- (void) receiveTestNotification:(NSNotification *) notification
{
if ([[notification name] isEqualToString:@"TestNotification"])
NSLog (@"Successfully received the test notification!");
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
mainTabViewController *objSec=[storyboard instantiateViewControllerWithIdentifier:@"passID"];
[self.navigationController pushViewController:objSec animated:YES];
放置 NSLog 后,我也得到了日志输出,但选项卡视图没有出现。
有没有办法在pin-entry之后直接调用tab-view。
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(receiveTestNotification:)
name:@"TestNotification"
object:nil];
使用 StoryBoard 完成的 Tabview。
【问题讨论】:
-
试过在 mainThread 上切换 UI 吗?
标签: ios objective-c ios7 nsnotificationcenter uitabview