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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T18:14:47+00:00 2026-05-20T18:14:47+00:00

I have successfully loaded the muscleName items into a table view but am not

  • 0

I have successfully loaded the muscleName items into a table view but am not having any luck loading their respective exerciseName into the 2nd table view.

The method I am using is:

    cell.textLabel.text = [[self.exerciseArray objectAtIndex:indexPath.row] objectForKey: @"exerciseName"];

Maybe I need to define constants?

enter image description here

Edit:

Here is the code in ViewDidLoad for the first table that loads muscleName:

if (muscleArray == nil)
{
    //Read the plist file into an array (the root element is an array)
    NSString *path = [[NSBundle mainBundle]pathForResource:@"test" ofType:@"plist"];
    NSMutableArray *rootLevel = [[NSMutableArray alloc]initWithContentsOfFile:path];
    self.muscleArray = rootLevel;
    [rootLevel release];

Here is my current sub table class

 import "SpecificExerciseTableViewController.h"
    #import "MusclesTableViewController.h"
    #import "CurlAppDelegate.h"
    #import "DetailViewController.h"

    @implementation SpecificExerciseTableViewController
    @synthesize exerciseArray;

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

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

    - (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.
    }

    #pragma mark - View lifecycle
    - (void)viewDidLoad
    {
        self.navigationItem.title = @"Exercises";

        [super viewDidLoad];

        if (exerciseArray == nil)
        {
            //Read the plist file into an array (the root element is an array)
            NSString *path = [[NSBundle mainBundle]pathForResource:@"test" ofType:@"plist"];
            NSMutableArray *rootLevel = [[NSMutableArray alloc]initWithContentsOfFile:path];
            self.exerciseArray = rootLevel;
            [rootLevel release];
        }

        // Uncomment the following line to preserve selection between presentations.
        // self.clearsSelectionOnViewWillAppear = NO;

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

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

    - (void)viewWillAppear:(BOOL)animated
    {
        [super viewWillAppear:animated];
    }

    - (void)viewDidAppear:(BOOL)animated
    {
        [super viewDidAppear:animated];
    }

    - (void)viewWillDisappear:(BOOL)animated
    {
        [super viewWillDisappear:animated];
    }

    - (void)viewDidDisappear:(BOOL)animated
    {
        [super viewDidDisappear:animated];
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    }

    #pragma mark - Table view data source

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

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

    - (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];
        }

        NSUInteger row = [indexPath row];
        cell.textLabel.text = [[self.exerciseArray objectAtIndex:indexPath.row]objectForKey:@"exerciseName"];

        return cell;

    }

    - (UITableViewCellAccessoryType)tableView:(UITableView *)tv accessoryTypeForRowWithIndexPath:(NSIndexPath *)indexPath
    {
        return UITableViewCellAccessoryDisclosureIndicator;
    }

    #pragma mark - Table view delegate

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        // Navigation logic may go here. Create and push another view controller.

         DetailViewController *detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:nil];
         // ...
         // Pass the selected object to the new view controller.
         [self.navigationController pushViewController:detailViewController animated:YES];
         [detailViewController release];

    }

    @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-20T18:14:47+00:00Added an answer on May 20, 2026 at 6:14 pm

    Without seeing more of your code, it looks like you’re accessing the exerciseName property okay if you are starting at exercises.
    Are you sure that self.exerciseArray is pointing to your exercises object? The quickest way to check is just drop in an NSLog() statement and see if you have what you think you have:

    NSLog(@"Exercises: %@", self.exerciseArray);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created thumbnail view using Three20 bundle. I have successfully loaded and displayed
I am new to R language. I have successfully loaded a query's resultset into
I have successfully loaded a view from an xib file on to a window(another
I have successfully put highlighting in my table but the problem is with alternating
Suppose I have 5 GLSL shaders that I successfully loaded in my opengl program.
I'm new to Prism, but I have successfully built several WPF/Mvvm-Light applications. I'm using
I successfully got my plist arrays and dictionaries loaded into my tables. I am
Having successfully loaded CFFI on Clozure Common Lisp 1.6 with (ql:quickload cffi) , I
I have a .plist file that is loaded into my Xcode project. I have
I'm working on a Rails app and have successfully loaded postgresql9.1 on my macX.

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.