Simon Fell > Its just code > November 2007

Thursday, November 15, 2007

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)

Monday, November 12, 2007

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.

Friday, November 2, 2007

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.

Thursday, November 1, 2007

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

Wednesday, October 31, 2007

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.