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 09-13-2010, 11:42 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 13
v3interactive is on a distinguished road
Default What is called when the back button is clicked?

I have a view controller with a table view in it, there is a UIView that i am setting alpha = 0.0 on when I choose a section in the tableview, I want that UIView to come back when you get to the root view. I am trying viewDidAppear, but it only works on the tab buttons, not with the back button on the navigation controller.

Any suggestions?

thanks,

v3
v3interactive is offline   Reply With Quote
Old 09-13-2010, 11:46 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

Quote:
Originally Posted by v3interactive View Post
. I am trying viewDidAppear, but it only works on the tab buttons, not with the back button on the navigation controller.
Incorrect.
__________________
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 09-13-2010, 11:50 AM   #3 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 13
v3interactive is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Incorrect.
TabBar is subclassed, do you think that could have something to do with it? I am putting a NSLog in the view controller that I am interested in's viewDidAppear and it does NOT show up when I hit the back btn.
v3interactive is offline   Reply With Quote
Old 09-13-2010, 11:51 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

viewDidLoad won't fire again unless the view was unloaded.
__________________
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 09-13-2010, 11:52 AM   #5 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 13
v3interactive is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
viewDidLoad won't fire again unless the view was unloaded.
Sorry I mistyped there, I meant viewDidAppear.
v3interactive is offline   Reply With Quote
Old 09-13-2010, 11:53 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

Then you have either mis-typed that method name, or you have something set up incorrectly with your view/controller structure.
__________________
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 09-13-2010, 11:56 AM   #7 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 13
v3interactive is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Then you have either mis-typed that method name, or you have something set up incorrectly with your view/controller structure.
-(void)viewWillAppearBOOL)animated {
//[super viewWillAppear:NO];
NSLog(@"view will appear");
}

-(void)viewDidAppearBOOL)animated {
[super viewDidAppear:NO];
NSLog(@"view did appear");
}

Do you see anything wrong with those that I am missing?

Thanks for your replies...
v3interactive is offline   Reply With Quote
Old 09-13-2010, 11:57 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

Use the CODE tags.

Those look correct, so it must be a problem with your view structure.
__________________
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 09-13-2010, 12:03 PM   #9 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 13
v3interactive is on a distinguished road
Default

Quote:
Originally Posted by BrianSlick View Post
Use the CODE tags.

Those look correct, so it must be a problem with your view structure.

that is the loadView from the VC in question. Each section on the tab bar has its own UINavigationController. Am I doing this the wrong way?

Code:
-(void) loadView {
	NSLog(@"loadView");
	UINavigationController * nav = [[UINavigationController alloc] initWithNibName:nil bundle:nil];
	[self setNavController:nav];
	nav.navigationBar.tintColor = [UIColor grayColor];// colorWithRed:0.3176f green:0.3568f blue:0.3647f alpha:1.0f];
	CAGradientLayer *gradient = [CAGradientLayer layer];
	gradient.frame = CGRectMake(0.0, 0.0, 320.0, 44.0);
	
	gradient.colors = [NSArray arrayWithObjects:(id)[[UIColor whiteColor] CGColor], (id)[[UIColor colorWithRed:0.7843 green:0.7843 blue:0.7843 alpha:1.0] CGColor], nil];
	[[[nav navigationBar] layer] insertSublayer:gradient atIndex:0];
	
	[nav release];
	
	MainNavTableViewController * main = [[MainNavTableViewController alloc] initWithStyle:UITableViewStylePlain];
	[[self navController] setViewControllers:[NSArray arrayWithObjects:main, nil]];
	[main release];
	
	[[navController view] setBackgroundColor:[UIColor colorWithPatternImage:[UIImage imageNamed:@"green_background.png"]]];
	[self setView:[navController view]];
	
	logOutBar = [[UIView alloc] initWithFrame:CGRectMake(0.0, 386.0, 320.0, 60.0)];
	UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"logout_bar.png"]];
	[logOutBar addSubview:img];
	[logOutBar setOpaque:YES];
	[img release];
	[[self view] addSubview:logOutBar];
	//[logOutBar release];
	
	logOutBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    [logOutBtn setFrame:CGRectMake(200.0, 386.0, 70, 30.0)]; 
    [logOutBtn setTitle:@"" forState:UIControlStateNormal];
    [logOutBtn addTarget:self action:@selector(logout:) forControlEvents:UIControlEventTouchUpInside];
	[logOutBtn setOpaque:YES];
	[[self view] addSubview:logOutBtn];
}
v3interactive is offline   Reply With Quote
Old 09-13-2010, 01:09 PM   #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

Navigation controllers contain view controllers. You are doing this backwards.
__________________
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

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: 339
14 members and 325 guests
Absentia, cgokey, fiftysixty, givensur, heshiming, iGamesDev, linkmx, michaelhansen, mraalex, PixelInteractive, raihan.zbr, Sloshmonster, Trickphotostudios
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,657
Threads: 94,116
Posts: 402,889
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jenniead38
Powered by vBadvanced CMPS v3.1.0

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