MLKitObjectDetectionCommon 框架参考
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
-
@枚举 ObjectDetectorMode
对象检测器模式。
声明
Objective-C
typedef NSInteger MLKObjectDetectorMode
-
包含检测到的对象数组的块,如果出现错误,则返回 nil
。
声明
Objective-C
typedef void (^MLKObjectDetectionCallback)(NSArray<MLKObject *> *_Nullable,
NSError *_Nullable)
参数
objects
|
在图片中检测到的对象数组,如果出现错误,则返回 nil 。
|
error
|
|
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-25。
[null,null,["最后更新时间 (UTC):2025-07-25。"],[[["\u003cp\u003eThe \u003ccode\u003eMLKObjectDetectorMode\u003c/code\u003e type defines the modes for object detection.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eMLKObjectDetectionCallback\u003c/code\u003e type is a block providing detected objects or an error.\u003c/p\u003e\n"]]],["The document defines two key types: `MLKObjectDetectorMode`, an integer-based enum representing object detector modes, and `MLKObjectDetectionCallback`, a block type. `MLKObjectDetectionCallback` is designed to receive an array of detected objects or a `nil` value in case of errors. It also includes an optional error object. The block's parameters are the objects detected, or nil, and an error or nil.\n"],null,["# MLKitObjectDetectionCommon Framework Reference\n\nType Definitions\n================\n\nThe following type definitions are available globally.\n- `\n ``\n ``\n `\n\n ### [MLKObjectDetectorMode](#/c:MLKCommonObjectDetectorOptions.h@T@MLKObjectDetectorMode)\n\n `\n ` \n @enum ObjectDetectorMode\n Object detector modes. \n\n #### Declaration\n\n Objective-C \n\n typedef NSInteger MLKObjectDetectorMode\n\n- `\n ``\n ``\n `\n\n ### [MLKObjectDetectionCallback](#/c:MLKObjectDetector.h@T@MLKObjectDetectionCallback)\n\n `\n ` \n A block containing an array of objects detected or `nil` if there was an error. \n\n #### Declaration\n\n Objective-C \n\n typedef void (^MLKObjectDetectionCallback)(NSArray\u003c/ml-kit/reference/ios/mlkitobjectdetectioncommon/api/reference/Classes/MLKObject *\u003e *_Nullable,\n NSError *_Nullable)\n\n #### Parameters\n\n |-----------------|------------------------------------------------------------------------|\n | ` `*objects*` ` | Array of objects detected in the image or `nil` if there was an error. |\n | ` `*error*` ` | The error or `nil`. |"]]