• 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: printf with "%@"
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: printf with "%@"


  • Subject: Re: printf with "%@"
  • From: Joseph Kelly <email@hidden>
  • Date: Fri, 11 Aug 2006 11:41:35 -0500

Write your own printf that takes variable arguments, and pass it to NSString - (id)initWithFormat:(NSString *)format arguments:(va_list)argList, and then prtintf  -cStringUsingEncoding.

If you've never used variable argument lists, then refer to K&R.

joe



On Friday, August 11, 2006, at 11:27AM, Roland Silver <email@hidden> wrote:

>Yes, that'll work (but the method cString is deprecated in favor of
>cStringUsingEncoding: ).
>
>That takes care of the example I gave, but not the general case where
>one wants a format that includes "%@".
>
>On Aug 11, 2006, at 10:19 AM, Dirk Stegemann wrote:
>
>> Ok; then you'll probably want to try something like this:
>>
>> printf("sender = %s \n", [[sender description] cString]);
>>
>
>
> _______________________________________________
>Do not post admin requests to the list. They will be ignored.
>Cocoa-dev mailing list      (email@hidden)
>Help/Unsubscribe/Update your Subscription:
>
>This email sent to email@hidden
>
>


----
Joseph V. Kelly
email@hidden
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >printf with "%@" (From: Roland Silver <email@hidden>)
 >Re: printf with "%@" (From: Dirk Stegemann <email@hidden>)
 >Re: printf with "%@" (From: Roland Silver <email@hidden>)
 >Re: printf with "%@" (From: Dirk Stegemann <email@hidden>)
 >Re: printf with "%@" (From: Roland Silver <email@hidden>)

  • Prev by Date: Re: printf with "%@"
  • Next by Date: Re: Two views
  • Previous by thread: Re: printf with "%@"
  • Next by thread: Re: printf with "%@"
  • Index(es):
    • Date
    • Thread