reason for getting NSFileHandle:writeData exception
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