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 6742199
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:48:54+00:00 2026-05-26T11:48:54+00:00

I had my app navigating views perfectly. Now, for some reason that I can’t

  • 0

I had my app navigating views perfectly. Now, for some reason that I can’t figure out, my detailView is not presenting on the pushViewController:detail method in my modal view.

I cannot figure out why it’s not working any more. Any help would be appreciated. Thanks.

Here’s the method:

   - (void)tableView:(UITableView *)tView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {


             [tView deselectRowAtIndexPath:indexPath animated:YES];

            if(indexPath.row == 0){
                NSLog(@"hey");
                DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
                detail.delegate = self;
                [[self navigationController] pushViewController:detail animated:YES];
            }

            if(indexPath.row == 1){
                NSLog(@"hey");
                DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
                detail.delegate = self;
                [[self navigationController] pushViewController:detail animated:YES];
            }

            if(indexPath.row == 2){
                NSLog(@"hey");
                DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
                detail.delegate = self;
                [[self navigationController] pushViewController:detail animated:YES];
            }

            if(indexPath.row == 3){
                NSLog(@"hey");
                DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
                detail.delegate = self;
                [[self navigationController] pushViewController:detail animated:YES];
            }

            if(indexPath.row == 4){
                NSLog(@"hey");
                DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
                detail.delegate = self;
                [[self navigationController] pushViewController:detail animated:YES];
            }



        }

Here’s the class code. I’m not sure if I need to pass in a navigationController with modalView:

//
//  ModalView.m
//  DiningLog
//
//  Created by Eric Rea on 10/10/11.
//  Copyright 2011 Avid. All rights reserved.
//

#import "ModalView.h"
#import "DetailView.h"

@implementation ModalView

@synthesize tableView, excersizeName, numSets, time, restTime, dateFormatter, rating, excersizeArray, plistArray, numberWithBool;


-(IBAction) cancel:(id)sender{
    [self dismissModalViewControllerAnimated:YES];
}


-(IBAction) save:(id)sender{

    // get paths from root direcory
    NSArray *paths = NSSearchPathForDirectoriesInDomains (NSDocumentDirectory, NSUserDomainMask, YES);
    // get documents path
    NSString *documentsPath = [paths objectAtIndex:0];
    // get the path to our Data/plist file
    NSString *plistPath = [documentsPath stringByAppendingPathComponent:@"ExcersizeList.plist"];

    // check to see if Data.plist exists in documents
    if (![[NSFileManager defaultManager] fileExistsAtPath:plistPath])
    {
        // if not in documents, get property list from main bundle
        plistPath = [[NSBundle mainBundle] pathForResource:@"Excersizes" ofType:@"plist"];
    }

    // read property list into memory as an NSData object
    NSData *plistXML = [[NSFileManager defaultManager] contentsAtPath:plistPath];
    NSString *errorDesc = nil;
    NSPropertyListFormat format;
    // convert static property list into dictionary object
    NSDictionary *temp = (NSDictionary *)[NSPropertyListSerialization propertyListFromData:plistXML mutabilityOption:NSPropertyListMutableContainersAndLeaves format:&format errorDescription:&errorDesc];
    if (!temp)
    {
        NSLog(@"Error reading plist: %@, format: %d", errorDesc, format);
    }
    // assign values
    self.plistArray = [NSMutableArray arrayWithArray:[temp objectForKey:@"Excersizes"]];
    NSLog(@"The contents of plistArray is%@", plistArray);

    // set the variables to the values in the text fields
    self.excersizeArray = [[NSMutableArray alloc] initWithCapacity:4];
    [excersizeArray addObject:excersizeName];
    [excersizeArray addObject:numSets];
    [excersizeArray addObject:time];
    [excersizeArray addObject:restTime];
    [plistArray addObject:excersizeArray];

    // create dictionary with values in UITextFields
    NSDictionary *plistDict = [NSDictionary dictionaryWithObjects: [NSArray arrayWithObjects: plistArray, nil] forKeys:[NSArray arrayWithObjects: @"Excersizes", nil]];

    NSString *error = nil;
    // create NSData from dictionary
    // NSData *plistData = [NSPropertyListSerialization dataFromPropertyList:plistDict format:NSPropertyListXMLFormat_v1_0 errorDescription:&error];

    // check is plistData exists
    if(plistDict)
    {
        // write plistData to our Data.plist file
        [plistDict writeToFile:plistPath atomically:YES];
    }
    else
    {
        NSLog(@"Error in saveData: %@", error);
        [error release];
    }

     [self dismissModalViewControllerAnimated:YES];
}




