Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > iPhone SDK Development Forums > iPhone SDK Development

Reply
 
LinkBack Thread Tools Display Modes
Old 12-19-2011, 12:17 AM   #1 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 17
erritikamathur is on a distinguished road
Default Can't switch tab in Tabarcontroller for iPad

In my appdelegate, i add view having UItabbarcontroller
Code:
TabbedViewController *tabVCntrl = [[TabbedViewController alloc]init];
    [self.window addSubview:tabVCntrl.view];
I have created a UIViewcontroller subclass 'TabbedViewController' ,its xib include UItabbarcontroller. In its viewDidLoad i added view of tabarcontroller

Code:
- (void)viewDidLoad {
    [self.view addSubview:tabBarCntrl.view];
}
I have 5 tabs in controller,each one is Navigationcontroller with respective rootViewController. I basically have native iPhone app .That works good. Now when i am upgrading this to Universal App,the tabbarcontroller seems to load fine .But i cant switch tabs.It seems lower part of app isn't userinteraction enabled. What could be reason for this?
erritikamathur is offline   Reply With Quote
Old 12-19-2011, 10:25 AM   #2 (permalink)
New To iOS
 
Join Date: Nov 2011
Location: Waterloo, ON
Age: 20
Posts: 187
RileyE is on a distinguished road
Default

Quote:
Originally Posted by erritikamathur View Post
In my appdelegate, i add view having UItabbarcontroller
Code:
TabbedViewController *tabVCntrl = [[TabbedViewController alloc]init];
    [self.window addSubview:tabVCntrl.view];
I have created a UIViewcontroller subclass 'TabbedViewController' ,its xib include UItabbarcontroller. In its viewDidLoad i added view of tabarcontroller

Code:
- (void)viewDidLoad {
    [self.view addSubview:tabBarCntrl.view];
}
I have 5 tabs in controller,each one is Navigationcontroller with respective rootViewController. I basically have native iPhone app .That works good. Now when i am upgrading this to Universal App,the tabbarcontroller seems to load fine .But i cant switch tabs.It seems lower part of app isn't userinteraction enabled. What could be reason for this?
Well, what you should do is put all of the views onto one UITabBarController in your App Delegate. Thats a quick and easy way to get a tab bar working. Then set the tab controller to your window instead.

It just sounds like you have 5 views, each with tab controllers.

Last edited by RileyE; 12-19-2011 at 10:27 AM.
RileyE is offline   Reply With Quote
Old 12-20-2011, 03:17 AM   #3 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 17
erritikamathur is on a distinguished road
Default

No, i basically have one tabbarcontroller only that is in TabbedViewController xib.I add it there because i need to enable/disable some tabs based on some property.
Each of my tabs have a single viewController class
erritikamathur is offline   Reply With Quote
Old 12-21-2011, 09:37 AM   #4 (permalink)
New To iOS
 
Join Date: Nov 2011
Location: Waterloo, ON
Age: 20
Posts: 187
RileyE is on a distinguished road
Default

Quote:
Originally Posted by erritikamathur View Post
No, i basically have one tabbarcontroller only that is in TabbedViewController xib.I add it there because i need to enable/disable some tabs based on some property.
Each of my tabs have a single viewController class
Well, I would recommend creating the tab bar programatically (don't put it in the xib) and then just access the tab bar controller and disable what you need programmatically as well.

You can access each view controller that is added to a tab bar controller. You just have to learn what to do when you access it to reach your goal. I find that when you're running into a problem with IB or storyboards, you should just do it programmatically instead.

Personally, I don't have any xibs in my projects (and I don't use story boards), because I prefer to do everything with code. That way I can see where my problem is and I can have more control.

I'm not recommending you do this, but when you run into an issue pertaining to IB or storyboards, then switching the way you're going about the problem can usually help.

If you need more information, just ask.
RileyE is offline   Reply With Quote
Reply

Bookmarks

Tags
ipad, uitabbar, uitabbarcontroller, universal app problem

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 393
13 members and 380 guests
7twenty7, AppsBlogger, Creativ, Dalia, David-T, Duncan C, HemiMG, heshiming, LunarMoon, Murphy, pbart, teebee74, Tomsky
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,676
Threads: 94,127
Posts: 402,915
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jleannex55
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 06:50 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0