Re: Text file

2010-04-19 Thread Henrietta Read
That's a good idea, thank you! :) On Sun, Apr 18, 2010 at 12:41 PM, Jens Alfke wrote: > > On Apr 18, 2010, at 12:40 AM, Henrietta Read wrote: > > > exactly the point germane, but in perusing NSString.h one is given to > understand this method might not be as 'smart' as one could wish: > > I w

Re: Text file

2010-04-18 Thread Jens Alfke
On Apr 18, 2010, at 12:40 AM, Henrietta Read wrote: > exactly the point germane, but in perusing NSString.h one is given to > understand this method might not be as 'smart' as one could wish: I wouldn’t think it would fail with MacRoman, though. Did you check the output NSError? Also, try insp

Re: Text file

2010-04-18 Thread Raffael Cavallaro
On Apr 18, 2010, at 3:40 AM, Henrietta Read wrote: >>> >>> This leaves the question of why -stringWithContentsOfFile: would fail. > I'm not sure what heuristics that call uses, but you'd think it would be > able to handle MacRoman, obsolete though it is. In general, it is. For example, I just c

Re: Text file

2010-04-18 Thread Henrietta Read
>> The call to -stringWithContentsOfFile: looks correct, but you're failing to check for errors. If it fails, it will return nil, and passing nil to setString: is illegal and will throw an exception. right, right... most correct. I can catch the nil. >> This leaves the question of why -stringWith

Re: Text file

2010-04-15 Thread vincent habchi
Hi, > 0x91dc507e <+0334> call 0x91e68a50 > 0x91dc5083 <+0339> mov%esi,(%esp) > 0x91dc5086 <+0342> call 0x91ebf566 > 0x91dc508b <+0347> lea-0x80(%ebp),%esi > 0x91dc508e <+0350> mov%esi,(%esp) > 0x91dc5091 <+0353> call 0x91ebfb36 > 0x91dc5096 <+0358> mov%esi,(%

Re: Text file

2010-04-15 Thread Bill Bumgarner
On Apr 15, 2010, at 8:50 AM, Henrietta Read wrote: > What's the correct way to open a text file? I'm using: > > NSError *error = nil; > NSStringEncoding encoding; > > [myMutableString setString:[NSString stringWithContentsOfFile:filePath > usedEncoding:&encoding error:&error]]; > > but o

Re: Text file

2010-04-15 Thread Jens Alfke
On Apr 15, 2010, at 8:50 AM, Henrietta Read wrote: NSError *error = nil; NSStringEncoding encoding; [myMutableString setString:[NSString stringWithContentsOfFile:filePath usedEncoding:&encoding error:&error]]; The call to -stringWithContentsOfFile: looks correct, but you're failin