• 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 to a file?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSLog to a file?


  • Subject: Re: NSLog to a file?
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 3 May 2002 13:53:21 +0200

On Friday, May 3, 2002, at 08:12 , Angela Brett wrote:

I have read a bit about writing functions with variable numbers of arguments but I don't know how to just pass all the arguments into a method like stringWithFormat:.

Actually, I think too that redirecting the tool output is the proper solution of what you need. If you insisted though -- or in a different situation -- it is quite easy:

void MyLog(NSString *format,...) {
va_list a;
NSString *s;

va_start(a,format);
s=[[[NSString alloc] initWithFormat:format arguments:a] autorelease];
va_end(a);
... whatever with s ...
}
---
Ondra Hada
OCSoftware: email@hidden http://www.ocs.cz
2K Development: email@hidden http://www.2kdevelopment.cz
private email@hidden http://www.ocs.cz/oc
_______________________________________________
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 to a file?
      • From: Angela Brett <email@hidden>
References: 
 >NSLog to a file? (From: Angela Brett <email@hidden>)

  • Prev by Date: Other Word breaks ?
  • Next by Date: Cocoa and Applescript
  • Previous by thread: Re: NSLog to a file?
  • Next by thread: Re: NSLog to a file?
  • Index(es):
    • Date
    • Thread