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
cocoa-dev Mailing List
cocoa-dev Mailing List
Thread Index
[
Prev Page
][
Next Page
]
Re: programmatically adding model objects to NSOultineView/NSTreeController
From
: Ken Victor <email@hidden>
Re: Modifying system files
From
: John Stiles <email@hidden>
Re: NSImage problems
From
: Dorian Johnson <email@hidden>
NSImage problems
From
: "Barry" <email@hidden>
Re: NSTokenField completion problems
From
: Danny Hall <email@hidden>
Re: Modifying system files
From
: Aaron Wallis <email@hidden>
Re: Modifying system files
From
: Ricky Sharp <email@hidden>
NSSpeechRecognizer and recognizer window
From
: Brad Peterson <email@hidden>
Re: Modifying system files
From
: Shawn Erickson <email@hidden>
Re: Modifying system files
From
: Wain Glaister <email@hidden>
Modifying system files
From
: Aaron Wallis <email@hidden>
Re: programmatically adding model objects to NSOultineView/NSTreeController
From
: mmalc Crawford <email@hidden>
Re: XSXMLNode nodesForXPath bug?
From
: "Stephen Deken" <email@hidden>
Re: Key number to Unicode string
From
: Dorian Johnson <email@hidden>
Re: XSXMLNode nodesForXPath bug?
From
: "Stephen Deken" <email@hidden>
programmatically adding model objects to NSOultineView/NSTreeController
From
: Ken Victor <email@hidden>
NSTokenField completion problems
From
: Danny Hall <email@hidden>
Re: CoreData sub-classing
From
: Hal Mueller <email@hidden>
Re: XSXMLNode nodesForXPath bug?
From
: Tomas Franzén <email@hidden>
Re: CoreData sub-classing
From
: Steve Israelson <email@hidden>
Re: CoreData sub-classing
From
: "Marcus S. Zarra" <email@hidden>
Re: CoreData sub-classing
From
: Steve Israelson <email@hidden>
Re: CoreData sub-classing
From
: "Marcus S. Zarra" <email@hidden>
CoreData sub-classing
From
: Steve Israelson <email@hidden>
CoreData and image caching
From
: Steve Israelson <email@hidden>
XSXMLNode nodesForXPath bug?
From
: "Stephen Deken" <email@hidden>
Re: Core Data app becomes a memory hog
From
: "Clint Shryock" <email@hidden>
Re: How can I make an NSScrollView scroll to the top?
From
: Steve Israelson <email@hidden>
How can I make an NSScrollView scroll to the top?
From
: Steve Israelson <email@hidden>
Sizing an NSTableView to be big enough to show all its rows
From
: Steve Israelson <email@hidden>
Re: CoreData mutableSetValueForKey does NOT return a NSMutableSet
From
: Steve Israelson <email@hidden>
Re: CoreData mutableSetValueForKey does NOT return a NSMutableSet
From
: Jim Correia <email@hidden>
Code for WWDC Hands-On Bindings session
From
: mmalc Crawford <email@hidden>
Re: CoreData mutableSetValueForKey does NOT return a NSMutableSet
From
: Steve Israelson <email@hidden>
Re: How to stop a Modal dialog properly and programmatically?
From
: Jerry Krinock <email@hidden>
Re: CoreData mutableSetValueForKey does NOT return a NSMutableSet
From
: mmalc Crawford <email@hidden>
CoreData mutableSetValueForKey does NOT return a NSMutableSet
From
: Steve Israelson <email@hidden>
Re: StrokeColor in NSTextView
From
: Douglas Davidson <email@hidden>
Re: Value With Pattern binding not working as expected
From
: Sam Stigler <email@hidden>
Re: nodesForXPath does not seem to work in Address Book Plug-Ins
From
: Sam Stigler <email@hidden>
StrokeColor in NSTextView
From
: Lorenzo <email@hidden>
Re: Core Data app becomes a memory hog
From
: "Joshua Pennington" <email@hidden>
Re: Core Data app becomes a memory hog
From
: "Clint Shryock" <email@hidden>
[ANN] PreFab Event Taps Testbench 1.0
From
: Bill Cheeseman <email@hidden>
Get and loss focus on a NSTextField
From
: mabo68 <email@hidden>
Vertically Expanding TextField
From
: "Randall Wood" <email@hidden>
Sorting NSTableView columns with digits as numbers [Was: Re: Sorting filenames the way the Finder does?]
From
: António Nunes <email@hidden>
Re: Displaying and Editing item Metadata in an NSTextField
From
: Half Activist <email@hidden>
Displaying and Editing item Metadata in an NSTextField
From
: Jordan Chark <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: Aki Inoue <email@hidden>
Re: Array controller content vs. contentArray binding
From
: mmalc Crawford <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: James Bucanek <email@hidden>
RE: Key number to Unicode string (email@hidden)
From
: "Dorian Johnson" <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: Jim Correia <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: James Bucanek <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: Scott Anguish <email@hidden>
Re: codeSense
From
: Tony Cate <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: James Bucanek <email@hidden>
Array controller content vs. contentArray binding
From
: Dave Hayden <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: James Bucanek <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: Scott Anguish <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: Jim Correia <email@hidden>
Re: Sorting filenames the way the Finder does?
From
: Jim Correia <email@hidden>
Sorting filenames the way the Finder does?
From
: James Bucanek <email@hidden>
Access to nibs topLevelObjects without outlets and without instantiateNibWithOwner:topLevelObjects:
From
: "Gustavo Vera" <email@hidden>
Re: [ANN] MacFUSE talk at Google
From
: Dave MacLachlan <email@hidden>
Re: NSDocument and a 'persistent profiles palette'
From
: Fritz Anderson <email@hidden>
Re: Dictionaries within a dictionary - getAllValuesForKey:
From
: Charles Steinman <email@hidden>
NSArrayController display newly inserted objects twice
From
: Eric MORAND <email@hidden>
Re: Key number to Unicode string
From
: Daniel Jalkut <email@hidden>
NSArrayController display newly inserted objects twice Hi guys ! I'm facing a strange problem with an instance of NSArrayController. In my project, I have an entity with an attribute named "name". This attribute have to be unique, so I have a validation process that ensure the uniqueness : - (BOOL)validateName: (id *)valueRef error:(NSError **)outError { // "name" must be unique NSArray * results = nil; NSPredicate * predicate = nil; NSFetchRequest * fetchRequest = nil; predicate = [NSPredicate predicateWithFormat:@"(SELF != %@) AND (name LIKE %@)", self, *valueRef]; fetchRequest = [[[NSFetchRequest alloc] init] autorelease]; [fetchRequest setEntity:[self entity]]; [fetchRequest setPredicate:predicate]; results = [[self managedObjectContext] executeFetchRequest:fetchRequest error:nil]; if ( [results count] > 0 ) { return NO; } return YES; } I've also added the following methods to ensure that any newly inserted object has a unique name by defa! ult : ! - (void)awakeFromInsert { [self setUniqueName]; } - (void)setUniqueName { NSString * defaultName = NSLocalizedStringFromTableInBundle(@"NewCategory", @"Localizable", [NSBundle mainBundle], nil); NSString * uniqueName = defaultName; int index = 0; NSError * error = nil; while ( ![self validateValue:&uniqueName forKey:@"name" error:&error] ) { index++; uniqueName = [defaultName stringByAppendingFormat:@" (%d)", index]; break; } [self setName: uniqueName]; } This works perfectly in most cases...but the most important one : insertion using an NSArrayController. In this case, my managed object is inserted perfectly in the database, with a unique name, but the array controller inserts it twice in its content array ! It seems like the problem is due to this line in my validation method : results = [[self managedObjectContext] executeFetchRequest:fetchRequest error:nil]; If I comment this line, everything works perfectly (but, obviously, the name is not unique). To ill! ustrat! e the problem, I've created a small project that can be do
From
: Eric MORAND <email@hidden>
How to stop a Modal dialog properly and programmatically?
From
: Stephane <email@hidden>
Re: NSTable - intercept item name before user editing
From
: Keary Suska <email@hidden>
Key number to Unicode string
From
: email@hidden
Re: codeSense
From
: "Adam R. Maxwell" <email@hidden>
Re: Dictionaries within a dictionary - getAllValuesForKey:
From
: "Daniel T. Staal" <email@hidden>
Dictionaries within a dictionary - getAllValuesForKey:
From
: "Jofell Gallardo" <email@hidden>
Re: How to use bindings on a specific array element
From
: Francis Derive <email@hidden>
Re: codeSense
From
: Ofri Wolfus <email@hidden>
Add two color for records of NSTableView.
From
: Sachin Kumar Tulla <email@hidden>
Re: [CoreData] Background Insertion
From
: Aurélien Hugelé <email@hidden>
Re: nodesForXPath does not seem to work in Address Book Plug-Ins
From
: Lars von Wedel <email@hidden>
Re: nodesForXPath does not seem to work in Address Book Plug-Ins
From
: "Gernot Poetsch" <email@hidden>
Getting Mouse Up in NSTextFieldCell (was NSTextFieldCell and stopTracking)
From
: Eric Jutras <email@hidden>
Re: codeSense
From
: Douglas Davidson <email@hidden>
codeSense
From
: Tony Cate <email@hidden>
Re: nodesForXPath does not seem to work in Address Book Plug-Ins
From
: Tomas Franzén <email@hidden>
Re: Open new document in first (empty) window
From
: arri <email@hidden>
NSTable - intercept item name before user editing
From
: Ari Benzane <email@hidden>
Re: Open new document in first (empty) window
From
: Ari Benzane <email@hidden>
NSTextFieldCell and -stopTracking::
From
: Eric Jutras <email@hidden>
Re: NSURLDownload notifies on wrong thread?
From
: Robert Nicholson <email@hidden>
Re: Problem with Bluetooth API
From
: Jim Brownfield <email@hidden>
nodesForXPath does not seem to work in Address Book Plug-Ins
From
: "Gernot Poetsch" <email@hidden>
Re: NSNotification
From
: Chris Hanson <email@hidden>
Re: NSTableView 's Action Invocation Bindings
From
: Francis Derive <email@hidden>
Problem with Bluetooth API
From
: tiennou <email@hidden>
Re: NSTableView 's Action Invocation Bindings
From
: Keary Suska <email@hidden>
Re: How to use bindings on a specific array element
From
: George Orthwein <email@hidden>
NSTableView 's Action Invocation Bindings
From
: Francis Derive <email@hidden>