Re: help with closing file handle
Re: help with closing file handle
- Subject: Re: help with closing file handle
- From: "Kyle Sluder" <email@hidden>
- Date: Fri, 8 Feb 2008 11:15:26 -0500
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