Re: Xcode cross-developing to 10.1 and NSProgressIndicator (Modified by Justin Lundy)
Re: Xcode cross-developing to 10.1 and NSProgressIndicator (Modified by Justin Lundy)
- Subject: Re: Xcode cross-developing to 10.1 and NSProgressIndicator (Modified by Justin Lundy)
- From: Chris Espinosa <email@hidden>
- Date: Wed, 19 Nov 2003 15:55:09 -0800
On Nov 19, 2003, at 1:36 PM, j o a r wrote:
I got an app that I'm developing in Xcode, this app uses
NSProgressIndicators, specifically calling the setStyle method. I
set
the SDK to Mac OS X 10.1.5 and cleaned and compiled, and no problems.
I restarted in 10.1.5 and tried my app and it crashed with a console
error saying that NSProgressIndicator doesn't recognize setStyle
selector. But it compiled fine, so WTF? I go to the documentation
page for NSProgressIndicator, and low and behold, setStyle, along
with
several other methods, are 10.2+... Here are my questions:
1) Why didn't Xcode catch this?
Because it would have done exactly the same thing if you built it on
10.2.5. SDK support really only deals with runtime library binding,
and not with the dynamic message sending of Objective-C.
If I had built an appliction on Mac OS X 10.2 and used a selector that
only exists on Mac OS X 10.3, I would have received at least a
warning. Are you saying that if I do the same thing on Mac OS X 10.3,
in a project set to use the Mac OS X 10.2 SDK, I will not get a
warning? How useful is that? Why can't you provide the appropriate
warnings and errors for the selected SDK?
OK, my earlier answer was both too terse and had a typo.
The typo was that when I wrote "10.2.5" I meant "10.1.5".
The gist of my answer was that compiled Objective-C code can have
runtime errors when an invalid selector is passed to an object, even if
it linked correctly. SDK Support only deals with library-load-time
linking issues, and Obejctive-C method calls are message sends that
don't rely on linking.
That's useful because it enables dynamic extensions like categories at
runtime.
But none of that applies in this case; because SetStyles isn't defined
anywhere in the 10.1.5 SDK (or system headers) the original poster is
correct in that there should have at least been a compile error with
the undefined symbol. While we can't give a compile-time error if you
call an unhandled method on an object, we of course can if you call an
undefined one.
So I'd appreciate it if you can post the Detailed Build Results command
line that built the file in question, so I can debug better.
Chris
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.