On Mon, 8 Sep 2008 11:23:30 +1000, Rohan Lloyd <[EMAIL PROTECTED]> said: >I don't like the vague "Format Error" and want to display my own >message, so I've written my own >control:didFailToFormatString:errorDescription: method (In my >NSWindowController subclass), and set the text field delegate to point >at it. > >- (BOOL)control: (NSControl*)control didFailToFormatString: >(NSString*)str errorDescription: (NSString*)errDescription >{ > NSError *error = [NSError errorWithDomain: NSCocoaErrorDomain >code: NSFormattingError userInfo: nil]; // Add custom description later > [control presentError: error modalForWindow: [self window] > delegate: nil > didPresentSelector: nil > contextInfo: nil]; > > return YES; >}
First thing's first. Documentation says return value should be: > Return Value > YES if the value in the string parameter should be accepted as is; otherwise, > NO if the value in the parameter should be rejected. If you don't like the string, you should not be returning YES. m. -- matt neuburg, phd = [EMAIL PROTECTED], <http://www.tidbits.com/matt/> A fool + a tool + an autorelease pool = cool! One of the 2007 MacTech Top 25: <http://tinyurl.com/2rh4pf> AppleScript: the Definitive Guide - Second Edition! <http://www.amazon.com/gp/product/0596102119> _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]