On 8 Mar 2012, at 14:54, Howard Moon wrote: > On Mar 8, 2012, at 6:21 AM, Mike Abdullah wrote: >>> >>> I'm really not that familiar with Objective-C and Cocoa yet, but I'm >>> getting a warning for something that works fine, and I hate warnings. The >>> warning is: >>> >>> 'NSOpenPanel' may not respond to '-setDirectoryURL:' >>> >>> I know that setDirectoryURL: is an NSSavePanel message, but NSOpenPanel >>> derives from NSSavePanel, so why does it give me this warning? As I said, >>> it works fine (i.e., the open panel starts out in the folder I specified). >>> Is there a case where it WON'T work? If not, then is there a way to >>> prevent the warning? >> >> That method was introduced in 10.6. Are you perhaps building against the >> 10.5 SDK or even earlier? >> > > Ah, yes, that's it. But I do need to support 10.5. What can I use that > works in 10.5 thru 10.7?
Options: A) Bump the SDK setting to 10.6, keeping the deployment target at 10.5. Don't call any 10.6-only methods when running on 10.5. (i.e. check -respondsToSelector: or similar) B) Declare the new methods as categories in headers, but don't actually implement the methods. That will tell the compiler how to call those new methods. Once again, don't call 10.6-only methods while running on 10.5 C) Fallback to older, deprecated APIs. e.g. -directory _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com