• 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
reason for getting NSFileHandle:writeData exception
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

reason for getting NSFileHandle:writeData exception


  • Subject: reason for getting NSFileHandle:writeData exception
  • From: Chris Heimark <email@hidden>
  • Date: Mon, 9 Jul 2007 16:23:24 -0400

I am getting a nasty little exception:

2007-07-09 16:18:41.294 DisplayData[4441] *** -[NSCFString bytes]: selector not recognized [self = 0x2e02c]

In response to the following snippet of code:

if (returnCode == NSOKButton)
{
if ([[NSFileManager defaultManager] createFileAtPath:[savePanel filename] contents:nil attributes:nil]==YES)
{
[filePathText setStringValue:[savePanel filename]];
outputFileHandle = [NSFileHandle fileHandleForWritingAtPath: [savePanel filename]];
// this next line causes exception on entry
[outputFileHandle writeData:@"Please stop biting me!\r"];
// never get her


}
}

I get no compile errors. The file in question is created but ends up being 0 bytes. The snippet lies in the context of the save panel callback I have setup. Any suggestions as to where I am straying from the straight and narrow?
_______________________________________________


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: reason for getting NSFileHandle:writeData exception
      • From: Brian Stern <email@hidden>
  • Prev by Date: Re: NSView drawing optimization question
  • Next by Date: Re: reason for getting NSFileHandle:writeData exception
  • Previous by thread: Re: NSView drawing optimization question
  • Next by thread: Re: reason for getting NSFileHandle:writeData exception
  • Index(es):
    • Date
    • Thread