Corbin Dunn and Louise Lovelle
Treehouse
Woodworking
Pictures/Photography
Videos
Machining
About
Search

Archive for July, 2006

People! Use your keyboard (shortcuts) for menus.

Friday, July 14th, 2006

Mac OS X has some GREAT keyboard access. One spectacular thing is the ability to access all items (unlike windows, where you have to have a defined shortcut for each item, and you easily run out of items).

First, go to the System Preferences.app and change the keyboard shortcut from Ctrl-F2 to Cmd-F2.

Picture 2

Cmd-F2 is so much easier to hit than Ctrl-F2.

Next, use it! Being from Windows, when I first used it I didn’t realize how it works. Basically, it is doing type-selection; ie: you type the word you want it to go to.

So, people are amazed at how fast I can reopen files with my fingers. For instance, to open the last file in TextEdit, I do this:

Cmd-F2 (focuses Apple menu)
F (Focuses “File”)
Enter (Drops down the “File” menu)
O (Selects “Open Recent” menu)
Enter (Selects the first item in the list)
Enter (Opens the item)

Sweeetness.

I use this all the time to open recent items in Xcode.

One small bug: the items in the Open Recent menu don’t work with type selection..hopefully that will get fixed.

Xcode tips and tricks — fast method finding

Friday, July 14th, 2006

Inside of Xcode, I’ll want to quickly go to a method implementation. If you hit Cmd-F and do a find for the method name (or the start of it), you will frequently get hits for calls of the method instead of just the implementation.

There is a quick way to find the implementation: Hit Cmd-F and type: “)methodName”.

The left paren will match only the implementation (provided you don’t put a space after it…which you shouldn’t do anyways).

I picked up this little tidbit by watching Troy Stephens code around. Thanks Troy!

New home!

Thursday, July 13th, 2006

I now own a house in Los Gatos, California! Pictures here. I’ll be doing a lot of remodeling work for the next, oh, um…several years. 4.5 acres off of Hutchinson road. I’m SUPER excited!

My old house that i’m renting will be available for rent next month: 18400 Foster Rd, Los gatos, ca. $1200/month rent. the landlord is super nice, and it is close to town — a 5-6 minute drive down the hill and you are in downtown los gatos. Email me..corbin at blue tree soft dot com for details.

Spam.

Thursday, July 13th, 2006

It was bound to happen.

It finally happened.

My blog has started to get spam. So, based on Bill’s Success of using Akismet, I installed it in my WordPress plugins and it is now happily eating spam. Yeah!

Mail tip of the day

Friday, July 7th, 2006

In Mail, I frequently want to go to the first or last message in my list. On windows, the home and end keys work well for this. On MacOS, they don’t work in NSTableView/NSOutlineView by default. However, alt-up arrow and alt-down arrow will go to the end/start of the table. But, in Mail, this behavior goes to the next/previous message in a series. BUT! if you hold down alt-up arrrow for a brief second, it will take you to the start of your messages (and, alt-down arrow to go to the end). cool..

NSOutlineView: reloadData and crashes in reloadData

Friday, July 7th, 2006

A note to NSOutlineView Cocoa programmers: It has never been safe to call reloadData while an outlineView is doing a reloadData. What the heck does that mean? Well, if you call reloadData, a whole bunch of delegate/datasource methods will be called, such as outlineView:numberOfChildrenOfItem:, outlineView:isItemExpandable:, etc. Well, if in those delegate methods you accidentally call reloadData again, bad things can happen. Specifically, you will probably get a crash in NSOutlineView. More often than not, this is done by an accidental side effect, but it is something to be aware of. On Leopard, I will make NSOutlineView more resilient to this case, and not crash. On Tiger, you can fix it yourself, if you think it is (or may) affect you. Here is the general recipe:

1. Subclass NSOutlineView, and add an iVar that looks like:

   BOOL _isReloading;

2. Override reloadData and make it look something like this:

- (void)reloadData {
    if (!_isReloading) {
       _isReloading = YES;
       [super reloadData];
       _isReloading = NO;
   } else {
       [self performSelector:@selector(reloadData) withObject:nil afterDelay:0];
   }
}

(c) 2008-2009 Corbin Dunn

Corbin’s Treehouse is powered by WordPress. Made on a Mac.

Entries (RSS) and Comments (RSS).

18 queries. 0.307 seconds.