- (NSInteger)numberOfSectionsInTableView:(UITableView *)tView {

    // Return the number of sections.

    return 1;

}


-(void)setObject:(id)object forNum:(int)num{

    if(num == 0){
        self.excersizeName = object;
        NSLog(@"res %@", self.excersizeName);
    }else if(num == 1){
        self.numSets = object;
        NSLog(@"res %@", self.numSets);
    }else if(num == 2){
        self.time = object;
        NSLog(@"res %@", self.time);
    }else if(num == 3){
        self.restTime = object;
        NSLog(@"res %@", self.restTime);
    }else if(num == 4){
        self.rating = [object floatValue];

    }

    [tableView reloadData];

}


- (NSInteger)tableView:(UITableView *)tView numberOfRowsInSection:(NSInteger)section {

    // Return the number of rows in the section.

    return 5;

}





// Customize the appearance of table view cells.

- (UITableViewCell *)tableView:(UITableView *)tView cellForRowAtIndexPath:(NSIndexPath *)indexPath {


    static NSString *CellIdentifier = @"Cell";

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

    if(indexPath.row == 0){
        cell.textLabel.text = @"Excersize";
        cell.detailTextLabel.text = excersizeName;
    }
    if(indexPath.row == 1){
        cell.textLabel.text = @"Sets";  
        cell.detailTextLabel.text = numSets;
        }
    if(indexPath.row == 2){
        cell.textLabel.text = @"Time";
        cell.detailTextLabel.text = time;
    }
    if(indexPath.row == 3){
        cell.textLabel.text = @"Rest";
        cell.detailTextLabel.text = restTime;
        }

    if(indexPath.row == 4){
        cell.textLabel.text = @"Rating";
        cell.detailTextLabel.text = [NSString stringWithFormat:@"%f",rating];
        }

        cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;

        return cell;

}

- (NSDateFormatter *)dateFormatter {    
    if (dateFormatter == nil) {
        dateFormatter = [[NSDateFormatter alloc] init];
        [dateFormatter setDateStyle:NSDateFormatterMediumStyle];
        [dateFormatter setTimeStyle:NSDateFormatterNoStyle];
    }
    return dateFormatter;
}

#pragma mark -

#pragma mark Table view delegate



    - (void)tableView:(UITableView *)tView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {


         [tView deselectRowAtIndexPath:indexPath animated:YES];

        if(indexPath.row == 0){
            NSLog(@"hey");
            DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
            detail.delegate = self;
            [[self navigationController] pushViewController:detail animated:YES];
        }

        if(indexPath.row == 1){
            NSLog(@"hey");
            DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
            detail.delegate = self;
            [[self navigationController] pushViewController:detail animated:YES];
        }

        if(indexPath.row == 2){
            NSLog(@"hey");
            DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
            detail.delegate = self;
            [[self navigationController] pushViewController:detail animated:YES];
        }

        if(indexPath.row == 3){
            NSLog(@"hey");
            DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
            detail.delegate = self;
            [[self navigationController] pushViewController:detail animated:YES];
        }

        if(indexPath.row == 4){
            NSLog(@"hey");
            DetailView * detail = [[DetailView alloc] initWithNumber:indexPath.row];
            detail.delegate = self;
            [[self navigationController] pushViewController:detail animated:YES];
        }



    }

// The designated initializer.  Override if you create the controller programmatically and want to perform customization that is not appropriate for viewDidLoad.
/*
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil {
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization.
    }
    return self;
}
*/

/*
// Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
- (void)viewDidLoad {
    [super viewDidLoad];
    }
*/

/*
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    // Return YES for supported orientations.
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
*/

- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc. that aren't in use.
}

- (void)viewDidUnload {
    [super viewDidUnload];
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


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


@end
  • 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-26T11:48:55+00:00Added an answer on May 26, 2026 at 11:48 am

    Have you debugged and checked that your navigationController isn’t nil ?

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

Sidebar

Related Questions

I had app lets say movies, with some models and initial south migration. Now
So... this is beyond strange. I had an app that was running perfectly fine
I recently had my app certified (first time!) but not automatically published. The game
I just had my app crash and now after alot of work its back
I've had a Windows app in production for a while now, and have it
I've had a ClickOnce app in use for a few months now, but recently
I inherited an Intraweb app that had a 2MB text file of memory leaks
We had a freelance developer that went rogue and now I'm left with a
I had an app called GrabUrTime, it's a timetable viewing utility that get its
I have had an app rejected by Apple stating that I need to implement

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.