我讨厌这样做
//in file.h
@property (strong) NSString *reuseIdentifier;
//in file.m
@synthesize reuseIdentifier = _reuseIdentifier;
这感觉太多余了。我在名称为“ reuseIdentifier”的属性和名称为“ _reuseIdentifier”的内存块之间有概念上的区别,但是为什么xcode IDE不能独自完成工作?
我感觉自己在做家务。
答案 0 :(得分:3)
自2012年Xcode 4.4起,就无需显式实现或综合Objective-C属性。请参见Xcode 4.4 section of the archived "What's New in Xcode" documentation:
Objective-C
@properties
在未明确实现时默认情况下进行合成。