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

  • Home
  • SEARCH
  • 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 5990699
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T23:16:52+00:00 2026-05-22T23:16:52+00:00

I want to make Navigation with 3 levels. I make the root controller and

  • 0

I want to make Navigation with 3 levels. I make the root controller and fill the table with data. But when I touch on some cell my application crash. This is part of my code:

NavAppDelegate.h

#import <UIKit/UIKit.h>

@interface NavAppDelegate : NSObject <UIApplicationDelegate> {

}

@property (nonatomic, retain) IBOutlet UIWindow *window;

@property (nonatomic, retain) IBOutlet UINavigationController *navigationController;

@end

NavAppDelegate.m

import “NavAppDelegate.h”

@implementation NavAppDelegate

@synthesize window=_window;

@synthesize navigationController=_navigationController;

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.
    // Add the navigation controller's view to the window and display.
    self.window.rootViewController = self.navigationController;
    [self.window makeKeyAndVisible];
    return YES;
}

 - (void)dealloc
{
    [_window release];
    [_navigationController release];
    [super dealloc];
}

@end 

RootViewController.h

#import <UIKit/UIKit.h>
@class SubCategory;

@interface RootViewController : UITableViewController <UITableViewDelegate,          UITableViewDataSource> {
    SubCategory *subCategories;
}

@property (nonatomic, retain) SubCategory *subCategories;

@end

RootViewController.m

#import "RootViewController.h"
#import "SubCategory.h"
#import "OffersViewController.h"

@implementation RootViewController

@synthesize subCategories;

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
      // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.title  = @"Sub Categories";

    NSString *jsonArray = [NSString stringWithFormat:@"{ "
                       @" \"sub-categories\": { "
                       @" \"parent\": \"1\", "
                       @" \"count\": \"2\", "
                       @" \"sub-category\": [{ "
                       @" \"id\": \"1\", "
                       @" \"name\": \"Buy\" "
                       @" }, "
                       @" { "
                       @" \"id\": \"2\", "
                       @" \"name\": \"Sell\" "
                       @" }] "
                       @" } "
                       @" }"];

    SubCategory* categories = [[SubCategory alloc] init];

    [categories parseJSON:jsonArray];

    subCategories = categories;
}



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

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
{
return [subCategories.subCategoryName count];
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    UITableViewController * offers = [[OffersViewController alloc] initWithNibName:@"OffersView"  bundle:nil];

    //offers.title = [NSString stringWithFormat:@"%@", [subCategories.subCategoryName objectAtIndex:indexPath.row]];

    [self.navigationController pushViewController:offers animated:YES];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cachedCell"];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] init] autorelease];
    }

    cell.textLabel.text = [subCategories.subCategoryName objectAtIndex:indexPath.row];
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

return cell;
}

@end

OffersViewController.h

#import <UIKit/UIKit.h>

@interface OffersViewController : UITableViewController <UITableViewDelegate, UITableViewDataSource>{

}

@end

OffersViewController.m

#import "OffersViewController.h"

@implementation OffersViewController

- (id)initWithStyle:(UITableViewStyle)style
{
    self = [super initWithStyle:style];
    if (self) {
    // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad]; 
}


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

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

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"cachedCell"];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] init] autorelease];
    }

    cell.textLabel.text = @"niki";
    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

    return cell;
}

The exception is:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '-[UIViewController _loadViewFromNibNamed:bundle:] loaded the "OffersView" nib but the view outlet was not set.'
  • 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-22T23:16:53+00:00Added an answer on May 22, 2026 at 11:16 pm

    In your file’s owner of your xib file set the view outlet to the view.

    OffersViewController‘s view is not set in your case.

    Search for view outlet in OffersViewController File owner and set it to the view in Interface builder as shown.

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

Sidebar

Related Questions

I want to make a back button for a navigation controller with the title
I want to make a similar navigation menu like what m.facebook.com did. but this,
i had soulation .i want to make navigation bar with items i will select
I want make interactive application where user launches it and can do various task
Let's say I want make some of my sources publicly available via my blog
I want to make a navigation menu with 4 buttons using a grid layout.
I want to make my navigation bar a one with rounded corners (the top
I want to make an application (in .Net) that fills and submits a form
I'm new in iPhone development and want to ask about the navigation controller. How
I want to make a msdn style breadcrumbs navigation

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.