我正在尝试将字符串拆分为数组。这是我正在使用的代码(我也在使用 ARC(:
test = @"this$is$a$test";
myarray = [test componentSeparatedByString:@"$"];
test
和myarray
是合成属性。
我收到错误:
例如,接收方类型"NSstring"消息不使用选择器"组件分隔的字符串"声明方法
谁能帮我解决这个问题?谢谢
它components
不是component
.请确保在收到警告时参考文档,指出方法不存在。
myarray = [test componentsSeparatedByString:@"$"];