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, 10:23 AM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 13
v3interactive is on a distinguished road
Default instance variable in Class Method crash

when I call dismissBar I get the first log, if I try and do anything with logOutBar it crashes. I am not sure what I am doing wrong, but I suspect it has to do with logOutBar being release (which if i don't realease it, it still crashes). Any help would be appreciated.

-(void) 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 arrayWithObjectsid)[[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];
}

+(void) dismissBar{
NSLog(@"dismissBar");
NSLog(@"%@", logOutBar);
//logOutBar.alpha = 0.0;
}

Last edited by v3interactive; 09-13-2010 at 10:28 AM.
v3interactive is offline   Reply With Quote
Old 09-13-2010, 01:47 PM   #2 (permalink)
Senior Member
iPhone Dev SDK Supporter
 
Join Date: Aug 2008
Location: Memphis, TN, USA
Age: 24
Posts: 3,983
smithdale87 is on a distinguished road
Send a message via AIM to smithdale87
Default

Where have you declared logoutBar? is it static?
smithdale87 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: 342
13 members and 329 guests
Absentia, cgokey, fiftysixty, givensur, heshiming, iGamesDev, linkmx, michaelhansen, mraalex, PixelInteractive, raihan.zbr, 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