• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Trouble calling class_addIvar()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Trouble calling class_addIvar()
      • From: Dave DeLong <email@hidden>
    • Re: Trouble calling class_addIvar()
      • From: Kyle Sluder <email@hidden>
  • Prev by Date: Re: Freeing the property list returned by class_copyPropertyList()?
  • Next by Date: Re: Trouble calling class_addIvar()
  • Previous by thread: Re: Freeing the property list returned by class_copyPropertyList()?
  • Next by thread: Re: Trouble calling class_addIvar()
  • Index(es):
    • Date
    • Thread