• 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: NSString and control character
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSString and control character


  • Subject: Re: NSString and control character
  • From: Ondra Cada <email@hidden>
  • Date: Fri, 27 Sep 2002 01:14:02 +0200

On Thursday, September 26, 2002, at 04:54 , Seungoh Ryu wrote:

Does anyone know how to force control characters into an NSString without complicated substitution?

Just like in plain C: all the standard escapes work.

To be specific, I have a NSTextField in which user writes some TeX commands, such as :

\documentstyle[12pt]
\pagestyle{empty}
etc....

Now, when I load them into an NSString, all the '\' characters cause trouble as
most of them are interpreted as control characters, especially \p .

Like, \\ for a backslash.

How can I turn the long TeX file into an NSString with all the \ commands in tact
without a major hassle ?

Nevertheless, I think in this case what you really want is to place the text into a file, to put the file into the app's resources, and to read it in using -stringWithContentsOfFile:.
---
Ondra Cada
OCSoftware: email@hidden http://www.ocs.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.
References: 
 >NSString and control character (From: Seungoh Ryu <email@hidden>)

  • Prev by Date: Re: Menu when click on table cell
  • Next by Date: Re: nil messaging? Is it safe?
  • Previous by thread: Re: NSString and control character
  • Next by thread: NSSocketPortNameServer problem
  • Index(es):
    • Date
    • Thread