Trouble calling class_addIvar()
Trouble calling class_addIvar()
- Subject: Trouble calling class_addIvar()
- From: Rick Mann <email@hidden>
- Date: Fri, 8 Oct 2010 16:39:21 -0700
I'm trying to add an ivar to a (sub)class in the base class' +initialize method. I'm not sure if it's too late to do it at this point or not. If I can't do it here, i don't know where to make the call.
I'm calling it like this:
char const* ivarNameCString = ivarName.UTF8String;
size_t size = sizeof (NSData*);
uint8_t align = log2(size);
bool success = class_addIvar(self.class, ivarNameCString, size, align, "@");
The values for the parameters end up being:
ivarNameCString: mOutputDataCacheChannel1
size: 8
align: 3
The documentation doesn't specify what the last parameter should be, other than to name it "types." I assumed that was supposed to be a type string, although I don't know why you would specify more than one.
Anyway, this returns false, but I have no idea why.
Can anyone help me out? Thanks!
--
Rick
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden