Pierre Bernard

My little hideout on the net

HHDualShortcutButton updated

HHDualShortcutButton has been updated to be Cocoa only. No more Carbon code!This makes it require Mac OS X 10.6 Snow Leopard.
Read More....
Comments

Sample use of HHBlockPerform

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
Read More....
Comments

HHBlockPerform revisited

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
Read More....
Comments