【发布时间】:2012-09-16 09:11:43
【问题描述】:
可能重复:
Arrow operator (->) usage in C
Dot (“.”) operator and arrow (“->”) operator use in C vs. Objective-C
我是一名新手,正在查看最近一次更新于 2008 年的免费软件/开源程序,但我无法识别以下符号中的 ->:
- (id)copyWithZone:(NSZone *)zone
{
GFIPGeniusItem * newItem = [[[self class] allocWithZone:zone] init];
newItem->_stringValue = [_stringValue copy];
newItem->_imageURL = [_imageURL copy];
newItem->_webResourceURL = [_webResourceURL copy];
newItem->_speakableStringValue = [_speakableStringValue copy];
newItem->_soundURL = [_soundURL copy];
return newItem;
}
我假设它允许某种捷径,但我很想具体说明它的作用。
【问题讨论】:
-
不是骗子。它的语义和约定都与 C 中的不同。
标签: objective-c ios