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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:42:05+00:00 2026-06-12T15:42:05+00:00

I have a project I am working on and it requires drill down UITableView.

  • 0

I have a project I am working on and it requires drill down UITableView. i have adapted my code to storyboard and it drills down fine from the first UITableView to the second UITableView but when I select the rows in the second UITableView I only get one of the arrays. when selecting any other row it just shows the detail for one of the rows. i know the description is vague so I am including my codes for more clarification. any help is truly appreciated.

TeamTable.m

@implementation TeamTable

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

- (void)dealloc
{
    [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
{
    [super viewDidLoad];

    teamArray = [[NSMutableArray alloc] init];
    [teamArray addObject:@"East Cobb"];
    [teamArray addObject:@"West Cobb"];
    [teamArray addObject:@"Buckhead Thunder"];
    [teamArray addObject:@"Fulton East"];
    [teamArray addObject:@"Atlanta Braves"];
}

- (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 the number of sections.
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [teamArray 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];
    }

    // Configure the cell...
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:cell.frame];
    UIImage *image = [UIImage imageNamed:@"bgp.png"];
    imageView.image = image;
    cell.backgroundView = imageView;
    [[cell textLabel] setBackgroundColor:[UIColor clearColor]];
    [[cell detailTextLabel] setBackgroundColor:[UIColor clearColor]];
    cell.textLabel.text = [[teamArray objectAtIndex:indexPath.row] autorelease];


    return cell;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([[segue identifier] isEqualToString:@"Table"]){
        TeamTable1 *teams = [segue destinationViewController];
        NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
        if ([[teamArray objectAtIndex:indexPath.row] isEqual:@"East Cobb"]) {
            teams.teamsInt = 0;
            [teams setTitle:[teamArray objectAtIndex:indexPath.row]];
        }
        if ([[teamArray objectAtIndex:indexPath.row] isEqual:@"West Cobb"]) {
            teams.teamsInt = 1;
            [teams setTitle:[teamArray objectAtIndex:indexPath.row]];
        }
        if ([[teamArray objectAtIndex:indexPath.row] isEqual:@"Buckhead Thunder"]) {
            teams.teamsInt = 2;
            [teams setTitle:[teamArray objectAtIndex:indexPath.row]];
        }
        if ([[teamArray objectAtIndex:indexPath.row] isEqual:@"Fulton East"]) {
            teams.teamsInt = 3;
            [teams setTitle:[teamArray objectAtIndex:indexPath.row]];
        }
        if ([[teamArray objectAtIndex:indexPath.row] isEqual:@"Atlanta Braves"]) {
            teams.teamsInt = 4;
            [teams setTitle:[teamArray objectAtIndex:indexPath.row]];
        }
    }
}
@end
second table .h file

@interface TeamTable1 : UITableViewController{

    NSMutableArray *eastCobbArray;
    NSMutableArray *westCobbArray;
    NSMutableArray *buckheadThunderArray;
    NSMutableArray *fultonEastArray;
    NSMutableArray *atlantaBravesArray;

    NSMutableArray *sectionArray;
    NSMutableArray *data;

    int teamsInt;

}

@property int teamsInt;

- (void) makeData;

@end

second table .m file

@implementation TeamTable1
@synthesize teamsInt;

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

- (void)dealloc
{
    [sectionArray release];
    [data release];
    [eastCobbArray release];
    [westCobbArray release];
    [buckheadThunderArray release];
    [fultonEastArray release];
    [atlantaBravesArray 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 makeData];
    [super viewDidLoad];
}

