Mailing Lists: Apple Mailing Lists

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

Re: NSLogging a memory address



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.

References: 
 >Re: NSLogging a memory address (From: "Dennis C.De Mars" <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.