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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:51:46+00:00 2026-05-27T17:51:46+00:00

I am just learning Objective-C, in Xcode 4.2. What I am trying to do

  • 0

I am just learning Objective-C, in Xcode 4.2. What I am trying to do should be very simple, but it is driving me nuts. I am trying to pass an NSString object from one Class Method to another Class Method, and I have been able to successfully pass NSArray’s.

I have looked around, and found questions on how to pass NSString objects between two Instance Methods (which I can get to work fine). The two class’s are below:

+ (double)numberOfOperations:(NSArray *)program equalityTest:(NSString *)testForEquality
{
    NSSet *stackSet = [[NSSet alloc] initWithArray:program];
    NSPredicate *predicate = [NSPredicate predicateWithFormat:testForEquality];
    NSSet *filteredStackSet = [stackSet filteredSetUsingPredicate:predicate];
    return [filteredStackSet count];

}

+ (double)descriptionOfProgram:(NSMutableArray *)program
{
    NSArray *stack = [program copy];

    double test = [self numberOfOperations:stack equalityTest:@"+"];
    return test;
}

when I compile, and run the above code, i get an error at run time “Unable to parse string “+”. I have also pasted the debbuger code below:

2011-12-27 14:51:53.755 Calculator[320:f803] * Terminating app due to uncaught exception ‘NSInvalidArgumentException’, reason: ‘Unable to parse the format string “+”‘
*
First throw call stack:
(0x13be052 0x154fd0a 0x94fdc1 0x94fbdf 0x94fb93 0x46fb 0x4829 0x3c9c 0x2ac3 0x2a3e 0x13bfec9 0x185c2 0x1855a 0xbdb76 0xbe03f 0xbd2fe 0x3da30 0x3dc56 0x24384 0x17aa9 0x12a8fa9 0x13921c5 0x12f7022 0x12f590a 0x12f4db4 0x12f4ccb 0x12a7879 0x12a793e 0x15a9b 0x1f38 0x1e95)
terminate called throwing an exception(gdb).

Is it even possible to pass NSString objects between classes? Let me know if you need more information.

  • 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-27T17:51:47+00:00Added an answer on May 27, 2026 at 5:51 pm

    @"+" is not a valid predicate format, it’s spitting the dummy because it is unable to create an NSPredicate object with the specified format. It’s not to do with passing strings around.

    Have a quick once-over of the Predicate Programming Guide to see what a predicate string should look like.

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

Sidebar

Related Questions

I am just learning objective c and xcode. I love the interface building, but
I'm still very much learning the basics of Objective-C, but I'm still trying to
I am just learning objective-c but can't figure out whats wrong with my code
I'm just learning some basic programming in Objective C and Cocoa. I'm trying to
I just started learning Objective-C and OOP ... so I have very stupid question
I'm learning Objective-C and just trying out some sample code. I am getting the
I'm just learning to use XCode and program in Objective-C (my plan is to
I'm learning Objective-C and using GNUStep, but when i try to execute my very
I'm just learning Objective-C/Cocoa programming for the Mac. All of the tutorials, books, blogs,
Im just learning mod_rewrite and regex stuff, and what I'm trying to do is

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.