logo
  • 教程列表
  • SO官方文档
  • NSPredicate
    • 使用 NSPredicate 进行表单验证
    • 使用 predicateWithBlock 创建 NSPredicate
    • 使用 predicateWithFormat 创建 NSPredicate
    • 使用替换变量创建 NSPredicate
    • 使用 NSPredicate 过滤数组
    • NSPredicate 与 AND OR 和 NOT 条件
  1. StackOverflow 文档
  2. iOS 教程
  3. NSPredicate
  4. 使用 predicateWithFormat 创建 NSPredicate

使用 predicateWithFormat 创建 NSPredicate

Created: November-22, 2018

Objective-C

NSPredicate *predicate = [NSPredicate predicateWithFormat: @"self[SIZE] = %d", 5)];

迅速

let predicate = NSPredicate(format: "self[SIZE] >= %d", 5)

在此示例中,谓词将匹配长度至少为 5 的数组。

  • 使用替换变量创建 NSPredicate
  • 使用 predicateWithBlock 创建 NSPredicate

Copyright © 2018. All right reserved

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

  • 关于我们
  • 免责声明