Xcode 目标C:使用NSASCIIStringEncoding在tableview中搜索

Xcode 目标C:使用NSASCIIStringEncoding在tableview中搜索,xcode,search,Xcode,Search,我正在使用以下命令搜索UITableView: titles = [NSArray arrayWithArray:[datamanager titlesForEntriesBetween:(NSInteger)[slider minSelectedValue] and:(NSInteger)[slider maxSelectedValue]containing:searchText]]; 在搜索过程中,如何使用NSASCIIStringEncoding对数组值进行编码 (数组包含“tête”例

我正在使用以下命令搜索
UITableView

titles = [NSArray arrayWithArray:[datamanager titlesForEntriesBetween:(NSInteger)[slider minSelectedValue] and:(NSInteger)[slider maxSelectedValue]containing:searchText]];
在搜索过程中,如何使用
NSASCIIStringEncoding
对数组值进行编码


(数组包含
“tête”
例如..当我搜索
“tete”
时,没有匹配的..因此我将仅为搜索对数组值进行编码)

我会将第三个参数添加到datamanager函数中:

- (NSArray*)titlesForEntriesBetween:(NSInteger)startIndex
  and:(NSInteger)stopIndex
  withFunction:(BOOL(^)(NSString*))block {
  NSMutableArray *retVal = [NSMutableArray array];
  for(NSInteger i = startIndex; i <= stopIndex; ++i) {
    NSString *string = [array_ objectAtIndex:i];
    if (block(string)) {
      [retVal insertObject:string];
    }
  }
  return retVal;
}

注意:我只是输入了这个,我还没有尝试编译/运行它。

我会将第三个参数添加到datamanager函数中:

- (NSArray*)titlesForEntriesBetween:(NSInteger)startIndex
  and:(NSInteger)stopIndex
  withFunction:(BOOL(^)(NSString*))block {
  NSMutableArray *retVal = [NSMutableArray array];
  for(NSInteger i = startIndex; i <= stopIndex; ++i) {
    NSString *string = [array_ objectAtIndex:i];
    if (block(string)) {
      [retVal insertObject:string];
    }
  }
  return retVal;
}
注意:我只是输入了这个,我还没有尝试编译/运行这个