• 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
Text file
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Text file


  • Subject: Text file
  • From: Henrietta Read <email@hidden>
  • Date: Thu, 15 Apr 2010 08:50:46 -0700

Hi,

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 on some files (say, Western Mac OS Roman) it crashes.


0x91dc507e  <+0334>  call   0x91e68a50 <CFLog>
0x91dc5083  <+0339>  mov    %esi,(%esp)
0x91dc5086  <+0342>  call   0x91ebf566 <dyld_stub_OSSpinLockUnlock>
0x91dc508b  <+0347>  lea    -0x80(ëp),%esi
0x91dc508e  <+0350>  mov    %esi,(%esp)
0x91dc5091  <+0353>  call   0x91ebfb36 <dyld_stub_objc_exception_try_enter>
0x91dc5096  <+0358>  mov    %esi,(%esp)
0x91dc5099  <+0361>  call   0x91ebf61a <dyld_stub__setjmp>
> 0x91dc509e  <+0366>  test   êx,êx
0x91dc50a0  <+0368>  jne    0x91dc535a <CFRunLoopRunSpecific+1066>
0x91dc50a6  <+0374>  mov    -0x1c(ëp),êx
0x91dc50a9  <+0377>  testb  $0x1,0x2c(êx)
0x91dc50ad  <+0381>  jne    0x91dc50b9 <CFRunLoopRunSpecific+393>
0x91dc50af  <+0383>  mov    -0x1c(ëp),êx
0x91dc50b2  <+0386>  mov    0x24(êx),êx
0x91dc50b5  <+0389>  test   êx,êx
0x91dc50b7  <+0391>  je     0x91dc50c9 <CFRunLoopRunSpecific+409>
0x91dc50b9  <+0393>  mov    -0x1c(ëp),íx
0x91dc50bc  <+0396>  mov    0x8(ëp),êx
0x91dc50bf  <+0399>  mov    $0x1,ìx
0x91dc50c4  <+0404>  call   0x91e08e40 <__CFRunLoopDoObservers>

Any ideas?
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Text file
      • From: vincent habchi <email@hidden>
    • Re: Text file
      • From: Bill Bumgarner <email@hidden>
    • Re: Text file
      • From: Jens Alfke <email@hidden>
  • Prev by Date: Display AppleScript dictionary browser
  • Next by Date: Help with crash in -[NSKeyValueNestedProperty matchesWithoutOperatorComponentsKeyPath:]
  • Previous by thread: Display AppleScript dictionary browser
  • Next by thread: Re: Text file
  • Index(es):
    • Date
    • Thread