Skip to content

Instantly share code, notes, and snippets.

@dennda
Created September 21, 2011 19:52
Show Gist options
  • Save dennda/1233109 to your computer and use it in GitHub Desktop.
Save dennda/1233109 to your computer and use it in GitHub Desktop.
// In the interface:
@interface TransferFunction : NSObject {
id <TransferFunctionDrawingDelegate> _delegate;
}
@property (nonatomic, weak) id <TransferFunctionDrawingDelegate> delegate;
// In the implementation:
@synthesize delegate=setDelegate;
- (void)setDelegate:(id <TransferFunctionDrawingDelegate>)delegate {
_delegate = delegate;
[delegate recreatePath:self.points];
assert(delegate != nil);
}
// The _delegate iVar works, but the property doesn't:
(gdb) p [_tf delegate]
$1 = (struct objc_object *) 0x0
(gdb) p _tf._delegate
$2 = (struct objc_object *) 0xb24e420
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment