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 01-27-2011, 09:51 AM   #1 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Angry TabView Help: clicking on a button and loading xib hides tab

Hey all, i'm really new to all this iphone dev and i'm just trying to get some stuff working. I have a tabView controller that has 5 tabs. Each tab loads a xib file. In the first xib file i have 4 buttons. When i click on one of the buttons i am making it load a new xib. the problem is that by doing this, it loads the xib, but it seems to load it over the tabView.... another words, the tab bar disappears. How do i fix this. Thanks all!
grem28 is offline   Reply With Quote
Old 01-27-2011, 10:16 AM   #2 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Do you really expect an answer without showing any code?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 10:20 AM   #3 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default here you go.

Quote:
Originally Posted by BrianSlick View Post
Do you really expect an answer without showing any code?
welcome.xib is already loaded as the first tab.. here's the code.

Welcome.h

Code:
#import <UIKit/UIKit.h>
@class Page1;


@interface Welcome : UIViewController {

	IBOutlet UIButton *allBut;
	Page1 *pg1;
	
}

@property (nonatomic, retain) IBOutlet UIButton *allBut;
@property (nonatomic, retain) Page1 *pg1;

- (IBAction) getButView: (id) sender ;

@end

Welcome.m

Code:
#import "Welcome.h"
#import "Page1.h"


@implementation Welcome
@synthesize allBut, pg1;

- (IBAction) getButView: (UIButton *) sender {
	
	switch (sender.tag) {
		case 0:
			//Page1 *svc = [[Page1 alloc] initWithNibName: @"Page1" bundle: nil];
			//pg1.delegate = self;
			
			pg1 = [[Page1 alloc] initWithNibName:@"Page1" bundle:nil];
			
			[self presentModalViewController: pg1 animated: YES];
			[pg1 release];
			break;
			
		case 1:
			NSLog(@"But 2");
			break;
			
		case 2:
			NSLog(@"But 3");
			break;
			
		case 3:
			NSLog(@"But 4");
			break;
			
		default:
			NSLog(@"HELLO2");
			break;
	}
}
Page1.xib is just a page with text in it.
grem28 is offline   Reply With Quote
Old 01-27-2011, 10:21 AM   #4 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

presentModalViewController will take over the whole screen. If you still want to see the tab bar, then you should do something else. Perhaps use a navigation controller to push the new view controller.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 10:41 AM   #5 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default ...

Quote:
Originally Posted by BrianSlick View Post
presentModalViewController will take over the whole screen. If you still want to see the tab bar, then you should do something else. Perhaps use a navigation controller to push the new view controller.
here's the layout i'm trying to do:




click on the about, it takes u to the about.xib with the tabs on the bottom.
grem28 is offline   Reply With Quote
Old 01-27-2011, 10:42 AM   #6 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

That's fine. Use a navigation controller.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 10:44 AM   #7 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
That's fine. Use a navigation controller.
does the navigation controller go on the welcome.xib or on the about.xib?
grem28 is offline   Reply With Quote
Old 01-27-2011, 10:45 AM   #8 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Neither. It will be the first view controller in your Welcome tab. You will specify which view controller should appear first in the navigation controller.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 10:52 AM   #9 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Neither. It will be the first view controller in your Welcome tab. You will specify which view controller should appear first in the navigation controller.
sorry dude, i'm a noob. you kinda lost me there. I used the TabBar Application template.

The first tab is set to welcome.xib. Where do i stick the navigation controller to? Won't sticking the navigation controller also place a tabbar on top of the initial design... i.e.



?
grem28 is offline   Reply With Quote
Old 01-27-2011, 10:54 AM   #10 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

The navigation bar can be turned off.

Right now you have:

Code:
Tab bar controller
...view controller
...view controller
...view controller
...view controller
...view controller
What you need to have:

Code:
Tab bar controller
...Navigation controller
......view controller
...view controller
...view controller
...view controller
...view controller
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 11:19 AM   #11 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
The navigation bar can be turned off.

Right now you have:

Code:
Tab bar controller
...view controller
...view controller
...view controller
...view controller
...view controller
What you need to have:

Code:
Tab bar controller
...Navigation controller
......view controller
...view controller
...view controller
...view controller
...view controller
so how do i go abouts doing that? In IB, i select the first tab and (what i did before) then select the welcome. how do you select a navigation conroller?
grem28 is offline   Reply With Quote
Old 01-27-2011, 11:20 AM   #12 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Drag a navigation controller directly to the tab bar.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 11:26 AM   #13 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by grem28 View Post
so how do i go abouts doing that? In IB, i select the first tab and (what i did before) then select the welcome. how do you select a navigation conroller?
Hold on... i just realized something. How will it be with the tab buttons. do each one load a navcontroll or only the one i want.

TabController
tab1
(NavC)
Welcome
About
Videos
etc

tab 2
Events

tab 3
Donate
tab 4
(NavC)
FindUs (map)
Details page (annotation call out)

that's correct right?
grem28 is offline   Reply With Quote
Old 01-27-2011, 11:49 AM   #14 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Yes.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 12:06 PM   #15 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Yes.
Dude, Thanks a million!!!! I finally got some stuff going. Another question for you... how do i make it so the fourth button on my welcome screen says something like contact us. when the user clicks, it brings up a menu from the bottom that will have 3 options: call us (click it and it dials), email (click and email opens up), and cancel. Here's a screenshot from an app i have that has that menu i'm referring to.



Thanks for everything... really, you are awesome!
grem28 is offline   Reply With Quote
Old 01-27-2011, 12:07 PM   #16 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

UIActionSheet
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 12:17 PM   #17 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
UIActionSheet
Alright, so that's not in IB then. Thanks a lot. You really rock. One more before i'm done... from the loading of the page... (push.... xib). how do i go back to the welcome screen

welcome > about...

about > welcome

?
grem28 is offline   Reply With Quote
Old 01-27-2011, 12:19 PM   #18 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

See the UINavigationController documentation.

popViewControllerAnimated:
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 07:43 PM   #19 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
See the UINavigationController documentation.

popViewControllerAnimated:
okay, i'm real close now. I got the navigation working. i click on one of the four buttons and it slides to my "Page1.xib" (about us). Now, on the Welcome.xib, i have the navigation controller hidden. When i click on the About button and load the Page1.xib, how do i get the controller to show up with the back button? I tried adding a navigation controller in IB but that doesn't seem to connect to the original nav controller.
grem28 is offline   Reply With Quote
Old 01-27-2011, 07:45 PM   #20 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

The navigation controller is still there. The bar is simply hidden. Show it. Read the documentation for that class.
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 10:18 PM   #21 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
The navigation controller is still there. The bar is simply hidden. Show it. Read the documentation for that class.
Thanks for your help brian. I really appreciate it! Sorry that i still don't get it. I looked at the documentation and here's what I got...

Code:
- (void)viewDidLoad {
    [super viewDidLoad];
	
	self.title = @"About Us";
	[self.navigationController popViewControllerAnimated:YES];
}
I placed that in the page (About Us) that is being loaded and my navigation bar is still missing. What am i doing wrong?
grem28 is offline   Reply With Quote
Old 01-27-2011, 10:26 PM   #22 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

You really didn't find any methods related to the navigation bar? Really?
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Old 01-27-2011, 10:40 PM   #23 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
You really didn't find any methods related to the navigation bar? Really?
Sorry. I'm really new at this. Trying to figure it our
grem28 is offline   Reply With Quote
Old 01-28-2011, 09:02 AM   #24 (permalink)
Registered Member
 
Join Date: Jan 2011
Posts: 48
grem28 is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
You really didn't find any methods related to the navigation bar? Really?
ok... i found what you were talking about... i tried to implement it but i'm doing something wrong...

- (void)viewDidLoad {
[super viewDidLoad];

self.title = @"About Us";
- (void)setNavigationBarHidden:NO animated:YES animated ;

}

This doesn't work. how do i get this to work?
grem28 is offline   Reply With Quote
Old 01-28-2011, 09:04 AM   #25 (permalink)
Emphasizing Fundamentals
 
BrianSlick's Avatar
 
Join Date: Jul 2009
Location: NoVA / DC Area
Age: 36
Posts: 7,990
BrianSlick has a spectacular aura about
Default

Oh boy. You need to get yourself an Objective-C book, quickly.

Code:
[[self navigationController] setNavigationBarHidden:NO animated:YES];
__________________
BriTer Ideas LLC - Professional iOS App Development. Available for hire.

SlickShopper 2 | Free NSLog utility | Leave a PayPal donation.

Are you a newbie? Things you should read:
Definitive Guide To Properties | UITableView Series | Guide To Troubleshooting | Model Object Overview

Do you sit at a desk all day? Walk instead! Follow along with my treadmill desk adventures.
BrianSlick is offline   Reply With Quote
Reply

Bookmarks

Tags
tab bar application, tab bar controller, tabview

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: 357
14 members and 343 guests
7twenty7, Clouds, dre, EvilElf, iAppDeveloper, jeroenkeij, jimmyon122, Mah6447, Morrisone, n00b, pungs, Sami Gh, stanny, toon4413
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,667
Threads: 94,121
Posts: 402,899
Top Poster: BrianSlick (7,990)
Welcome to our newest member, host number one
Powered by vBadvanced CMPS v3.1.0

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