如何加入__NSCFArray的对象?

时间:2014-06-19 23:10:40

标签: ios objective-c

我从Yelp获取数据,我得到了

NSLog(@"categories:%@", categories);
NSLog(@"categories: %@", [categories class]);
NSLog(@"categories: %@", [categories componentsJoinedByString:@","]);

我将日志视为

    categories:(
        (
        Thai,
        thai
    )
)
2014-06-19 16:20:47.338 yelp[28929:70b] categories class: __NSCFArray
2014-06-19 16:20:47.341 yelp[28929:70b] categories:(
        (
        Thai,
        thai
    )
)
2014-06-19 16:20:47.341 yelp[28929:70b] categories class: __NSCFArray
2014-06-19 16:20:47.343 yelp[28929:70b] categories:(
        (
        Thai,
        thai
    )
)
2014-06-19 16:20:47.343 yelp[28929:70b] categories class: __NSCFArray

很明显componentsJoinedByString没有加入。

作为新手,我想知道如何加入__NSCFArray的项目?

1 个答案:

答案 0 :(得分:0)

根据rmaddy的建议,我发现了什么不正确。

这对我有用

NSString *categoriesJoined = [(business[@"categories"][0]) componentsJoinedByString:@","];