[問題] 字串前加@的意思?

看板MacDev作者 (魔術研究員)時間15年前 (2010/05/04 15:14), 編輯推噓2(201)
留言3則, 2人參與, 最新討論串1/2 (看更多)
請問各位 在字串前加@是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
@是NSString的意思
05/04 15:23, 1F

05/05 00:23, , 2F
@是objective的意思
05/05 00:23, 2F

05/05 00:25, , 3F
上面我說的是我的看法... 請不要當真 XD
05/05 00:25, 3F
文章代碼(AID): #1BtybDLv (MacDev)
討論串 (同標題文章)
文章代碼(AID): #1BtybDLv (MacDev)