2015-02-12 34 views
0

我在iOS/Objective C中很熟悉。現在我看到有些人在某些情況下使用self->property。它與self.property有什麼不同?什麼是實際需要?我Google搜索,沒有答案。好奇它。什麼是自我>財產?

+0

它調用實例變量。 檢查:http://stackoverflow.com/questions/7057934/property-vs-instance-variable 瞭解更多。 – 2015-02-12 09:27:48

+0

同時http://stackoverflow.com/questions/22398609/what-does-property-actually-do-behind-the-scene-with-usage-of-self-and-self?rq=1 – Thilo 2015-02-12 09:28:15

回答

5

self->property_property相同,表示它直接訪問伊娃。

self.property另一方面調用setter/getter。