小编GRi*_*e2D的帖子

Xcode 8,禁用类级别属性

在Xcode 8中,Objective-C略有改变.现在有类级属性.例如,NSBundle的标头

@interface NSBundle : NSObject {
...

/* Methods for creating or retrieving bundle instances. */
#if FOUNDATION_SWIFT_SDK_EPOCH_AT_LEAST(8)
@property (class, readonly, strong) NSBundle *mainBundle;
#endif

+ (nullable instancetype)bundleWithPath:(NSString *)path;
- (nullable instancetype)initWithPath:(NSString *)path NS_DESIGNATED_INITIALIZER;

+ (nullable instancetype)bundleWithURL:(NSURL *)url NS_AVAILABLE(10_6, 4_0);
- (nullable instancetype)initWithURL:(NSURL *)url NS_AVAILABLE(10_6, 4_0);

+ (NSBundle *)bundleForClass:(Class)aClass;
+ (nullable NSBundle *)bundleWithIdentifier:(NSString *)identifier;

#if FOUNDATION_SWIFT_SDK_EPOCH_AT_LEAST(8)
@property (class, readonly, copy) NSArray<NSBundle *> *allBundles;
@property (class, readonly, copy) NSArray<NSBundle *> *allFrameworks;
#endif
...
Run Code Online (Sandbox Code Playgroud)

看看,主要包.现在它被声明为property但是带有class关键字.我认为它代表着class level …

xcode objective-c appcode xcode8

2
推荐指数
1
解决办法
1039
查看次数

标签 统计

appcode ×1

objective-c ×1

xcode ×1

xcode8 ×1