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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:19:48+00:00 2026-06-17T15:19:48+00:00

I’m missing something simple I think, but been at it for days now without

  • 0

I’m missing something simple I think, but been at it for days now without solving this. Even Started to create a “work-around” just to solve it for now, but still want to solve this the “right” way. Any suggestions? Thank’s!

.

The problem:

Seems to be missing the class Adealer (get error “-[Adealer objectAtIndex:]: unrecognized selector sent to instance 0x8c5f8b0”), but I did the import Adealer.h to this “detailsVC”. But it’s not just a simple error of naming the property wrong (objectForKey:@"CustName" instead of “custname” etc – tested this a lot).

Also, I’ve got similar “listVC”s without a class like Adealer in them, that also transfer data the same way to the same “detailsVC” and they work just fine! Then I just get the data with calls like;

self.labelRestName.text = [restDetails objectForKey:@"CustName"];

Overview:

I got a tableViewController “listVC” that creates the data and show a list, then a ViewController “detailsVC” to show the details. The data (selected row object in “listVC” is transfered via a seque and “destVC.restGPSTransfer” (NSDictionary). The data arrives ok in the “detailsVC” and looks like this in the terminal;

dealerName = Uppsala Centrum Test
dealerAdressStreet = Dragarbrunnsgatan 55
dealerAdressZip = 75320
dealerAdressCity = Uppsala
dealerLongitude = 17.63893
dealerLatitude = 59.85856
dealerDistance2 = 8586398.000000
etc

.

Following the data:

“listVC”

1) First fetching data from web via a AFNetworking json object into an NSMutableArray “restFeed” – ok.

2) Then creating my own data to an NSMutableArray within this loop into a NSMutableArray “updatedDealers” – ok;

    NSMutableArray *updatedDealers = [[NSMutableArray alloc]init];
        while (i+1 < [_restFeed count]) {
          i++;

    // Get dealer position function here        
    // Get distance function here

    // Then create my own data here (also #imported Adealer to "listVC";
            Adealer *theDealer = [[Adealer alloc]init];

    theDealer.dealerName = [[_restFeed objectAtIndex:i]objectForKey:@"CustName"];
    theDealer.dealerLongitude = [[_restFeed objectAtIndex:i]objectForKey:@"long"];
    theDealer.dealerLatitude = [[_restFeed objectAtIndex:i]objectForKey:@"lat"];
    theDealer.dealerDistance2 = theDistance;
    // etc...

    // Check if data ok
    NSLog(@"theDealer = %@",[theDealer description]);

    // Don't add dealer object without positiondata to the new array
    if (![theDealer.dealerLatitude isEqualToString:@""]) {          
        [updatedDealers addObject:theDealer];
    }

3) Then I use NSSortdescriptor to sort the dealers in NSMutableArray “updatedDealers” into distance order and finally creates the new NSMutableArray “restFeed” with this; (also did “@synthesize dealerFeed = _dealerFeed;” in “listVC”) – ok.

    _dealerFeed = [NSMutableArray arrayWithArray:sortedContestArray];

4) The populating some tableViewCells with this array and it works just fine – ok.;

    cell.cellDealerName.text = [NSString stringWithFormat:@"%@",[[_dealerFeed objectAtIndex:indexPath.row]dealerName]];

5) In the function didSelectRowAtIndexPath transfer the selected object with the “detailsVC”‘s NSDictionary “restGPSTransfer” – ok;

    destVC.restGPSTransfer = [_dealerFeed objectAtIndex:myIndexPath.row];

“detailsVC”:

6) The data seems to transfer ok (se top of this post) but when trying to call the data with;

    self.labelRestName.text = [restGPSTransfer objectForKey:@"dealerName"];

I get this error and the app crashes: “-[Adealer objectAtIndex:]: unrecognized selector sent to instance 0x8c5f8b0”.

Some more testing done…

Tried to verify the structure + it’s keys and properties of the NSDictionary “restGPSTransfer”, but using description only got me so far. And have not solved my problem and I still get the “unrecognized selector” error. Could it maybe have become dictionaries within dictionary’s or something?

Constructed this little simple if-test to see if the property is really there. But I have to check every property “manually”. There’s propably a smarter way to check the hole NSDictionary / NSArray?

