开发者

iOS Application Design Issue and associated UIImagePickerController Issue

I have a TabBar which has 4 items. All the 4 items respond to individual UIViewControllers. For example there is a item, which displays a screen to the user to get a photograph and upload it to a site. Now this UIViewController (postAppViewController) gets called from the AppDelegate like the following:

[tabItemsViewControllers addObject: [[ PostPageViewController alloc] initWithPost]];

where initWithPost defines the TabBar in described above.

Now postAppViewController calls a separate UIView (postAppView) from loadView. Then postAppView calls in one UINavigationController and one UITableViewController (postTableViewController).

Is this good design? I guess not because I am running into the following:

postTableViewController displays a Button which when clicked ki开发者_运维问答cks in a UIImagePickerController (kicker) which then is presented to the user by calling the following:

[self presentModalViewController:picker animated:YES];

What I am seeing is that the tabbar exists and comes over the Camera/Image Library presentModalViewController.

Can you point out if I am going wrong with design or what else I can do to make sure the tabBar problem gets solved. Let me know if I am not being very clear in here.

Many Thanks. AB


Typically the way I handle the tabbar/nav controller stuff is that in my app delegate, I construct all of the view controllers. In there I also construct the nav controller(s). When I add the view controllers to the tab bar (setViewControllers:), I set the nav controller(s). I have a few apps where some of the tabs have nav controllers and some don't and this scheme seems to work out pretty well. I don't have the code in front of me though to give you a specific example. I will say that doing it this way, I never see the problems you run into and I use the camera/library picker a lot along with other modal view controllers. Is that at all clear?


Present the modal view controller from the UITabBarController instead of the associated UIViewController

[self.tabBarController presentModalViewController:picker animated:YES]

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