如果我在我的.h文件中的以下內容:ARC中@property聲明的默認選項是什麼?
@property UIButton *connect;
這是一樣的:
@property(atomic, strong) UIButton *connect;
例如什麼因素在@property聲明中默認的「論據」?
如果我在我的.h文件中的以下內容:ARC中@property聲明的默認選項是什麼?
@property UIButton *connect;
這是一樣的:
@property(atomic, strong) UIButton *connect;
例如什麼因素在@property聲明中默認的「論據」?
根據文檔,屬性默認爲atomic
和strong
。
Properties are Atomic by Default
Use Strong and Weak Declarations to Manage Ownership - 參見下句。
強和原子是在財產申報默認選項看到此鏈接:link
是。 atomic
和strong
是默認屬性。這似乎在文檔被傳播出去,雖然花了超過我以爲找到:
你也可以看看這裏:http://stackoverflow.com/questions/15362157/why-are-cocoas-iboutlet-properties-atomic-by-default-and-cocoa-touchs- arent/15362414#15362414 – 2013-03-20 04:21:46