-
Love/hate relationship with Cocoa Bindings
I have a love/hate relationship with Cocoa Bindings. On the surface, bindings look really cool. Write less code and get a program running faster. This is great in theory, but in reality, it can be tricky. Bindings in Interface Builder work OK (however, there seems to be annoying Interface Builder bugs that change the focus when you try to bind an object). The problem arises when you remove an object from a nib, run the app and find out that your get an exception that the object is not key/value compliant. So, you have to search through the nib looking for the bindings that are no longer relevant. If you have a lot of objects, this can be time consuming and problematic.
On the love side, I can more easily bring up a user interface and then have things update automatically when something else changes.
In order to help troubleshoot these loose bindings, I found a cool debugging technique. First, in your app's initialize method, add the following:
+ (void) initialize { [BindingDebugObject poseAsClass:[NSObject class]]; }
then add the debugging object:
@implementation BindingDebugObject - (void)bind:(NSString *)binding toObject:(id)observable withKeyPath:(NSString *)keyPath options:(NSDictionary *)options { NSLog(@"Binding: %@ %@ %@ %@", binding, observable, keyPath, self); [super bind:binding toObject:observable withKeyPath:keyPath options:options]; }
-
Paying to watch ads
My wife and I have now managed to get out of the house to watch a few movies without our son (we left him with a babysitter) and while it is good to get out, it reminds me of how annoyed I get at movies. We pay our money (we've gone to matinees so the cost is reasonable) and then have to sit through about 20 minutes of ads. It's worse if we get there early as they have the "20 before the movie". My wife calls it, the "20 before the 20 before the movie". Why should we have to pay money to see all the ads? The cost of movies has gone up so much in the last few years it is unbelievable. So the cost has gone up, the ads have increased, and the industry makes more money. We have to put up with it if we want to goto movies. I guess renting movies on my AppleTV is looking better and better.
-
Time Machine saved my butt!
I'm a bit paranoid about backups, so when Leopard came out, I started using Time Machine to backup in addition to doing my daily SuperDuper! backup. I started using it as an experiment to see how it would work. The one issue I see with Time machine is having to have a drive connected all the time (which I'm looking forward to 10.5.2 for the supposed ability to use Time Machine to an Airport Extreme connected drive). The other day I as working in Interface Builder modifying some nibs and it crashed. This wasn't surprising as Interface Builder doesn't handle issues such as trying to remove objects with existing connections, so I wasn't worried. However, when I launched Interface Builder again, I found that it corrupted my file. Worst case, I'd have to restore from my Subversion repository, but I would have lost a day's worth of work. I checked my Time Machine backup and bingo, a copy of the file was there from about 10 minutes before. I'm pleased that Time Machine saved me. It's kind of ironic that an Apple technology saved me from an Apple bug.
-
Document based ReceiptWallet is a reality!
I wrote almost 2 weeks ago about changing ReceiptWallet into a document based application. I've been hesitant to do so because there are lots of things involved. For instance, I have to lock out scanning when one window is scanning, I have to deal with each window having a Reports item, etc. I decided that the time was now to implement it, so a few days ago, I started the journey to switch ReceiptWallet to document based. Based on some work that others have done in making NSPersistentDocument work with packages, I created a test application last Wednesday or Thursday and proved that it was viable. So, I've been working like a mad man to get things done. I'm down to about 20 "items" on my list to work on and then I'll start my own testing. I had to rip ReceiptWallet apart in order to do this, but I'm gradually putting it back together. I'm at least at the point where I can start using ReceiptWallet again; a bunch of pieces still don't work, but I figure over the course of the next few days, I'll have everything working and then can start external testing. Yeah! (Some things in the UI aren't final; I'm not sure I'm going to keep the drawer for the details...I might goto a floating panel.)