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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T16:54:05+00:00 2026-06-13T16:54:05+00:00

Edit: This question has been moved to Getting an error from Xcode that is

  • 0

Edit: This question has been moved to Getting an error from Xcode that is not on the internet related to index path because this question was fixed but presented with a new error.

I have been at this for 4 days! I am getting no errors in the log, yet whenever I click on my cell that is populated with a dynamic array downloaded from mysql, it does not transition. Interestingly, I got no response from the self placed nslogs in prepareForSegue…

ViewController.h

   #import <UIKit/UIKit.h>
    #import <CoreLocation/CoreLocation.h>


@interface ViewController : UIViewController<UITableViewDataSource,
 CLLocationManagerDelegate,NSXMLParserDelegate, UISearchBarDelegate> {
    IBOutlet UISearchBar *searchBar;
    IBOutlet UITableView *tableView;
     IBOutlet UILabel *Label;


    CLLocationManager *locationManager;

    NSMutableArray *coolarray;

    float latitude;
    float longitude;
}



@property (nonatomic, retain) CLLocationManager *locationManager;


@end

I’ve excluded the xml downloaded data that was parsed, but left the values for the nsarray below in my implementation file

   #import "ViewController.h"
    #import "DetailViewController.h"
    #import "Player.h"

    @interface ViewController ()

    @end

    @implementation ViewController



    - (void)didReceiveMemoryWarning
    {
        [super didReceiveMemoryWarning];
        // Dispose of any resources that can be recreated.
    }
    - (void)dealloc
    {
        [super dealloc];
        [self.locationManager release];
        if ( coolarray )
            [coolarray release];
    }

    - (void)viewDidLoad
    {
        [super viewDidLoad];

        coolarray = NULL;

        self.locationManager = [[[CLLocationManager alloc] init] autorelease];
        self.locationManager.delegate = self;
        [self.locationManager startUpdatingLocation];
    }

    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    {
        return YES;
    }

    // Table data delegate
    - (NSInteger)tableView:(UITableView *)table numberOfRowsInSection:(NSInteger)section {
        if ( coolarray != NULL ) {
            return [coolarray count];
        }
        return 0;
    }

    - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
            Player *cell = [tableView dequeueReusableCellWithIdentifier:@"Player"];

        if (cell == nil)
        {
            cell = [[[Player alloc] initWithFrame:CGRectZero reuseIdentifier:@"Player"] autorelease];
        }


        NSDictionary *itemAtIndex = (NSDictionary *)[coolarray objectAtIndex:indexPath.row];
        UILabel *nameLabel =[cell textLabel];
        [nameLabel setText:[itemAtIndex objectForKey:@"name"]];
        return cell;
    }
                - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
                        Player *cell = [tableView dequeueReusableCellWithIdentifier:@"Player"];

                    if (cell == nil)
                    {
                        cell = [[[Player alloc] initWithFrame:CGRectZero reuseIdentifier:@"Player"] autorelease];
                    }


                    NSDictionary *itemAtIndex = (NSDictionary *)[coolarray objectAtIndex:indexPath.row];
                    UILabel *nameLabel =[cell textLabel];
                    [nameLabel setText:[itemAtIndex objectForKey:@"name"]];
                    return cell;
                }

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

            NSString *selectedLang = [coolarray objectAtIndex:indexPath.row];


            DetailViewController *myDetViewCont = [[DetailViewController alloc] initWithNibName:@"DetailViewController" bundle:[NSBundle mainBundle]]; 

            myDetViewCont.myDogLang = selectedLang; 
            [self  performSegueWithIdentifier:@"showDogDetail" sender:nil];

            [myDetViewCont release]; 
            myDetViewCont = nil;

        }

-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{ 
    if ([[segue identifier] isEqualToString:@"showDogDetail"])
    {
        DetailViewController *detailViewController =
        [segue destinationViewController];

        NSIndexPath *indexPath = [self.tableView
                                    indexPathForSelectedRow];
        NSString *dogLang = [self.coolarray objectAtIndex:indexPath.row];
        detailViewController.myDogLang = dogLang;
                    }

            }
@end

DetailViewController.h

#import <UIKit/UIKit.h>

@interface DetailViewController : UIViewController
 {

    IBOutlet UILabel *myLabel;

    NSString *myDogLang;

}

@property (nonatomic, retain) IBOutlet UILabel *myLabel;
@property (nonatomic, retain) NSString *myDogLang;

@end

DetailViewController.m

