NSMutableString 定义和重新定义
我对正确启动 NSMutableString 感到不知所措,我已经尝试过:
NSMutableString *string = @"some text";
这与将字符串分配给 NSString 的方法相同,但没有运气。此外,我无法弄清楚如何重新定义 NSMutableString 包含的字符串。我想它看起来像这样:
string = @"new text";
任何关于这个基本主题的帮助和代码将不胜感激。谢谢
I am at a loss as hot to properly initiate a NSMutableString, I have tried:
NSMutableString *string = @"some text";
which is the same method one assigns a string to an NSString but have hade no luck. Additionally I have not been able to figure out how to redefine the string contained with the NSMutableString. I would imagine it would look something like:
string = @"new text";
Any help and code on this basic subject would be greatly appreciated. Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您想要:
您的示例只是使
string
指向常量字符串,这可能是个坏消息。要设置字符串,请使用:You want:
Your examples are just making
string
point to a constant string, which is bad news, probably. To set the string, use: