我是新来的objective-c。 我有一个NSMutableArray。我写了这个:如何验证某个元素是否存在于NSMutubleArray中
for (int i=0; i<[allCombinations count]; i++)
{
NSString *date = [[allCombinations objectAtIndex:i] objectForKey:@"keydate"];
NSString *cachdepeDate = [date substringToIndex:8];
}
我怎么能看到如果cachdepeDate是alrady exsit在我的NSMutbleArray?
如果不存在,我该如何添加它?
我应该为循环,还是有一个方法呢?
我可以对NSMutbleArray进行排序吗?
日期格式如下:“20110531”“YYYYMMDD”。 谢谢!
什么是'cachdepeDate'?你的代码不完整。 – kennytm 2011-05-24 19:46:09
@KennyTM对不起,cachdepeDate = [date substringToIndex:8] ;,这是一个像这样的“20110531” – user567 2011-05-24 19:50:24