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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T20:42:41+00:00 2026-05-24T20:42:41+00:00

In Xcode 3.X, you were supposed to right-click the whitespace in the fetch request

  • 0

In Xcode 3.X, you were supposed to right-click the whitespace in the fetch request template’s predicate editor to specify a variable input rather than a hard-coded predicate.

Where is this in XCode 4? I’ve held option, right-clicked, option-clicked, etc and cannot figure it out….

Variable in Fetch Request Template Editor Predicate

  • 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-24T20:42:41+00:00Added an answer on May 24, 2026 at 8:42 pm

    I don’t think X4 has the variable anymore.

    Instead, I think you have to choose an expression and then provide a variable of the form $VARNAME.

    For example, given and entity Alpha with an attribute aString, I created a fetch request template bobFetch with an expression of aString == $TESTVAR.

    Alpha *a=[NSEntityDescription insertNewObjectForEntityForName:@"Alpha" inManagedObjectContext:self.moc];
    a.aString=@"steve";
    [self saveContext];
    NSDictionary *subVars=[NSDictionary dictionaryWithObject:@"steve" forKey:@"TESTVAR"];
    NSFetchRequest *fetchRequest =   [self.managedObjectModel fetchRequestFromTemplateWithName:@"bobRequest" substitutionVariables:subVars];
    NSEntityDescription *entity = [NSEntityDescription entityForName:@"Alpha" inManagedObjectContext:self.moc];
    [fetchRequest setEntity:entity];
    

    If logged fetchRequest reports:

    <NSFetchRequest: 0x4d17480> (entity: Alpha; predicate: (aString == "steve"); sortDescriptors: ((null)); type: NSManagedObjectResultType; )
    

    … and can then be used normally.

    NSError *error = nil;
    NSArray *fetchedObjects = [self.moc executeFetchRequest:fetchRequest error:&error];
    if (fetchedObjects == nil) {
        NSLog(@"fetch error = %@",error);
    }
    NSLog(@"fetchObjects = %@",fetchedObjects);
    

    Kind of clumsy for a graphical environment but it works.

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

Sidebar

Related Questions

In Xcode 3, I could right click on some text in my code, select
Xcode is behaving rather strange right now: If I try to Build for Archive
It is supposed to be possible to install XCode + SDK on a PowerPC.
I'm having trouble installing a framework in XCode(CoreMotion). I think it supposed to come
I'm using Xcode 4.2 and iOS SDK 5.0 and Apple's Master-Detail Application Template for
quick question regarding Array's in xcode. I have ht efollowing code, which is supposed
I know that Xcode is supposed to make debugging easier. Could someone how this
I'm working in XCode and I've also written an external editor tool that generates
How to get file size of pdf,gif,doc etc using xcode. suppose to i get
XCode 3.1.2 using built-in OCTest unit testing. I'm getting a crash when unit tests

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.