Re: NSToolTipOwner Protocol and Xcode 3.2 build failure in Debug Build Configuration
Re: NSToolTipOwner Protocol and Xcode 3.2 build failure in Debug Build Configuration
- Subject: Re: NSToolTipOwner Protocol and Xcode 3.2 build failure in Debug Build Configuration
- From: Claudio Wilmanns <email@hidden>
- Date: Thu, 17 Sep 2009 00:52:32 +0200
Thank you Randall, the problem is now solved.
Regards
- Claudio
Am 16.09.2009 um 20:56 schrieb Randall Meadows:
On Sep 16, 2009, at 1:33 AM, Claudio Wilmanns wrote:
In my application, I create ToolTipRectangles.
I need to display a custom tooltip (as the object does not have an
own -description: method), so I override the following method of
the NSToolTipOwner Protocol declared in NSView.h:
- (NSString *)view:(NSView *)view stringForToolTip:
(NSToolTipTag)tag point:(NSPoint)point userData:(void *)data;
My implementation looks like this:
- (NSString *)view:(NSView *)view stringForToolTip:
(NSToolTipTag)tag point:(NSPoint)point userData:(NSString*)userData {
NSString* string = [NSString string];
if ([userData isEqual:@"myData"]) {
string = [NSString stringWithFormat:@"Patch count: %d",
count]; // count is an integer instance variable in the calling class
}
return string;
}
Using Xcode 3.2 I constantly get these two **errors** (in Debug
Build Configuration) or **warnings** (in Release Build
Configuration):
1) /.../PlotController.m:239: warning: conflicting types for '-
(NSString *)view:(NSView *)view stringForToolTip:(NSToolTipTag)tag
point:(NSPoint)point userData:(NSString *)userData'
2) /Developer/SDKs/MacOSX10.5.sdk/.../NSView.h:343: warning:
previous declaration of '-(NSString *)view:(NSView *)view
stringForToolTip:(NSToolTipTag)tag point:(NSPoint)point userData:
(void *)data'
Maybe you should make your implementation signature match the
prototype (note the difference between the types of the last
argument).
The error in the Debug Build Configuration leads to an interruption
of the build process, hence I cannot debug my application, **this
is my main problem!!!**.
Actually, you're main problem is your code doesn’t match the
prototype; inability to build and/or debug is merely a symptom.
The warning in the Release Build Configuration however leads to a
properly built application. After running the application, the
expected behavior works well, no issues at all.
Sounds like a difference in compiler settings between the two
configurations. This, however, is not the problem though.
Using Xcode 3.1.3 (and Leopard 10.5.8), there is nor an error
neither a warning in both, Debug and Release mode. Everything works
fine.
The compiler used by Xcode 3.2 is stricter than previous versions.
_______________________________________________
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