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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:48:57+00:00 2026-05-28T18:48:57+00:00

I have this string: str is {( You, Me )} Looking on SO, I

  • 0

I have this string: “str is {(
You,
Me
)}”

Looking on SO, I found this post and this one (among others)

I want to remove the leading {( and the trailing )}

Every solution so far has been met with an error:

-[__NSCFSet length]: unrecognized selector sent to instance

or a similar variant. I can print the value to the console and I can use the unfiltered “peopleExport” elsewhere in my app.

The code I’ve tried so far includes :

NSString *str = (NSString *)[managedObject valueForKeyPath:@"people.name"];

    NSLog(@"str is %@", str);

    //NSString *string = @"hello one two three";

    //NSString *newStr = [str substringFromIndex:3];
    str = [str substringWithRange:NSMakeRange(2, str.length-2)];


    NSString *newStr;

    if ( [str length] > 0){
        NSLog(@"a");
    newStr = [str substringFromIndex:2];
    } else {
        NSLog(@"b");
        newStr = str;
    }

    NSLog(@"%@", newStr);

    peopleExport = newStr;

The source is from a core data store. Does that matter?

I would appreciate any pointers.

  • 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-28T18:48:59+00:00Added an answer on May 28, 2026 at 6:48 pm

    It looks to me like str is not actually an NSString, but is an NSSet, and what you’re seeing is the result of the -description method being called on that set. If what you want is a string of the form “You, Me”, try this:

    NSSet *set = [managedObject valueForKeyPath:@"people.name"];
    NSString *newString = [[set allObjects] componentsJoinedByString:@", "];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following string: const char *str = \This is just some random
I have a string as const char *str = Hello, this is an example
I've been looking around for a solution to this, but haven't quite found one.
I have an url like this: http://www.w3schools.com/PHP/func_string_str_split.asp I want to split that url to
I have this string 'john smith~123 Street~Apt 4~New York~NY~12345' Using JavaScript, what is the
I have this string in PHP: $string = name=Shake & Bake&difficulty=easy; For which I
I have this string: 123-456-7 I need to get this string: 1234567 How I
I have this string: \Blah \'Blah\' Blah\ . There is another string inside it.
I have this string stored in a variable: IN=bla@some.com;john@home.com Now I would like to
I have this string containing a large chunk of html and am trying to

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.