Simon Fell > Its just code > November 2007

Thursday, November 15, 2007

10.5.1

Leopard 10.5.1 Is out, unfortunately the hideous core data bug that'll loose all your data is still there. (the workaround is easy enough, but it requires every developer shipping a core data document app to know about the problem and to have shipped a patched version, and then for all there users to have updated to the patched version)

< 8:23 PM PST # > tags : OSX [playing "Are We Here? [Live]" by Orbital (from Live At Glastonbury 1994-2004 [Disc 1])]

Monday, November 12, 2007

Don Box on Auth

I found it hilarious that Don moans about HTTP auth and then points to WS-Security as the way forward, I just can't decide if Don was trying to be funny, or is actually serious. (in which case he's been in Redmond too long), looks like I'm not the only one.

< 8:19 AM PST # > tags : Web Services [playing "Swamp Thing" by Juno Reactor (from Bible of Dreams)]

Friday, November 02, 2007

Core Data Document Apps - File Corruption on Leopard

I turned up a rather nasty bug in Document based Core Data apps on Leopard, if you save a document that has no changes, it'll truncate the file to a 0 length (ouch), this only seems to affect the XML and Binary stores, not the SQLLite store. This reply on the cocoa-dev mailing list details a couple of work-arounds to address the issue.

< 8:55 AM PDT # > tags : OSX [playing "A rollerskating jam named "Saturday" - De La Soul (disco fever mix)" by Q45 (from Fuzzy Breaks Vol. 1 Disc 2)]

Thursday, November 01, 2007

Tiger Table Editing

As I mentioned yesterday, the behavior of NSTableView changes in Leopard, pressing enter after editing a cell no longer starts editing the cell below it. There's some hints in the release notes, and on the Cocoa-dev mailing list, seems you have to subclass NSTableView, here's what i ended up with. Hopefully this'll save someone some time.

@interface MyTableView : NSTableView {
}
@end

@implementation MyTableView

- (void)textDidEndEditing:(NSNotification *)aNotification {
	if ([[[aNotification userInfo] objectForKey:@"NSTextMovement"] intValue] == NSReturnTextMovement) {
		int row = [self editedRow] + 1;
		int col = [self editedColumn];
		NSMutableDictionary *ui = [NSMutableDictionary dictionaryWithDictionary:[aNotification userInfo]];
		[ui setObject:[NSNumber numberWithInt:NSDownTextMovement] forKey:@"NSTextMovement"];
		aNotification = [NSNotification notificationWithName:[aNotification name] object:[aNotification object] userInfo:ui];
		[super textDidEndEditing:aNotification];
		if (row < [self numberOfRows]) {
			[self selectRow:row	byExtendingSelection:NO];
			[self editColumn:col row:row withEvent:nil select:YES];
		}
	} else {
		[super textDidEndEditing:aNotification];
	}
}

@end
< 9:43 PM PDT # > tags : OSX [playing "Smoke machine - X-press 2 (Koma & Bones mix)" by Krafty Kuts (from Fuzzy Breaks vol. 1 cd 1)]

Wednesday, October 31, 2007

NSTableView changes

If you were wondering why enter works differently in Table View on Leopard, here's the low down from the AppKit release notes. Now i've got to back and work out how to get the old behavior, as that's actually what i wanted.

< 10:39 PM PDT # > tags : OSX [playing "Ceremony" by New Order (from Substance [Disc 1])]