• 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: help with closing file handle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: help with closing file handle


  • Subject: Re: help with closing file handle
  • From: Daniel Luis dos Santos <email@hidden>
  • Date: Sat, 9 Feb 2008 12:14:25 +0000

Hello, again.

I have found the solution to the problem. It seems that I have to pass a mutable string with the path to the file handle's factory method. Looking back at the output of the error, now it seems pretty obvious. My worry now is that I am new to the macos development environment, and I am programming while looking at the documentation I have installed in my machine. I have tiger, but upgraded to xcode 2.5 from the version supplied with OSX. The documentation for the NSFileHandle class shows me in its signature an NSString as its argument.
Is this common in apple API's or am I looking at the wrong document's ?



On Feb 8, 2008, at 4:15 PM, Kyle Sluder wrote:

On Feb 8, 2008 8:06 AM, Daniel Luis dos Santos <email@hidden> wrote:
When I run it, while stepping through the closing of the file handle,
the gdb window shows the
error :

2008-02-08 11:56:09.166 TesterBundleDebugger[408] *** -[NSCFArray
appendString:]: selector not recognized [self = 0x30a9a0]
2008-02-08 11:56:09.167 TesterBundleDebugger[408] *** Uncaught
exception: <NSInvalidArgumentException> *** -[NSCFArray
appendString:]: selector not recognized [self = 0x30a9a0]

I don't understand what is happening.

We're going to think through this like programmers, so that maybe you can nail bugs like this yourself in the future.

Read carefully: something's trying to send -appendString: to an
NSArray (NSCFArray is the name of the real, concrete toll-free-bridged
subclass of NSArray that we all use unknowingly).  -[NSFileHandle
closeFile] is the method causing the problem, and we can safely assume
that the implementation of NSFileHandle is correct.  The only thing
you're provided to it is the NSString you received as the first
argument to -useArchive:.  -appendString: is indeed defined on
NSMutableString.

Seems like we've found a likely cause of the issue: the NSString
you're getting and giving to NSFileHandle is really an NSCFArray;
whoever called -useArchive: screwed up.  There should have been a
warning generated about "distinct Objective-C types".  If you haven't
already, turn on "treat warnings as errors" in your project settings.

--Kyle Sluder

_______________________________________________

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: help with closing file handle
      • From: Uli Kusterer <email@hidden>
    • Re: help with closing file handle
      • From: Nir Soffer <email@hidden>
References: 
 >help with closing file handle (From: Daniel Luis dos Santos <email@hidden>)
 >Re: help with closing file handle (From: "Kyle Sluder" <email@hidden>)

  • Prev by Date: Re: How to use CAMediaTiming's beginTime?
  • Next by Date: Show Image above Keynote presentation
  • Previous by thread: Re: help with closing file handle
  • Next by thread: Re: help with closing file handle
  • Index(es):
    • Date
    • Thread