if ([restGPSTransfer objectForKey:@"dealerName"]) {
    NSLog(@"= YES! key exists.");
} else {
    NSLog(@"= Nope! key don't exists");
}

THANK’S for any help on this 🙂

.

UPDATE the Adealer class files;

Adealer.h

#import <Foundation/Foundation.h>

@interface Adealer : NSObject
@property (nonatomic, retain) NSString * dealerName;        
@property (nonatomic, retain) NSString * dealerAdressCity;
@property (nonatomic, retain) NSString * dealerAdressStreet;
@property (nonatomic, retain) NSString * dealerAdressZip;   
@property (nonatomic, retain) NSNumber * dealerID;
@property (nonatomic, retain) NSString * dealerImages;      
@property (nonatomic, retain) NSString * dealerLogo;        
@property (nonatomic, retain) NSString * dealerMail;        
@property (nonatomic, retain) NSString * dealerProducts;    
@property (nonatomic, retain) NSString * dealerTel;         
@property (nonatomic, retain) NSString * dealerText;    
@property (nonatomic, retain) NSString * dealerWeb; 
@property (nonatomic, retain) NSString * dealerLongitude;   
@property (nonatomic, retain) NSString * dealerLatitude;    
@property (nonatomic, retain) NSString *dealerDistance; 
@property float dealerDistance2;
@end

Adealer.m

#import "Adealer.h"
@implementation Adealer
@synthesize dealerAdressCity, dealerAdressStreet, dealerAdressZip, dealerID, dealerImages, dealerLogo;
@synthesize dealerMail, dealerName, dealerProducts, dealerTel, dealerText, dealerWeb;
@synthesize dealerLongitude, dealerLatitude, dealerDistance,dealerDistance2;
- (NSString *)description {
// Added extension of description

NSMutableString *string = [NSMutableString string];

[string appendString:@"\ntheDealer object and it's properties:\n"];

[string appendFormat:@"dealerName = %@\n", dealerName];
[string appendFormat:@"dealerAdressStreet = %@\n", dealerAdressStreet];
[string appendFormat:@"dealerAdressZip = %@\n", dealerAdressZip];
[string appendFormat:@"dealerAdressCity = %@\n", dealerAdressCity];

[string appendFormat:@"dealerTel = %@\n", dealerTel];
[string appendFormat:@"dealerMail = %@\n", dealerMail];
[string appendFormat:@"dealerWeb = %@\n", dealerWeb];

[string appendFormat:@"dealerLogo = %@\n", dealerLogo];
[string appendFormat:@"dealerImages = %@\n", dealerImages];
[string appendFormat:@"dealerText = %@\n", dealerText];
[string appendFormat:@"dealerProducts = %@\n", dealerProducts];

[string appendFormat:@"dealerLongitude = %@\n", dealerLongitude];
[string appendFormat:@"dealerLatitude = %@\n", dealerLatitude];
[string appendFormat:@"dealerDistance = %@\n", dealerDistance];
[string appendFormat:@"dealerDistance2 = %f\n\n", dealerDistance2];
return string;
}
@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-06-17T15:19:49+00:00Added an answer on June 17, 2026 at 3:19 pm

    SOLVED!
    Posted if anyone else needs it here.

    The solution

    In my “detailsVC” I first did this iVar declaration;

    .h:

    Adealer *theDealer;
    @property (nonatomic, retain) Adealer *theDealer;
    

    .m:

    @synthesize theDealer;
    

    Then in my “listVC” i did this to transfer the Adealer object and it’s properties to the “detailsVC” (remember that the Adealer object already has got it’s properties earlier in the described “loop”);

    Instead of my earlier;

    destVC.restGPSTransfer = [_dealerFeed objectAtIndex:myIndexPath.row];
    

    I changed it to;

    destVC.theDealer = [_dealerFeed objectAtIndex:myIndexPath.row];
    

    And to actually show and check the transferred property in “detailsVC” I can now simply call this to get the dealers name (or any other properties);

    self.labelRestName.text = theDealer.dealerName;
    NSLog(@"theDealer.name = %@",theDealer.dealerName);
    

    Works great! Happy Coding everyone!

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

Sidebar

Related Questions

I have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
This could be a duplicate question, but I have no idea what search terms
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text

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.