djibouti33
djibouti33

Reputation: 12132

Warning: Function definition inside an Objective-C object is deprecated

After upgrading to Xcode 6.3, I'm now getting this warning:

Warning: Function definition inside an Objective-C object is deprecated

The warning is appearing in a category on NSString, where I've defined a UIKIT_STATIC_INLINE method.

Here's the offending code:

// NSString+Helpers.h
#import <Foundation/Foundation.h>

@interface NSString (Helpers)

+ (BOOL)exampleCategoryMethod;

UIKIT_STATIC_INLINE NSString *NSStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate) {
    return [NSString stringWithFormat:@"%f,%f", coordinate.latitude, coordinate.longitude];
}

@end

Upvotes: 1

Views: 1610

Answers (1)

djibouti33
djibouti33

Reputation: 12132

I simply had to move my static inline function definition outside of my @interface.

Here's the modified code:

// NSString+Helpers.h
#import <Foundation/Foundation.h>

UIKIT_STATIC_INLINE NSString *NSStringFromCLLocationCoordinate2D(CLLocationCoordinate2D coordinate) {
    return [NSString stringWithFormat:@"%f,%f", coordinate.latitude, coordinate.longitude];
}

@interface NSString (Helpers)

+ (BOOL)exampleCategoryMethod;

@end

Upvotes: 6

Related Questions