Re: How to get warnings for missing methods in older SDKs
Re: How to get warnings for missing methods in older SDKs
- Subject: Re: How to get warnings for missing methods in older SDKs
- From: Sherm Pendley <email@hidden>
- Date: Sun, 27 Mar 2011 12:17:28 -0400
On Sun, Mar 27, 2011 at 8:12 AM, Alexander von Below <email@hidden> wrote:
>
> Am 27.03.2011 um 13:21 schrieb Christiaan Hofman:
>
>> I am not saying that it would not be nice to know whether you've used new API in an unsafe manner, but I see no way how the compiler can know about that, and therefore warn about it. I don't want to have loads of warnings about correct use of API.
>
> Easy:
>
> NS_CLASS_AVAILABLE(NA, 4_0)
> @interface CLRegion : NSObject <NSCopying, NSCoding>
> {
> ...
> }
>
> - (id)initCircularRegionWithCenter:(CLLocationCoordinate2D)center
> radius:(CLLocationDistance)radius
> identifier:(NSString *)identifier __OSX_AVAILABLE_STARTING(__MAC_NA,__IPHONE_4_0);
>
>
> etc.
>
> The SDK has absolutely clear, machine readable hints about when something is available.
Yes! Such warnings could be silenced by wrapping such methods in a "if
([target respondsToSelector:...])" block, where the checked selector
has the same availability.
sherm--
--
Cocoa programming in Perl:
http://camelbones.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden