CallViewController无法present出来,实时语音没法实现
这是ChatHelprDemo中执行的present断点
这是我写的DCMainBarViewController
尝试去alloc init,但我的mainVC依旧空的,是什么原因导致的?怎么能够解决?,present不出来callViewController界面是mainVC为空导致的吗?
这是我写的DCMainBarViewController
@interface DCMainBarViewController ()
@property (nonatomic, strong) UINavigationController *navigationController;
@property (nonatomic, strong) WXTabBarController *tabBarController;
@end
@implementation DCMainBarViewController
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
UIWindow *window = [[UIApplication sharedApplication].windows objectAtIndex:0];
window.rootViewController = self.navigationController;
}
- (UINavigationController *)navigationController {
if (_navigationController == nil) {
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:self.tabBarController];
// navigationController.navigationBar.tintColor = [UIColor colorWithRed:26 / 255.0 green:178 / 255.0 blue:10 / 255.0 alpha:1];
_navigationController = navigationController;
}
return _navigationController;
}
- (WXTabBarController *)tabBarController {
if (_tabBarController == nil) {
WXTabBarController *tabBarController = [[WXTabBarController alloc] init];
DCHomePageViewController *mainframeViewController = ({
DCHomePageViewController *mainframeViewController = [[DCHomePageViewController alloc]initWithNibName:@"DCHomePageViewController" bundle:nil];
UIImage *mainframeImage = [UIImage imageNamed:@"tab_bar_home"];
UIImage *mainframeHLImage = [UIImage imageNamed:@"tab_bar_home_press"];
// mainframeViewController.title = @"首页";
mainframeViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"首页" image:mainframeImage selectedImage:mainframeHLImage];
// mainframeViewController.view.backgroundColor = [UIColor colorWithRed:48 / 255.0 green:67 / 255.0 blue:78 / 255.0 alpha:1];
mainframeViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"barbuttonicon_add"]
style:UIBarButtonItemStylePlain
target:self
action:@selector(didClickAddButton:)];
mainframeViewController;
});
ConversationListController *contactsViewController = ({
ConversationListController *contactsViewController = [[ConversationListController alloc] init];
UIImage *contactsImage = [UIImage imageNamed:@"tab_bar_huihua"];
UIImage *contactsHLImage = [UIImage imageNamed:@"tab_bar_huihua_press"];
// contactsViewController.title = @"会话";
contactsViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"会话" image:contactsImage selectedImage:contactsHLImage];
// contactsViewController.view.backgroundColor = [UIColor colorWithRed:115 / 255.0 green:155 / 255.0 blue:6 / 255.0 alpha:1];
contactsViewController;
});
UIStoryboard * storyBoard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DCQuanZiViewController *meViewController = ({
DCQuanZiViewController *meViewController = [storyBoard instantiateViewControllerWithIdentifier:@"quanziViewC"];
UIImage *meImage = [UIImage imageNamed:@"tab_bar_quanzi"];
UIImage *meHLImage = [UIImage imageNamed:@"tab_bar_quanzi_press"];
meViewController.title = @"工作圈";
meViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"工作圈" image:meImage selectedImage:meHLImage];
// meViewController.view.backgroundColor = [UIColor colorWithRed:199 / 255.0 green:135 / 255.0 blue:56 / 255.0 alpha:1];
meViewController;
});
DCApplicationViewController *discoverViewController = ({
DCApplicationViewController *discoverViewController = [[DCApplicationViewController alloc]initWithNibName:@"DCApplicationViewController" bundle:nil];
UIImage *discoverImage = [UIImage imageNamed:@"tab_bar_app"];
UIImage *discoverHLImage = [UIImage imageNamed:@"tab_bar_app_press"];
// discoverViewController.title = @"应用";
discoverViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"应用" image:discoverImage selectedImage:discoverHLImage];
// discoverViewController.view.backgroundColor = [UIColor colorWithRed:32 / 255.0 green:85 / 255.0 blue:128 / 255.0 alpha:1];
discoverViewController;
});
UIStoryboard * storyBoard1 = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
DCNewSettingViewController *settingViewC=[storyBoard1 instantiateViewControllerWithIdentifier:@"newSettingViewC"];
DCNewSettingViewController*NewSettingcoverViewController = ({
DCNewSettingViewController *NewSettingcoverViewController = [storyBoard1 instantiateViewControllerWithIdentifier:@"newSettingViewC"];
UIImage *discoverImage = [UIImage imageNamed:@"tab_bar_personal"];
UIImage *discoverHLImage = [UIImage imageNamed:@"tab_bar_personal_press"];
// NewSettingcoverViewController.title = @"设置";
NewSettingcoverViewController.tabBarItem = [[UITabBarItem alloc] initWithTitle:@"设置" image:discoverImage selectedImage:discoverHLImage];
// NewSettingcoverViewController.view.backgroundColor = [UIColor colorWithRed:32 / 255.0 green:85 / 255.0 blue:128 / 255.0 alpha:1];
NewSettingcoverViewController;
});
tabBarController.title = @"首页";
// tabBarController.tabBar.tintColor = [UIColor colorWithRed:26 / 255.0 green:178 / 255.0 blue:10 / 255.0 alpha:1];
//
tabBarController.viewControllers = @[
[[UINavigationController alloc] initWithRootViewController:mainframeViewController],
[[UINavigationController alloc] initWithRootViewController:contactsViewController],
[[UINavigationController alloc] initWithRootViewController:meViewController],
[[UINavigationController alloc] initWithRootViewController:discoverViewController],
[[UINavigationController alloc] initWithRootViewController:NewSettingcoverViewController]
];
_tabBarController = tabBarController;
}
return _tabBarController;
}
尝试去alloc init,但我的mainVC依旧空的,是什么原因导致的?怎么能够解决?,present不出来callViewController界面是mainVC为空导致的吗?
没有找到相关结果
已邀请:
3 个回复
[已注销]
小北不想风
[已注销]