• 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
stringWithContentsOfURL: usedEncoding: error:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

stringWithContentsOfURL: usedEncoding: error:


  • Subject: stringWithContentsOfURL: usedEncoding: error:
  • From: Greg Stark <email@hidden>
  • Date: Mon, 5 Jun 2006 20:11:36 -0600

I'm trying to open a simple text file, and when I try to use stringWithContentsOfURL: usedEncoding: error:, I get an error that "The file could not be opened using the specified text encoding" which is a little confusing in that I thought it was the method's job to determine the encoding. If I use just stringWithContentsOfURL, the file opens without problem. The code that I'm using is below:

NSStringEncoding *enc;
NSError *error;
NSString *test = [NSString stringWithContentsOfURL:[URLsToOpen objectAtIndex:0]
usedEncoding:&enc
error:&error];

I'm I doing something wrong, or is there a problem with this method?


Thanks,
Greg
_______________________________________________
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


  • Follow-Ups:
    • Re: stringWithContentsOfURL: usedEncoding: error:
      • From: Andy Lee <email@hidden>
  • Prev by Date: multiple document windows
  • Next by Date: Re: stringWithContentsOfURL: usedEncoding: error:
  • Previous by thread: multiple document windows
  • Next by thread: Re: stringWithContentsOfURL: usedEncoding: error:
  • Index(es):
    • Date
    • Thread