• 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
True object size
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

True object size


  • Subject: True object size
  • From: "R. Tyler Ballance" <email@hidden>
  • Date: Thu, 15 Mar 2007 22:06:19 -0500

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:
This email sent to email@hidden


  • Follow-Ups:
    • Re: True object size
      • From: Ali Ozer <email@hidden>
  • Prev by Date: Re: Calling cocoa app from command line
  • Next by Date: Re: True object size
  • Previous by thread: NSTokenField binding its way to a bunch o' NSManagedObjects ... ??
  • Next by thread: Re: True object size
  • Index(es):
    • Date
    • Thread