• 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: Writing Strings to a file and "special" strings.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Writing Strings to a file and "special" strings.


  • Subject: Re: Writing Strings to a file and "special" strings.
  • From: Jonathan Jackel <email@hidden>
  • Date: Sun, 03 Nov 2002 20:33:33 -0500

on 11/3/02 12:50 PM, Jerry LeVan at email@hidden wrote:

> Do @"\t", @"\r" and @"\n" do the right thing when written to an "ascii"
> file.
>

Yes. As do the other C escape characters. (There's generally no harm in
trying something like this out to see if it works.)

> Is there an elegant way to write my giant array with say, my field elements
> separated by @"\t" and each "line" terminated by @"\n" or @"\r" into an
> ascii file?

[NSArray componentsJoinedByString:separator] returns a concatenated string.

>
> Does anyone know why if a textField contains a\bc then NSLog will print the
> backslash character four times ie
>
> NSLog(@"result=%@", [textField stringValue]) will print a\\\\b ?
>

Two backslashes is the C escape character for a backslash. There's a bug in
NSLog that prints it out with four backslashes. See the archives:

http://cocoa.mamasam.com/COCOADEV/2002/08/2/42729.php

Jonathan
_______________________________________________
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: 
 >Writing Strings to a file and "special" strings. (From: Jerry LeVan <email@hidden>)

  • Prev by Date: Re: MVC and thread-safety
  • Next by Date: NSApplescript
  • Previous by thread: Writing Strings to a file and "special" strings.
  • Next by thread: I want a scrollbar
  • Index(es):
    • Date
    • Thread