NSUInteger indexから抽出する方法
NSRange range = [string rangeOfString: substring]
このインデックスを[array objectAtIndex:index]?
NSUInteger indexから抽出する方法
NSRange range = [string rangeOfString: substring]
このインデックスを[array objectAtIndex:index]?
NSRange range = [string rangeOfString:substring];
NSUInteger index = range.location;
//...
// make sure that the substring was actually found:
NSRange result = [string rangeOfString:substring];
if (result.location != NSNotFound)
{
// make sure that the index exists in the array
if (result.location < [array count])
{
id someObj = [array objectAtIndex:result.location];
// do something cool with someObj here
}
}