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

  • Home
  • SEARCH
  • 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 8513877
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T04:42:19+00:00 2026-06-11T04:42:19+00:00

I’ve seen other posts regarding unrecognized selector errors, but nothing regarding the auto-generated code

  • 0

I’ve seen other posts regarding unrecognized selector errors, but nothing regarding the auto-generated code in the following method:

- (void)tableView:(UITableView *)tableView commitEditingStyle:forRowAtIndexPath:

This is called when I swipe to delete, and when I tap the delete button I get the following error:

-[Vehicle removeObjectFromGasUpsAtIndex:]: unrecognized selector sent to instance 0x8172c60

My NSManagedObject class, Vehicle, has a NSOrderedSet variable named gasUps that should respond to this message when I want to delete it. Or so I thought.

Here is the entire method where it is crashing:

- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
   if (editingStyle == UITableViewCellEditingStyleDelete) {
    // need to delete gas up and not vehicle
    int row = [indexPath row];

    //[self.selectedVehicle removeObjectFromGasUpsAtIndex:row];
    [self.selectedVehicle removeObjectFromGasUpsAtIndex:row];
    NSError *error = nil;
    if (![self.managedObjectContext save:&error]) {
         // Replace this implementation with code to handle the error appropriately.
         // abort() causes the application to generate a crash log and terminate. You should not use this function in a shipping application, although it may be useful during development. 
        NSLog(@"Unresolved error %@, %@", error, [error userInfo]);
        abort();
    }
 }   
}

Why is this selector unrecognized?

EDIT: this is for Jody.

#import <Foundation/Foundation.h>
#import <CoreData/CoreData.h>

typedef enum {
    FullExtract,
    NameExtract
} kTitleExtract;

@interface Vehicle : NSManagedObject

@property (nonatomic, retain) NSString * name;
@property (nonatomic, retain) NSNumber * year;
@property (nonatomic, retain) NSString * make;
@property (nonatomic, retain) NSNumber * mileage;
@property (nonatomic, retain) NSString * model;
@property (nonatomic, retain) NSOrderedSet *gasUps;

// added methods
- (NSString *)getTitleExtract:(kTitleExtract)titleExtract;

@end

@interface Vehicle (CoreDataGeneratedAccessors)

- (void)insertObject:(NSManagedObject *)value inGasUpsAtIndex:(NSUInteger)idx;
- (void)removeObjectFromGasUpsAtIndex:(NSUInteger)idx;
- (void)insertGasUps:(NSArray *)value atIndexes:(NSIndexSet *)indexes;
- (void)removeGasUpsAtIndexes:(NSIndexSet *)indexes;
- (void)replaceObjectInGasUpsAtIndex:(NSUInteger)idx withObject:(NSManagedObject *)value;
- (void)replaceGasUpsAtIndexes:(NSIndexSet *)indexes withGasUps:(NSArray *)values;
- (void)addGasUpsObject:(NSManagedObject *)value;
- (void)removeGasUpsObject:(NSManagedObject *)value;
- (void)addGasUps:(NSOrderedSet *)values;
- (void)removeGasUps:(NSOrderedSet *)values;

@end

And here is the snippet of code where self.selectedVehicle is set:

if (self.vehiclesArray != nil  && [self.vehiclesArray count] != 0 && self.vehicleIndex != -1) {
    // enable add buttom
    [self.navigationItem.rightBarButtonItem setEnabled:YES];
    self.selectedVehicle = [self.vehiclesArray objectAtIndex:self.vehicleIndex];
    NSLog(@"set selected vehicle");
} else {
    // disable add button
    [self.navigationItem.rightBarButtonItem setEnabled:NO];

    // set vehicle defaults to -1 and make disable add buttom
    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
    [defaults setInteger:-1 forKey:@"vehicleIndex"];
    [defaults synchronize];
    NSLog(@"set index to -1");
}
  • 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-11T04:42:20+00:00Added an answer on June 11, 2026 at 4:42 am

    This is probably related to a known bug in the Core Data auto generated accessors for ordered one-to-many relationships.

    rdar://10114310

    Until this is addressed you need to provide your own implementation for the missing accessors.

    See answers to this question

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

Sidebar

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
This could be a duplicate question, but I have no idea what search terms

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.