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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T03:30:34+00:00 2026-05-28T03:30:34+00:00

I am creating a split-view iPad application. When the user presses the bar button

  • 0

I am creating a split-view iPad application. When the user presses the bar button item in the master view, a modal is presented. This modal has a textfield and has an IBAction to pick up keyboard returns.

On keyboard returns, a new instance of my Farm class is created (code below). This instance is then added to an array that is stored in my delegate. I then try to reload the MasterViewController‘s table. Upon this reload the application crashes on cell.textLabel.text with a EXC_BAD_ACCESS error.

Farm *current = [delegate.arrayOfFarms objectAtIndex:indexPath.row];
cell.textLabel.text = [current getFarmTitle];

If I ask the array within the delegate how many elements it has, it will indeed show the current amount, even. This is what is bizarre to me about this whole thing: the Farm instances appear to be in existence.

I have instances of AppDelegate in both my MasterViewController and my NewFarmNamingView classes. The instance in the Master is to populate the table. The instance in NewFarm is to add the newly created Farm to the delegate. Code below.

Segments from class NewFarmNamingView:

- (IBAction) keyboardDonePushed:(id)sender
{
    // create a Farm and add it to the delegate
    NSString *text = newFarmTextField.text;
    Farm *newFarm = [[Farm alloc] init];
    [newFarm setFarmTitle:text];
    [[delegate arrayOfFarms] addObject:newFarm];
    [newFarm release];

    NSLog(@"Added farm: %@" , text);

    // dismiss the view
    [self closeView:nil];
}

- (void)viewDidLoad
{
    [super viewDidLoad];

    // initialize the delegate
    delegate = [[UIApplication sharedApplication] delegate];
}

Segments from the class Farm

- (void) setFarmTitle : (NSString *) _farmTitle
{
    farmTitle = _farmTitle;
}

- (NSString *) getFarmTitle
{
    return farmTitle;
}

// NSCoding Methods
- (void) encodeWithCoder:(NSCoder *)aCoder
{
    [aCoder encodeObject:farmTitle forKey:@"kFarmTitle"];
}

- (id) initWithCoder:(NSCoder *)aDecoder
{
    farmTitle = [aDecoder decodeObjectForKey:@"kFarmTitle"];
    return self;
}

// Initialization method
- (id)init
{
    self = [super init];
    if (self) {
        // Initialization code here.
    }

    return self;
}
  • 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-28T03:30:35+00:00Added an answer on May 28, 2026 at 3:30 am

    From the runtime reference: “objc_msgsend sends a message to the receiver and expects a simple return value.”

    I’ll bet you anything that what you’re returning (if you’re returning anything at all) in that class method getTitleFarm is returning an incorrect value. It should be an NSString. Be absolutely sure it is returning an NSString, and not anything else.

    If you need to use the respondsToSelector method to see if the class is being released, try:

    if([current respondsToSelector:@selector(getFarmTitles)])  {.    [current getFarmTitle];
    } 
    else {
    NSLog:(@"FAILURE!!");
    }
    

    EDIT: maybe you are not retaining or even creating this string at all. In it’s initialization, wrap it in a retain]; message

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

Sidebar

Related Questions

How would one go about creating an ipad app that has a similar view
I'm new to using the split view for creating iPad applications. When I first
I'm creating an application that has a Gallery , and this Gallery has a
I just want to change the title in my iPad split view application of
I'm creating a split view controller app, the detail view has a segmented control
When creating a web application, and lets say you have a User object denoting
I'm creating a small timesheet application. Timesheets have athletes, and each athlete has personal
Creating Traversals for Binary Search Tree with Recursion. void inOrder(void (*inOrderPtr)(T&)) { if(this->left !=
Creating a google map with store locations within 50 miles of user entered address.
(creating a separate question after comments on this: Javascript redeclared global variable overrides old

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.