• 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: Andrew Farmer <email@hidden>
  • Date: Mon, 9 Jul 2007 22:09:32 -0700

On 09 Jul 07, at 21:57, Chris Heimark wrote:
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?

Read this:

http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/ Tasks/MemoryManagementRules.html

The selector 'fileHandleForWritingAtPath' doesn't contain the words 'alloc', 'new', or 'copy', so the object it returns is autoreleased.
_______________________________________________


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


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

  • Prev by Date: Re: reason for getting NSFileHandle:writeData exception
  • Next by Date: sendin mail with attachments
  • Previous by thread: Re: reason for getting NSFileHandle:writeData exception
  • Next by thread: Re: reason for getting NSFileHandle:writeData exception
  • Index(es):
    • Date
    • Thread