Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

True object size



I'm trying to find out the actual size of a custom (or Foundation) object in terms of the bytes, in effect, allowing something like the following:

@interface SomeObject : NSObject {
	NSString *someString;
	NSData *someData;
	NSNumber *someNumber;
}

@end

To where if I did a [Sizer sizeOf:someObject]; it would return to me the number of bytes that the someObject would represent if you were to write it out to disk or the network (verbatim).

Obviously, sizeof() is out, but I'm wondering if there's any "straightforward" means of finding out the size on the stack that any given instantiated object is taking up, any runtime methods I can call, etc?


Cheers R. Tyler Ballance: Lead Mac Developer at bleep. software contact: email@hidden | jabber: email@hidden


_______________________________________________

Cocoa-dev mailing list (email@hidden)

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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden


Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.