我从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
的项目?
答案 0 :(得分:0)
根据rmaddy
的建议,我发现了什么不正确。
这对我有用
NSString *categoriesJoined = [(business[@"categories"][0]) componentsJoinedByString:@","];