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

Mockup & CodeGen, iPhone & iPad
($9.99)

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

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum > Mac OS X Development Forums > Objective-C, Python, Ruby Development

Reply
 
LinkBack Thread Tools Display Modes
Old 03-04-2010, 04:05 PM   #1 (permalink)
Registered Member
 
Join Date: Mar 2010
Posts: 84
Default UITableviewController not Displaying header navigation bar!!!

I am a newbie to iphonedeveloper. I have a viewcontroller and an alertview in it.When the ok button on alertview is clicked,it takes to another UITAbleviewController. I get the objects displayed in the table but the title and navigationbar is not present. Any help is appreciated.


#import "Accidentdamagecar.h"
#import "Glassdamage.h"
#import "Accidentdamage.h"
#import "Fire.h"
#import "Theft.h"
#import "Weather.h"




@implementation Accidentdamagecar



@synthesize tablelistcardamage;


/*
- (id)initWithStyle:(UITableViewStyle)style {
// Override initWithStyle: if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
if (self = [super initWithStyle:style]) {
}
return self;
}
*/


- (void)viewDidLoad {

tablelistcardamage = [[NSMutableArray alloc]init];


[tablelistcardamage addObject:@"Glass only damage"];
[tablelistcardamage addObject:@"Accident damage"];
[tablelistcardamage addObject:@"Fire"];
[tablelistcardamage addObject:@"Theft"];
[tablelistcardamage addObject:@"Weather"];

[self setTitle: @"Car Damage"];


[super viewDidLoad];



// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
//self.navigationItem.rightBarButtonItem = self.editButtonItem;
}


#pragma mark Table view methods

- (NSInteger)numberOfSectionsInTableView:(UITableVie w *)tableView {
return 1;
}


// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [tablelistcardamage count];
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

static NSString *CellIdentifier = @"Cell";

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
}

[cell setText:[[tablelistcardamage objectAtIndex:indexPath.row]retain]];

[cell setAccessoryType:UITableViewCellAccessoryDisclosur eIndicator];
// Set up the cell...

return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
// Navigation logic may go here. Create and push another view controller.
// AnotherViewController *anotherViewController = [[AnotherViewController alloc] initWithNibName:@"AnotherView" bundle:nil];
// [self.navigationController pushViewController:anotherViewController];
// [anotherViewController release];

if([[tablelistcardamage objectAtIndex:indexPath.row] isEqual:@"Glass only damage"])
{
Glassdamage *byglassdamage = [[Glassdamage alloc] initWithNibName:@"Glassdamage" bundle:nil];


[byglassdamage setTitle:@"Glass only damage"];
[self.navigationController pushViewController:byglassdamage animated:YES];
}

else if([[tablelistcardamage objectAtIndex:indexPath.row] isEqual:@"Accident damage"])
{
Accidentdamage *byaccidentdamage = [[Accidentdamage alloc] initWithNibName:@"Accidentdamage" bundle:nil];


[byaccidentdamage setTitle:@"Accident damage"];
[self.navigationController pushViewController:byaccidentdamage animated:YES];
}


else if([[tablelistcardamage objectAtIndex:indexPath.row] isEqual:@"Fire"])
{
Fire *firedamage = [[Fire alloc] initWithNibName:@"Fire" bundle:nil];


[firedamage setTitle:@"Fire Damage"];
[self.navigationController pushViewController:firedamage animated:YES];
}

else if([[tablelistcardamage objectAtIndex:indexPath.row] isEqual:@"Theft"])
{
Theft *bytheft = [[Theft alloc] initWithNibName:@"Theft" bundle:nil];


[bytheft setTitle:@"Theft"];
[self.navigationController pushViewController:bytheft animated:YES];
}

else if([[tablelistcardamage objectAtIndex:indexPath.row] isEqual:@"Weather"])
{
Weather *byweather = [[Weather alloc] initWithNibName:@"Weather" bundle:nil];


[byweather setTitle:@"Weather Damage"];
[self.navigationController pushViewController:byweather animated:YES];
}

}
vikinara 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: 258
17 members and 241 guests
14DEV, @sandris, ADY, ArtieFufkin10, bookesp, ckgni, Dani77, DarkAn, HemiMG, iDifferent, jakerocheleau, JasonR, prchn4christ, Rudy, Speed, theone8one
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,885
Threads: 89,230
Posts: 380,767
Top Poster: BrianSlick (7,129)
Welcome to our newest member, bookesp
Powered by vBadvanced CMPS v3.1.0

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