• 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: NSLog format
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog format


  • Subject: Re: NSLog format
  • From: Alex Rice <email@hidden>
  • Date: Sat, 1 Feb 2003 18:04:39 -0700

On Saturday, February 1, 2003, at 05:47 PM, Denis Stanton wrote:

NSString *myLabel = [(Block *)[blocks objectAtIndex: index]
lab];
NSLog( myLabel );

This does nothing. No line is produced.

If I remember correctly, Java will cast anything to a string for you. Objective-C behaves a little differently. I've gotten into the habit of doing this:

NSLog(@"blah blah = %@", someObj);

What happens with this syntax is while formatting the NSString, it will call [someObj description] and put that into the message in place of %@.


Alex Rice <email@hidden> | Mindlube Software | http://mindlube.com

what a waste of thumbs that are opposable
to make machines that are disposable -Ani DiFranco
_______________________________________________
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.

  • Follow-Ups:
    • Re: NSLog format
      • From: Denis Stanton <email@hidden>
References: 
 >NSLog format (From: Denis Stanton <email@hidden>)

  • Prev by Date: NSLog format
  • Next by Date: Re: Oddness with PB
  • Previous by thread: NSLog format
  • Next by thread: Re: NSLog format
  • Index(es):
    • Date
    • Thread