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

  • Home
  • SEARCH
  • 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 8699121
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T01:52:17+00:00 2026-06-13T01:52:17+00:00

I have a simple predicate driving me crazy. NSString *name; NSDate *myDate; -(void)fetch:(NSString *)name

  • 0

I have a simple predicate driving me crazy.

NSString *name;
NSDate *myDate;

-(void)fetch:(NSString *)name Date:(NSDate *)myDate
{
  ...
  //predicate
  NSPredicate *predicate = [NSPredicate predicateWithFormat:@"name = %@ AND myDate = %@",name,myDate];
  [req setPredicate:predicate];
}

-(void)fetch2:(NSString *)predicateStr
{
   ...
  //predicate
  NSPredicate *predicate = [NSPredicate predicateWithFormat:predicateStr];
  [req setPredicate:predicate];
}

////// call #1/////
[self fetch:name Date:myDate]; //WORKS

////// call #2/////
NSString *predicateStr = [NSString stringWithFormat:@"name = %@ AND myDate = %@",name,myDate];
[self fetch2:predicateStr]; 

//Call#2 doesn’t work – Can’t parse Date ?? Aren’t they identical? The parameters are the same, no change in values. Note, the Date parameter is the problem, the NSString parameter works fine without the Date.

  • 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-13T01:52:18+00:00Added an answer on June 13, 2026 at 1:52 am

    No, they’re not the same.

    For Call #1, here’s what you’re passing in to +predicateWithFormat::

    @"name = %@ AND myDate = %@"
    

    For Call #2, here’s what you’re passing in to +predicateWithFormat::

    @"name = Some Name AND myDate = 2012-10-17 8:05:42 PM -0800"
    

    The first one is a valid predicate format string, and thus it works. The second is not a valid predicate format string, and thus it fails.

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

Sidebar

Related Questions

I have a simple predicate function that follows as: [totalSentences addObjectsFromArray:[firstLangEx filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@(SELF contains[c]
In my iOS application I have a really simple predicate for my fetch controller.
I have simple form. <form target=_blank action=somescript.php method=Post id=simpleForm> <input type=hidden name=url value=http://...> <input
I have a simple predicate in prolog that when MaxScore >0, it gives yes,
If I have a simple predicate in the database, is there a way that
I'm working with an app using CoreData. I have a simple structure: Name Lastname
I have a simple table that has an NSFetchedResultsController. It uses the current date
I want a simple predicate that returns me all the groups which have mode
I have simple table in Sybase -- Creating table 'SimpleText' CREATE TABLE [dbo].[SimpleText] (
I have simple class with width and height member fields which define number of

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.