Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6120997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:44:01+00:00 2026-05-23T15:44:01+00:00

I have an view based app that has a main menu. In the main

  • 0

I have an view based app that has a main menu. In the main menu the user can select an option that presents a table that is populated from an SQLite database (BrowseView). That is all working fine, however from the table I want the user to be able to select a row of data that will present a detailed view and I cannot get the detailed view to work. Nothing happens.

I think the problem is that I havn’t connected the detailed view to the UINavigation controller but I’m unsure on how to do this as I have tried everything that I can think of (which is probably not much as I’m new to programming).

Any help on this would be greatly appreicated. Here is my code.

In the appDelegate.h

@class ClubFindViewController;

@interface ClubFindAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow *window;
ClubFindViewController *viewController;
UINavigationController *navigationController;

NSMutableArray *clubArray;
}

@property (nonatomic, retain) IBOutlet UIWindow *window;
@property (nonatomic, retain) IBOutlet ClubFindViewController *viewController;
@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

@property (nonatomic, retain) NSMutableArray *clubArray;

-(void) copyDatadaseIfNeeded;
-(NSString *) getDBPath;


@end

AppDelegate.m

@implementation ClubFindAppDelegate

@synthesize window;
@synthesize viewController;
@synthesize navigationController;
@synthesize clubArray;



#pragma mark -
#pragma mark Application lifecycle

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

[self copyDatadaseIfNeeded];
NSMutableArray *tempArray = [[NSMutableArray alloc]init];
self.clubArray = tempArray;
[tempArray release];

[Clubs getInitialDataToDisplay:[self getDBPath]];

self.window.rootViewController = self.navigationController;

[self.window addSubview:navigationController.view];
[self.window addSubview:viewController.view];
[self.window makeKeyAndVisible];

return YES;
}

DetailView.h

@class Clubs;


@interface DetailViewController : UITableViewController {
IBOutlet UITableView *tableView;
Clubs *clubObj;
}

@property (nonatomic, retain) Clubs *clubObj;
@property (nonatomic, retain) IBOutlet UITableView *tableView;


@end

DetailView.m

#import "DetailViewController.h"
#import "Clubs.h"
#import "BrowseViewController.h"


@implementation DetailViewController

@synthesize clubObj;
@synthesize tableView;


-(void) viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
self.title = clubObj.clubName;
[self.tableView reloadData];

}



-(NSString *)tableView:(UITableView *)tblView titleForHeaderInSection: (NSInteger)section {
NSString *sectionName = nil;
switch (section) {
    case 0:
        sectionName = [NSString stringWithFormat:@"Club"];
        break;
    case 1:
        sectionName = [NSString stringWithFormat:@"Address"];
        break;
}
return sectionName;

}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
// Return the number of sections.
return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section     {
// Return the number of rows in the section.
return 1;
}


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

static NSString *CellIdentifier = @"Cell";

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

switch (indexPath.section) {
    case 0:
        cell.textLabel.text = clubObj.clubName;
        break;
    case 1:
        cell.textLabel.text = clubObj.ClubAddress;
        break;
}

return cell;


}

Updated code.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T15:44:01+00:00Added an answer on May 23, 2026 at 3:44 pm

    When you create your app and want to use UINavigationController you must in your AppDelegate tell that UINavigationController is your rootViewController.

    self.window.rootViewController = self.navigationController;

    When the Detail view will be pushed it will already (know) that it is inside the UINavigationController and so you don’t need to create additional UINavigationController.

    So delete UINavigationController *navigationController; from both .h and .m file.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a View-based app. The first view that is loaded has a button
I have a simple view-based app from that template. It has nothing else in
I have an view in my App which has a number of buttons based
I have an view-based application where the user can do a lot of customization
I'm working on a view-based iPhone app that has the following flow: search ->
I have a view based app. Its self.view has several subviews and shouldAutorotateToInterfaceOrientation is
I have one table view within the app that I hope multiple parts of
I have an iPhone app that hides the status bar. However, my main view
I have a Document based core data app. The main document window has a
I have a NavigationController based iPhone app that has a navigationBar and a toolbar.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.