Re: NSLogging a memory address
Re: NSLogging a memory address
- Subject: Re: NSLogging a memory address
- From: "Alastair J.Houghton" <email@hidden>
- Date: Thu, 17 Jul 2003 13:17:57 +0100
On Thursday, July 17, 2003, at 05:43 am, Dennis C.De Mars wrote:
Ok, but wouldn't
NSLog(@"%@<%x>", object, object);
also work?
Indeed. The original &object was the address of the address of the
object, rather than the address of the object.
BTW, it'd be a *very* good idea to use "%p" instead of "%x", since that
will make your application portable to a 64-bit address space when
Apple get around to defining the ABI for 64-bit apps on the G5. If you
use "%x" for a pointer, you're quite likely to break (if Apple chooses
the LP64 model that most people are expecting)... "%lx" will probably
work, but better to use "%p" as that is what it's there for.
Kind regards,
Alastair.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.