• 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
Re: NSLogging a memory address
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

References: 
 >Re: NSLogging a memory address (From: "Dennis C.De Mars" <email@hidden>)

  • Prev by Date: Re: REPOST:What is the best way of printing an NSOutlineView?
  • Next by Date: WebKit and Flash
  • Previous by thread: Re: NSLogging a memory address
  • Next by thread: Re: NSLogging a memory address
  • Index(es):
    • Date
    • Thread