[問題] 字串前加@的意思?
請問各位
在字串前加@是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
推
05/04 15:23, , 1F
05/04 15:23, 1F
推
05/05 00:23, , 2F
05/05 00:23, 2F
→
05/05 00:25, , 3F
05/05 00:25, 3F
討論串 (同標題文章)
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章