• 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: Stuffing a NSMutableString with formatted C text
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Stuffing a NSMutableString with formatted C text


  • Subject: Re: Stuffing a NSMutableString with formatted C text
  • From: Pontus Ilbring <email@hidden>
  • Date: Tue, 8 Mar 2005 20:04:27 +0100


On 2005-03-08, at 19.37, Frederick C. Lee wrote:

Greetings:
	I'm trying to incorporate some C code into Objective-C.

The following is  a snippet of what I'm trying to harvest:

		printf(".11s: %.*s\n", dbf->field_name,
			   dbf->field_length, value);

The output is 'standard output'. I need the output to go to a <string/char *> variable, preferably NSString or NSMutableString; NOT to a file or screen.

I can't find the appropriate C routine to merely direct it to a char * output (vs the screen/file) so I can read it into a NSString variable.

asprintf and snprintf can do that.

Or you could try NSString's stringWithFormat: directly.

Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: 
 >Stuffing a NSMutableString with formatted C text (From: "Frederick C. Lee" <email@hidden>)

  • Prev by Date: Stuffing a NSMutableString with formatted C text
  • Next by Date: Re: WebKit not there
  • Previous by thread: Stuffing a NSMutableString with formatted C text
  • Next by thread: Enabling certain menus while in modal dialog
  • Index(es):
    • Date
    • Thread