- (void) makeData
{
    data = [[NSMutableArray alloc] init];
    sectionArray = [[NSMutableArray alloc] init];

    eastCobbArray = [[NSMutableArray alloc] init];
    westCobbArray = [[NSMutableArray alloc] init];
    buckheadThunderArray = [[NSMutableArray alloc] init];
    fultonEastArray = [[NSMutableArray alloc] init];
    atlantaBravesArray = [[NSMutableArray alloc] init];

    if (teamsInt == 0) {
        [sectionArray addObject:@"East Cobb"];
    }
    if (teamsInt == 1) {
        [sectionArray addObject:@"West Cobb"];
    }
    if (teamsInt == 2) {
        [sectionArray addObject:@"Buckhead Thunder"];
    }
    if (teamsInt == 3) {
        [sectionArray addObject:@"Fulton East"];
    }
    if (teamsInt == 4) {
        [sectionArray addObject:@"Atlanta Braves"];
    }

    [eastCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Coaches", @"name" , @"image1.JPG", @"image" , @"Mark Bayle 3rd Base\nSusane Ballor First Base\nJim Thally Pitching\nSam Bradley Batting", @"description", nil]];
    [eastCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Team Outlook", @"name" , @"image2.jpg", @"image" , @"our team has won 26 out of the 35 and it is in first place. We have 2 players on DL and have recalled two players to replace them.", @"description", nil]];
    [eastCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Schedule", @"name" , @"image3.jpg", @"image" , @"Sun June 30 VS Thunders @ Home\nMon June 31 VS Braves @ away\nTue July 1 VS East Cobb @ Home", @"description", nil]];
    [eastCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Upcomming Events", @"name" , @"image4.jpg", @"image" , @"This is the list of the upcomming events for the month of july:\nJuly 1st:\nBake them all.\nJuly 2nd:\nFamily reunion\nJuly 3rd:\nSuppliers convention.", @"description", nil]];
    [eastCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Roster", @"name" , @"image5.jpg", @"image" , @"Jim this 17\nTim duncan 22\nJim thalos 21\nFredrick nitche 24\n", @"description", nil]];

    [westCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Coaches", @"name" , @"image1.JPG", @"image" , @"Mark Bayle 3rd Base\nSusane Ballor First Base\nJim Thally Pitching\nSam Bradley Batting", @"description", nil]];
    [westCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Team Outlook", @"name" , @"image2.jpg", @"image" , @"our team has won 26 out of the 35 and it is in first place. We have 2 players on DL and have recalled two players to replace them.", @"description", nil]];
    [westCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Schedule", @"name" , @"image3.jpg", @"image" , @"Sun June 30 VS Thunders @ Home\n Mon June 31 VS Braves @ away \n Tue July 1 VS East Cobb @ Home \n", @"description", nil]];
    [westCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Upcomming Events", @"name" , @"image4.jpg", @"image" , @"This is the list of the upcomming events for the month of july:\nJuly 1st:\nBake them all.\nJuly 2nd:\nFamily reunion\nJuly 3rd:\nSuppliers convention.", @"description", nil]];
    [westCobbArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Roster", @"name" , @"image5.jpg", @"image" , @"Jim this 17\nTim duncan 22\nJim thalos 21\nFredrick nitche 24\n", @"description", nil]];

    [buckheadThunderArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Coaches", @"name" , @"image1.JPG", @"image" , @"Mark Bayle 3rd Base\nSusane Ballor First Base\nJim Thally Pitching\nSam Bradley Batting", @"description", nil]];
    [buckheadThunderArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Team Outlook", @"name" , @"image2.jpg", @"image" , @"our team has won 26 out of the 35 and it is in first place. We have 2 players on DL and have recalled two players to replace them.", @"description", nil]];
    [buckheadThunderArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Schedule", @"name" , @"image3.jpg", @"image" , @"Sun June 30 VS Thunders @ Home \n MOn June 31 VS Braves @ away \n Tue July 1 VS East Cobb @ Home \n", @"description", nil]];
    [buckheadThunderArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Upcomming Events", @"name" , @"image4.jpg", @"image" , @"This is the list of the upcomming events for the month of july:\nJuly 1st:\nBake them all.\nJuly 2nd:\nFamily reunion\nJuly 3rd:\nSuppliers convention.", @"description", nil]];
    [buckheadThunderArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Roster", @"name" , @"image5.jpg", @"image" , @"Jim this 17\nTim duncan 22\nJim thalos 21\nFredrick nitche 24\n", @"description", nil]];

    [fultonEastArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Coaches", @"name" , @"image1.JPG", @"image" , @"Mark Bayle 3rd Base\nSusane Ballor First Base\nJim Thally Pitching\nSam Bradley Batting", @"description", nil]];
    [fultonEastArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Team Outlook", @"name" , @"image2.jpg", @"image" , @"our team has won 26 out of the 35 and it is in first place. We have 2 players on DL and have recalled two players to replace them.", @"description", nil]];
    [fultonEastArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Schedule", @"name" , @"image3.jpg", @"image" , @"Sun June 30 VS Thunders @ Home \n MOn June 31 VS Braves @ away \n Tue July 1 VS East Cobb @ Home \n", @"description", nil]];
    [fultonEastArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Upcomming Events", @"name" , @"image4.jpg", @"image" , @"This is the list of the upcomming events for the month of july:\nJuly 1st:\nBake them all.\nJuly 2nd:\nFamily reunion\nJuly 3rd:\nSuppliers convention.", @"description", nil]];
    [fultonEastArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Roster", @"name" , @"image5.jpg", @"image" , @"Jim this 17\nTim duncan 22\nJim thalos 21\nFredrick nitche 24\n", @"description", nil]];


    [atlantaBravesArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Coaches", @"name" , @"image1.JPG", @"image" , @"Mark Bayle 3rd Base\nSusane Ballor First Base\nJim Thally Pitching\nSam Bradley Batting", @"description", nil]];
    [atlantaBravesArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Team Outlook", @"name" , @"image2.jpg", @"image" , @"our team has won 26 out of the 35 and it is in first place. We have 2 players on DL and have recalled two players to replace them.", @"description", nil]];
    [atlantaBravesArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Schedule", @"name" , @"image3.jpg", @"image" , @"Sun June 30 VS Thunders @ Home\nMon June 31 VS Braves @ away\nTue July 1 VS East Cobb @ Home\n", @"description", nil]];
    [atlantaBravesArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Upcomming Events", @"name" , @"image4.jpg", @"image" , @"This is the list of the upcomming events for the month of july:\nJuly 1st:\nBake them all.\nJuly 2nd:\nFamily reunion\nJuly 3rd:\nSuppliers convention.", @"description", nil]];
    [atlantaBravesArray addObject:[[NSMutableDictionary alloc] initWithObjectsAndKeys:@"Roster", @"name" , @"image5.jpg", @"image" , @"Jim this 17\nTim duncan 22\nJim thalos 21\nFredrick nitche 24\n", @"description", nil]];

    if (teamsInt == 0) {
        [data addObject:eastCobbArray];
    }
    if (teamsInt == 1) {
        [data addObject:westCobbArray];
    }
    if (teamsInt == 2) {
        [data addObject:buckheadThunderArray];
    }
    if (teamsInt == 3) {
        [data addObject:fultonEastArray];
    }
    if (teamsInt == 4) {
        [data addObject:atlantaBravesArray];
    }
}

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

- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
    return [sectionArray objectAtIndex:section];
}

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

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [[data objectAtIndex:section] count];
    [self.tableView reloadData];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell1";

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

    // Configure the cell...
    UIImageView *imageView = [[UIImageView alloc] initWithFrame:cell.frame];
    UIImage *image = [UIImage imageNamed:@"bgp.png"];
    imageView.image = image;
    cell.backgroundView = imageView;
    [[cell textLabel] setBackgroundColor:[UIColor clearColor]];
    [[cell detailTextLabel] setBackgroundColor:[UIColor clearColor]];
    cell.textLabel.text = [[[data objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] objectForKey:@"name"];

    return cell;
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if([[segue identifier] isEqualToString:@"Detail"]){
        TeamDetail *teamDetail = [segue destinationViewController];
        NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
        if (teamsInt == 0)
        {
            teamDetail.teamImageString = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.row] objectForKey:@"image"]];
            teamDetail.teamTextString = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.row] objectForKey:@"description"]];
            teamDetail.title = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.row] objectForKey:@"name"]];
        }
        if (teamsInt == 1)
        {
            teamDetail.teamImageString = [[NSString alloc] initWithString:[[westCobbArray objectAtIndex:indexPath.row] objectForKey:@"image"]];
            teamDetail.teamTextString = [[NSString alloc] initWithString:[[westCobbArray objectAtIndex:indexPath.row] objectForKey:@"description"]];
            teamDetail.title = [[NSString alloc] initWithString:[[westCobbArray objectAtIndex:indexPath.row] objectForKey:@"name"]];
        }
        if (teamsInt == 2)
        {
            teamDetail.teamImageString = [[NSString alloc] initWithString:[[buckheadThunderArray objectAtIndex:indexPath.row] objectForKey:@"image"]];
            teamDetail.teamTextString = [[NSString alloc] initWithString:[[buckheadThunderArray objectAtIndex:indexPath.row] objectForKey:@"description"]];
            teamDetail.title = [[NSString alloc] initWithString:[[buckheadThunderArray objectAtIndex:indexPath.row] objectForKey:@"name"]];
        }
        if (teamsInt == 3)
        {
            teamDetail.teamImageString = [[NSString alloc] initWithString:[[fultonEastArray objectAtIndex:indexPath.row] objectForKey:@"image"]];
            teamDetail.teamTextString = [[NSString alloc] initWithString:[[fultonEastArray objectAtIndex:indexPath.row] objectForKey:@"description"]];
            teamDetail.title = [[NSString alloc] initWithString:[[fultonEastArray objectAtIndex:indexPath.row] objectForKey:@"name"]];
        }
        if (teamsInt == 4)
        {
            teamDetail.teamImageString = [[NSString alloc] initWithString:[[atlantaBravesArray objectAtIndex:indexPath.row] objectForKey:@"image"]];
            teamDetail.teamTextString = [[NSString alloc] initWithString:[[atlantaBravesArray objectAtIndex:indexPath.row] objectForKey:@"description"]];
            teamDetail.title = [[NSString alloc] initWithString:[[atlantaBravesArray objectAtIndex:indexPath.row] objectForKey:@"name"]];
        }
    }
}

@end

TeamDetail.h

@interface TeamDetail : UIViewController{

    IBOutlet UIImageView *teamImage;
    IBOutlet UITextView *teamText;
    NSString *teamImageString;
    NSString *teamTextString;
}

@property (nonatomic, retain) NSString *teamImageString;
@property (nonatomic, retain) NSString *teamTextString;

@end

TeamDetail.m

@implementation TeamDetail
@synthesize teamImageString, teamTextString;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@"bcp.png"]];
    teamImage.image = [UIImage imageNamed:teamImageString];
    teamText.text = teamTextString;

    // Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
    [super viewDidUnload];
    // Release any retained subviews of the main view.
}

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

@end

now the connections and segue identifiers are fine and working it drills down all the way to detailview but only shows the first array information and sections and the rest of the arrays are not showing.

thanks in advance for your help

adrian

  • 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-12T15:42:06+00:00Added an answer on June 12, 2026 at 3:42 pm

    Anyway it seems that I find your mistake )
    You obtain item like this, right:

    if (teamsInt == 0)
            {
                teamDetail.teamImageString = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.row] objectForKey:@"image"]];
                teamDetail.teamTextString = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.row] objectForKey:@"description"]];
                teamDetail.title = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.row] objectForKey:@"name"]];
            }
    

    But look carefully – you use indexPath.row but should use indexPath.section instead! Your row is always 0.
    Try this (ready for copy-paste ;)):

    - (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
    {
        if([[segue identifier] isEqualToString:@"Detail"]){
            TeamDetail *teamDetail = [segue destinationViewController];
            NSIndexPath *indexPath = [self.tableView indexPathForCell:sender];
            if (teamsInt == 0)
            {
                teamDetail.teamImageString = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.section] objectForKey:@"image"]];
                teamDetail.teamTextString = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.section] objectForKey:@"description"]];
                teamDetail.title = [[NSString alloc] initWithString:[[eastCobbArray objectAtIndex:indexPath.section] objectForKey:@"name"]];
            }
            if (teamsInt == 1)
            {
                teamDetail.teamImageString = [[NSString alloc] initWithString:[[westCobbArray objectAtIndex:indexPath.section] objectForKey:@"image"]];
                teamDetail.teamTextString = [[NSString alloc] initWithString:[[westCobbArray objectAtIndex:indexPath.section] objectForKey:@"description"]];
                teamDetail.title = [[NSString alloc] initWithString:[[westCobbArray objectAtIndex:indexPath.section] objectForKey:@"name"]];
            }
            if (teamsInt == 2)
            {
                teamDetail.teamImageString = [[NSString alloc] initWithString:[[buckheadThunderArray objectAtIndex:indexPath.section] objectForKey:@"image"]];
                teamDetail.teamTextString = [[NSString alloc] initWithString:[[buckheadThunderArray objectAtIndex:indexPath.section] objectForKey:@"description"]];
                teamDetail.title = [[NSString alloc] initWithString:[[buckheadThunderArray objectAtIndex:indexPath.section] objectForKey:@"name"]];
            }
            if (teamsInt == 3)
            {
                teamDetail.teamImageString = [[NSString alloc] initWithString:[[fultonEastArray objectAtIndex:indexPath.section] objectForKey:@"image"]];
                teamDetail.teamTextString = [[NSString alloc] initWithString:[[fultonEastArray objectAtIndex:indexPath.section] objectForKey:@"description"]];
                teamDetail.title = [[NSString alloc] initWithString:[[fultonEastArray objectAtIndex:indexPath.section] objectForKey:@"name"]];
            }
            if (teamsInt == 4)
            {
                teamDetail.teamImageString = [[NSString alloc] initWithString:[[atlantaBravesArray objectAtIndex:indexPath.section] objectForKey:@"image"]];
                teamDetail.teamTextString = [[NSString alloc] initWithString:[[atlantaBravesArray objectAtIndex:indexPath.section] objectForKey:@"description"]];
                teamDetail.title = [[NSString alloc] initWithString:[[atlantaBravesArray objectAtIndex:indexPath.section] objectForKey:@"name"]];
            }
        }
    }
    

    p.s Consider about refactoring your code.
    Do not add objects to array, create it in one string like:

    teamArray = [[NSMutableArray alloc] initWithObjects:@"East Cobb", @"West Cobb", @"Buckhead Thunder", @"Fulton East", @"Atlanta Braves", nil];
    

    or:

    teamArray = @[@"East Cobb", @"West Cobb", @"Buckhead Thunder", @"Fulton East", @"Atlanta Braves"];
    

    Use switch instaed of if() with numerical values

    >     teams.teamsInt = indexPath.row;
    >     switch (indexPath.row) {
    >         case:0
    >         teams.title = [teamArray objectAtIndex:indexPath.row];
    >         break;
    >         //and so on
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have started working on a project which requires Natural Language Processing. We have
I have a project working fine under MSVS 2010 SP1. I'm trying to convert
I have a project I'm working on in Qt creator that requires a third-party
I have a project i've been working on that requires me to retrieve the
I have a personal project I'm working on that requires Microsoft SAPI5 -- text
I have been working on a project that requires downloading a zipped file off
I'm working on a project that requires a few h1 tags to have text-shadow
I'm working on a project which requires delegation in a double-hop scenario. We have
I have a project that I'm working on that requires changing a 'BaseSortedCollection' class
I have a project that I am working on that requires the use of

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.