On Jun 4, 2009, at 9:03 PM, cocoa learner wrote:
How can I use mlock() for NSString and NSTextField?
As argument to mlock is address of memory area and length.
I have address of memory area but I do not have the length (as these are objects).

class_getInstanceSize() will tell you how big an instance of NSString or NSTextField is. But the data you're trying to protect won't necessarily be inside that range. For example, NSString often uses another allocation internally to hold the string data, and you have no way to know where that is.


--
Greg Parker     gpar...@apple.com     Runtime Wrangler


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to