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

Re: reason for getting NSFileHandle:writeData exception


  • Subject: Re: reason for getting NSFileHandle:writeData exception
  • From: Chris Heimark <email@hidden>
  • Date: Tue, 10 Jul 2007 00:57:10 -0400

Sure seems like I have a trashed "outputFileHandle", doesn't it? Well, here is how I was creating the handle:

outputFileHandle = [NSFileHandle fileHandleForWritingAtPath: [savePanel filename]];

Then I tried a little bit of retention to keep it around!

outputFileHandle = [[NSFileHandle fileHandleForWritingAtPath: [savePanel filename]] retain];

And what do you know? IT WORKS NOW!!!

Perhaps you can provide some insight as to when retain/release is needed?

On Jul 9, 2007, at 8:15 PM, Brian Stern wrote:

And here is the code that runs in an NSTask callback occurring as a result of running an external command line program and trying to absorb the binary results using an NSData object.

>>>>>
	[outputFileHandle writeData:rngData];


The exception indicates that the code is trying to send the writeData message to an NSString. So outputFileHandle is an NSString, not a file handle. Perhaps you're not retaining the file handle correctly or you're accessing it from multiple threads incorrectly.


--
Brian Stern
email@hidden

_______________________________________________

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>
    • Re: reason for getting NSFileHandle:writeData exception
      • From: Andrew Farmer <email@hidden>
References: 
 >reason for getting NSFileHandle:writeData exception (From: Chris Heimark <email@hidden>)
 >Re: reason for getting NSFileHandle:writeData exception (From: Brian Stern <email@hidden>)
 >Re: reason for getting NSFileHandle:writeData exception (From: Chris Heimark <email@hidden>)
 >Re: reason for getting NSFileHandle:writeData exception (From: Brian Stern <email@hidden>)

  • Prev by Date: Re: Languages supported by OS X?
  • Next by Date: Re: reason for getting NSFileHandle:writeData exception
  • Previous by thread: Re: reason for getting NSFileHandle:writeData exception
  • Next by thread: Re: reason for getting NSFileHandle:writeData exception
  • Index(es):
    • Date
    • Thread