【发布时间】:2010-01-17 18:43:30
【问题描述】:
我试图弄清楚为什么这段代码不起作用。我正在尝试搜索字符串是否包含“| P”。如果是的话,我想做点什么。
NSMutableArray *list = [pView getPOIList];
NSString *cellValue = [list objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
NSArray *chunks = [cellValue componentsSeparatedByString: @"|P"];
//NSLog([[chunks count] stringValue]);
if([&chunks[1] isEqualToString:@"|P"]) {
//Do Something
}
这会使我的应用崩溃。
【问题讨论】: