2013-03-20 63 views
0

如果我在我的.h文件中的以下內容:ARC中@property聲明的默認選項是什麼?

@property UIButton *connect; 

這是一樣的:

@property(atomic, strong) UIButton *connect; 

例如什麼因素在@property聲明中默認的「論據」?

+0

你也可以看看這裏: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

回答

2

根據文檔,屬性默認爲atomicstrong

Properties are Atomic by Default

Use Strong and Weak Declarations to Manage Ownership - 參見下句。

+0

非常感謝。我目前正在教授iOS開發,並且認爲僅僅在沒有「參數」的情況下教授@property方法會更容易 - 只是想確保它們是合理的默認值。 – Chris 2013-03-20 04:04:48

+0

查看我的更新鏈接。 – rmaddy 2013-03-20 04:05:44

+0

@Downvoter - 爲什麼投票?該問題通過文檔鏈接正確回答。 – rmaddy 2013-03-20 04:08:15

2

原子是在財產申報默認選項看到此鏈接:link

1

通過默認屬性是原子作爲記錄here並提到here強(見略高於「避免強參考週期')