作者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