From 9fb182bd7966f0679a2458e89a3d0114a47145dc Mon Sep 17 00:00:00 2001 From: Jimmy Dee Date: Wed, 2 Apr 2014 16:05:07 -0700 Subject: [PATCH] Suppress a deprecation warning. --- IOSKnobControl.h | 2 +- IOSKnobControl.m | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/IOSKnobControl.h b/IOSKnobControl.h index 96dce7e..3f1b27d 100644 --- a/IOSKnobControl.h +++ b/IOSKnobControl.h @@ -6,7 +6,7 @@ #define IKC_VERSION_STRING @"1.1.0" #define IKC_VERSION 0x010100 -#define IKC_BUILD 1 +#define IKC_BUILD 2 /** * @mainpage iOS Knob Control diff --git a/IOSKnobControl.m b/IOSKnobControl.m index ea51784..b538105 100644 --- a/IOSKnobControl.m +++ b/IOSKnobControl.m @@ -23,7 +23,7 @@ // Must match IKC_VERSION and IKC_BUILD from IOSKnobControl.h. #define IKC_TARGET_VERSION 0x010100 -#define IKC_TARGET_BUILD 1 +#define IKC_TARGET_BUILD 2 /* * DEBT: Should also do a runtime check in the constructors in case the control is ever built @@ -40,6 +40,10 @@ static float normalizePosition(float position) { return position; } +@protocol NSStringDeprecatedMethods +- (CGSize) sizeWithFont:(UIFont*)font; +@end + @interface NSString(IKC) - (CGSize)sizeOfTextWithFontSize:(CGFloat)fontSize; @end @@ -62,7 +66,9 @@ - (CGSize)sizeOfTextWithFontSize:(CGFloat)fontSize } else { // iOS 5 & 6 - textSize = [self sizeWithFont:font]; + // following http://vgable.com/blog/2009/06/15/ignoring-just-one-deprecated-warning/ + id string = (id)self; + textSize = [string sizeWithFont:font]; } return textSize; }