logo
  • 教程列表
  • SO官方文檔
  • NSPredicate
    • 按名稱過濾
    • 查詢除給定 ID 之外的電影
    • 找到所有型別為 movie 的物件
    • 找到陣列的不同物件 ID
    • 查詢具有特定 ID 的電影
    • 案例與精確標題匹配的不敏感比較
    • 區分大小寫與完全標題匹配
    • 案例與匹配子集的不敏感比較
  1. StackOverflow 文件
  2. Objective-C Language 教程
  3. NSPredicate
  4. 案例與匹配子集的不敏感比較

案例與匹配子集的不敏感比較

Created: November-22, 2018

// *** Case Insensitive comparison with matching subset ***
NSPredicate *filterByName = [NSPredicate predicateWithFormat:@"self.title CONTAINS[cd] %@",@"Tom"];
NSLog(@"Filter By Containing Name : %@",[array filteredArrayUsingPredicate:filterByName]);
  • 區分大小寫與完全標題匹配

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 關於本站
  • 免責聲明