#import "DetailViewController.h"

@interface DetailViewController ()

@end

@implementation DetailViewController
@synthesize myLabel;
@synthesize myDogLang;

- (void)viewDidLoad {
    [super viewDidLoad];
    myLabel.text = myDogLang;
        self.myLabel.text = [self.myLabel objectAtIndex:0];
}

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

I’ve also added a picture to show my connection:
enter image description here

  • 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-06-13T16:54:06+00:00Added an answer on June 13, 2026 at 4:54 pm

    It looks like you’re mixing and matching a few different styles here… I suggest simplifying your code:

    1) Delete the current segue between the table and detail view. Create a new one by holding the control key and dragging from the prototype cell (I’m assuming this is a prototype table) to the destination view. Don’t forget to name the identifier the same name you are using in your prepareForSegue code). Also, if you have the table view controller embedded in a Navigation controller (which is what is typically expected on a navigable table view), the style of the segue should be ‘Push.’ Otherwise the style should be ‘Modal’ (though, depending on the usability of your app, you may want to reconsider this approach).

    enter image description here

    2) What’s going on with the Player class? Is this a class that extends UITableViewCell? When you click on the prototype cell in the storyboard, what class is listed in the identity inspector? Is it Player or UITableViewCell? What is the identifier of the cell in the attribute inspector? Is it Player or blank (given your code, it needs to be “Player”)? Try taking the Player class, at least temporarily, out of the picture. Keep the identifier of the cell as Player, but in the identity inspector, set the custom class of the prototype cell to UITableViewCell. Change your tableView:cellForRowAtIndexPath: method to:

    - (UITableViewCell *)tableView:(UITableView *)tv cellForRowAtIndexPath:(NSIndexPath *)indexPath {
        UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Player"];
    
        NSDictionary *itemAtIndex = (NSDictionary *)[self.coolarray objectAtIndex:indexPath.row];
        cell.textLabel.text = [itemAtIndex objectForKey:@"name"];
        return cell;
    }
    

    Also as a side note here, you’re indicating in this method that the members of coolarray are an NSDictionary type. In prepareForSegue you are treating the members of coolarray as NSStrings. They can’t be both.

    3) Get rid of the tableView:didSelectRowAtIndexPath: method. This is important. You have two competing methods of segues happening here. One that is set up in the Storyboard and this method. The way your code is written right now, a click on the cell will call prepareForSegue -> didSelect -> prepareForSegue. Everything that you are attempting to do in here can be done in the prepareForSegue: method (see the next step).

    4) Change your prepareForSegue: method to look something like this (you could even get rid of the “if” statement since you only have one segue right now):

    -(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    { 
        if ([[segue identifier] isEqualToString:@"showDogDetail"])
        {
            DetailViewController *detailViewController =
            [segue destinationViewController];
    
            NSIndexPath *indexPath = [self.tableView
                                        indexPathForSelectedRow];
            NSString *dogLang = [self.coolarray objectAtIndex:indexPath.row];
            // or if the array contains NSDictionaries, change the previous line to:
            // NSString *dogLang = [[self.coolarray objectAtIndex:indexPath.row] objectForKey:@"name"];
            detailViewController.myDogLang = dogLang;
        }
    }
    

    5) Your DetailViewController’s viewDidLoad method is overriding the label text with some bad code (a UILabel is not an array). Change the code to:

    - (void)viewDidLoad {
        [super viewDidLoad];
        self.myLabel.text = self.myDogLang;
    }
    

    Given some of the conceptual issues I’ve mentioned above, I highly recommend reading Apple’s Table View Programming Guide. It’ll help clarify the life cycle and flow for you.

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

Sidebar

Related Questions

Edit : This question has already been asked and answered, and I apparently am
[I'm not sure if this question has been asked, though I've looked around a
I'm sure this question has been asked before, my apologies for not finding it
I realize that this question has been asked and has been answered here but
EDIT: This question has been made redundant by this question as much of the
Edit This was a bug that has been fixed in https://github.com/threerings/playn/commit/137ce50dddd2716f84c38ec1568d7ae5a368434b . See Par
EDIT This question has been closed on SO and reposted on ServerFault https://serverfault.com/questions/333168/how-can-i-make-my-ssis-process-consume-more-resources-and-run-faster I
Edit This question has gone through a few iterations by now, so feel free
Apologies if this question has been answered before. Though the answers I've seen look
This question has been asked before for other languages: Python , PHP and JavaScript

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.