• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTableView searching and predicates
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTableView searching and predicates


  • Subject: Re: NSTableView searching and predicates
  • From: Andrew Farmer <email@hidden>
  • Date: Sat, 4 Aug 2007 16:44:18 -0700

On 03 Aug 07, at 07:20, mmalc crawford wrote:
On Aug 3, 2007, at 6:49 AM, Daniel Wambold wrote:
-(void) myEventSearch:(id)sender
{
NSPredicate *myFilterPredicate;
NSString *mySearchString = [sender stringValue];
if (mySearchString != nil)
{
myFilterPredicate = [NSPredicate predicateWithFormat:
@"%@ IN[cd] myEvent || %@ IN[cd] myNotes", mySearchString, mySearchString];
}
[self setFilterPredicate:myFilterPredicate];
[self rearrangeObjects];
}

That'll run [self setFilterPredicate:] on an uninitialized variable if mySearchString is nil. The third line should probably be:


	NSPredicate *myFilterPredicate = [NSPredicate predicateWithValue:YES];

in order to get identical behavior to the original.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: NSTableView searching and predicates
      • From: mmalc crawford <email@hidden>
References: 
 >NSTableView searching and predicates (From: Daniel Wambold <email@hidden>)
 >Re: NSTableView searching and predicates (From: mmalc crawford <email@hidden>)

  • Prev by Date: offtopic: best way of plainng overall structure of programs/functions etc.
  • Next by Date: Associate, NSView in main window, and disable objects on panel
  • Previous by thread: Re: NSTableView searching and predicates
  • Next by thread: Re: NSTableView searching and predicates
  • Index(es):
    • Date
    • Thread