• 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: reading a text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading a text file


  • Subject: Re: reading a text file
  • From: Hasan Diwan <email@hidden>
  • Date: Sun, 18 May 2003 09:39:55 -0700

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

NSString * s = [[[NSString alloc] initWithData:yourData encoding:NSMacOSRomanStringEncoding] autorelease];
That's how I'd get an NSData to NSString.
On Sunday, May 18, 2003, at 09:17 US/Pacific, Marc Weil wrote:

NSString *newString = [NSString stringWithCString: [yourData bytes]];

That would be the way to convert an NSData object to an NSString object.

-- Marc Weil


On 5/17/03 9:47 PM, "Paul N. Schatz" <email@hidden> wrote:

As part of a Cocoa program, I need to read a BBEdit file into
a text field or string. Using 'contentsAtPath:', I get an NSData
file of bytes, but I can't seem to subsequently convert that to text.
Is there a way to do that, or is there a better way to do the whole
thing?

Paul
_______________________________________________
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.

Hasan Diwan {http://ibn.com/~hdiwan}
OpenPGP Fingerprint: 275D 0E84 550C D92A 4A56 732C 8528 2579 E6E9 4842
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (Darwin)

iD8DBQE+x7dihSgleebpSEIRAmGFAJsFCYW8+ttYjLulUfMEfLf7+lbGlwCffxsw
UBiTj6b+aSm30dv4Fp6W4C0=
=+jxg
-----END PGP SIGNATURE-----
_______________________________________________
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: 
 >Re: reading a text file (From: Marc Weil <email@hidden>)

  • Prev by Date: Re: reading a text file
  • Next by Date: remove shadows on drawers?
  • Previous by thread: Re: reading a text file
  • Next by thread: Re: reading a text file
  • Index(es):
    • Date
    • Thread