开发者

NSArray may not respond to componentsSeparatedByString

开发者 https://www.devze.com 2023-03-21 23:04 出处:网络
NSArray *Lines = [StringData componentsSeparatedByString:@\"\\n\"]; for (NSArray *ThisLine in Lines){ NSArray *Items = [ThisLine componentsSeparatedByString:@\",\"];
NSArray *Lines = [StringData componentsSeparatedByString:@"\n"];
for (NSArray *ThisLine in Lines){

    NSArray *Items = [ThisLine componentsSeparatedByString:@","];
    ...
}

I get a warning NSArray may not respond to componentsSeparatedByString.

开发者_JAVA百科

Any thoughts?


You are declaring ThisLine as an array when it should be an NSString. This should fix it

for (NSString *ThisLine in Lines){
0

精彩评论

暂无评论...
验证码 换一张
取 消