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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:23:46+00:00 2026-06-08T05:23:46+00:00

You would think this would return an NSString: NSString *class = NSStringFromClass([[_array objectAtIndex:([_array count]

  • 0

You would think this would return an NSString:

NSString *class = NSStringFromClass([[_array objectAtIndex:([_array count] -2)] class]);

NSLog(@"Is a kind of NSString: %@", ([[_class classForCoder] isSubclassOfClass:[NSString class]])? @"Yes" : @"No");    

if ([class isEqualToString:@"MapViewController"]) {
    [_appDelegate.navController0 pushViewController:_userListController animated:YES];

} else {
    [_appDelegate.navController3 pushViewController:_userListController animated:YES];
}

But for some reason it doesn’t, resulting in this crash:

Is a kind of NSString: No
-[NSKeyValueObservationInfo isEqualToString:]: unrecognized selector sent to instance 0x6e69080

Even when I try this:

NSString *class = (NSString *)[[_array objectAtIndex:([_array count] -2)] class];

It still doesn’t return an NSString, resulting in this crash:

Is a kind of NSString: No
+[MapViewController isEqualToString:]: unrecognized selector sent to class 0xd4460

I knew going in, that the last example was a bit of a stretch, but I’m pretty clueless as to why I’m not getting a NSString returned from either one?

  • 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-08T05:23:48+00:00Added an answer on June 8, 2026 at 5:23 am

    When I was accessing the NSString “class” from outside a method, I would get all kinds of wacky errors. so what I did was add a little retain statement:

    NSString *class = [NSStringFromClass([[_array objectAtIndex:([_array count] -2)] class]) retain];
    

    and now it’s working like a charm.

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

Sidebar

Related Questions

How can I force validation when user clicks button? One would think this should
Sorry if this is duplicate,I would think it would be but couldn't find anything.
How would I do this? I think this has something to do with editing
This should be pretty straightforward I would think. I have this string: [quote=Joe Johnson|1]Hi![/quote]
So I have this idea for a RubyGem that I think would be an
Think about doing this: import matplotlib.pyplot as plt plt.plot(x_A,y_A,'g--') plt.plot(x_B,y_B,'r-o') plt.show() How would you
I think I already know the answer to this but thought I would ask
I thought this would be easy. The Google makes me think otherwise. What I
Well I think I know the answer to this, but I would appreciate anybody
Okay at first I thought this would be pretty straightforward. But I can't think

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.