HHDualShortcutButton updated
October 10, 2009 12:39 PM
| Cocoa, Development, Houdah, Mac
| Permalink
HHDualShortcutButton has been updated to be Cocoa only. No more Carbon code!This makes it require Mac OS X 10.6 Snow Leopard.
Comments
Sample use of HHBlockPerform
October 9, 2009 10:25 PM
| Cocoa, Development, Mac
| Permalink
HHPerformBlock SetterBlock(id inValue, NSString *inKey){ HHPerformBlock block = ^(id owner) { [owner willChangeValueForKey:inKey]; [owner associateValue:inValue withKey:inKey]; [owner didChangeValueForKey:inKey]; }; return [[block copy] autorelease];}/* ... */- (NSNumber*)progressMinValue{ return [self associatedValueForKey:@"progressMinValue"];}- (void)setProgressMinValue:(NSNumber*)inValue{ [self
HHBlockPerform revisited
October 9, 2009 12:14 AM
| Cocoa, Development, Mac
| Permalink
The first post on the subject prompted Ben to comment: "Helpful tip: Just capture the object being messaged using the block's scope. No need for the extra "owner" parameters and whatnot." Right he is.typedef void (^HHPerformBlock)();@interface NSObject (HHBlockPerform)- (void)performAfterDelay:(NSTimeInterval)delay block:(HHPerformBlock)block;- (void)performOnMainThreadWait:(BOOL)wait block:(HHPerformBlock)block;@end@implementation