作者iasm (魔术研究员)
看板MacDev
标题[问题] 字串前加@的意思?
时间Tue May 4 15:14:19 2010
请问各位
在字串前加@是const的意思
但是如果在以下的情型
NSString *str1=@"this is string a";
NSMutableString *mstr;
mstr=[NSMutablestring stringwithstring: str1];
[mstr insertString: @" mutable" atIndex:7];
最後的结果是"this is mutable string a";
而且实际上mstr这个mutable string其内的字串内容可以改
但为什麽要在 " mutable"前加代表常数的@呢
既然是给mutable string内容,加@就很矛盾了
烦请大家教教我,谢谢!!
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 140.96.39.8
1F:推 dreambird:@是NSString的意思 05/04 15:23
2F:推 leondemon:@是objective的意思 05/05 00:23
3F:→ leondemon:上面我说的是我的看法... 请不要当真 XD 05/05 00:25