Here is a followup. I have taken a few suggestions to no effect yet. I found 
something suggestive, however. If I preprocess the offending file, the 
preprocessor output has the line...

@interface NSObject(NSTableViewDelegate)

which proves that a pre-10.6 version of NSTableView.h was really included. Both 
my root SDK and deployment SDK are set to 10.6, and the version of the header 
file that shows in the Frameworks section in the Xcode project is the 10.6 
version. I've been checking other settings but nothing is suspicious yet. Now 
I'm starting to wonder whether there may be a precompiling issue. I've cleaned 
the project and its static libraries with the option to rebuild the precompiled 
headers to no effect. I've tried all versions of the compiler with no effect. 
I'm running Xcode 3.2.4. 

Here is something else interesting. Based on a suggestion I created an empty 
Cocoa app and added the NSTableViewDelegate protocol to the application 
delegate's interface, and everything was fine; that is, the proper 10.6 version 
of NSTableView.h got included. So there MUST be something esoteric and wrong 
about my target build settings. This result changes from a Cocoa issue to an 
Xcode one. I may re-summarize and post there if I can't find the problem. Any 
other suggestion gratefully welcome.

Tom Wetmore

On Nov 5, 2010, at 12:48 AM, Thomas Wetmore wrote:

> I've been staring at this error message for the past hour.
> 
> When trying to compile the code ...
> 
> -------------------------------------
> #import <Cocoa/Cocoa.h>
> 
> @interface TWInterpreterController : NSWindowController <NSTableViewDelegate>
> ...
> @end
> --------------------------------------
> 
> the compiler issues the error:
> 
> "Cannot find protocol declaration for 'NSTableViewDelegate'"
> 
> The import of Cocoa/Cocoa.h causes the import of AppKit/NSTableView.h which 
> contains the protocol definition of NSTableViewDelegate, so I fail to see 
> what's happening here. Googling the error message leads to the advice that 
> all circular/recursive import/include loops be avoided, but I fail to see how 
> one could be happening here.
> 
> In versions of NSTableView.h before 10.6 the delegate was not defined as a 
> protocol but as a category on NSObject, so if an older version of the header 
> file were being imported I could understand the message.
> 
> But I'm assuming the NSTableView.h that is being imported must be the one 
> that I see when I check under the header files under the Frameworks tab in 
> the Xcode Groups&Files navigator. I do see the older version of NSTableView.h 
> that define the delegate in a category in the directory:
> 
> /Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/AppKit.framework/Versions/C/Headers/NSTableView.h
> 
> But I'm building with the 10.6 SDK. Is there some mechanism that might be 
> causing the older NSTableView.h to nevertheless get imported? 
> 
> Thanks,
> Tom Wetmore_______________________________________________
> 
> Cocoa-dev mailing list ([email protected])
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/ttw4%40verizon.net
> 
> This email sent to [email protected]

_______________________________________________

Cocoa-dev mailing list ([email protected])

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to