Tài liệu tham khảo Khung MLKitCommon
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
MLKModelDownloadConditions
@interface MLKModelDownloadConditions : NSObject <NSCopying>
Cấu hình cho các điều kiện tải mô hình xuống.
-
Cho biết liệu có cần thực hiện yêu cầu tải xuống qua mạng di động hay không. Mặc định là YES
.
Khai báo
Objective-C
@property (nonatomic, readonly) BOOL allowsCellularAccess;
-
Cho biết liệu mô hình có thể được tải xuống khi ứng dụng chạy trong nền hay không. Mặc định là
NO
.
Khai báo
Objective-C
@property (nonatomic, readonly) BOOL allowsBackgroundDownloading;
-
Tạo một thực thể mới với các điều kiện đã cho.
Khai báo
Objective-C
- (nonnull instancetype)initWithAllowsCellularAccess:(BOOL)allowsCellularAccess
allowsBackgroundDownloading:
(BOOL)allowsBackgroundDownloading;
Tham số
allowsCellularAccess
|
Liệu có nên thực hiện yêu cầu tải xuống qua mạng di động hay không.
|
allowsBackgroundDownloading
|
Liệu có thể tải mô hình xuống khi ứng dụng đang trong
nền.
|
Giá trị trả về
Một thực thể ModelDownloadConditions
mới.
-
Tạo một thực thể mới với các điều kiện mặc định. Các giá trị mặc định được chỉ định trong
cho từng thuộc tính của thực thể.
Khai báo
Objective-C
- (nonnull instancetype)init;
Giá trị trả về
Một thực thể ModelDownloadConditions
mới.
Trừ phi có lưu ý khác, nội dung của trang này được cấp phép theo Giấy phép ghi nhận tác giả 4.0 của Creative Commons và các mẫu mã lập trình được cấp phép theo Giấy phép Apache 2.0. Để biết thông tin chi tiết, vui lòng tham khảo Chính sách trang web của Google Developers. Java là nhãn hiệu đã đăng ký của Oracle và/hoặc các đơn vị liên kết với Oracle.
Cập nhật lần gần đây nhất: 2024-09-20 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2024-09-20 UTC."],[[["`MLKModelDownloadConditions` configures conditions for downloading machine learning models."],["It controls whether downloads can occur over cellular networks and in the background."],["Developers can customize these conditions using `initWithAllowsCellularAccess:allowsBackgroundDownloading:` or rely on the defaults with `init`."],["By default, cellular access is allowed (`allowsCellularAccess = YES`), but background downloading is not (`allowsBackgroundDownloading = NO`)."]]],["`MLKModelDownloadConditions` configures model download settings. Key properties include `allowsCellularAccess`, enabling downloads over cellular networks (default: `YES`), and `allowsBackgroundDownloading`, allowing downloads in the background (default: `NO`). You can create instances with custom conditions using `initWithAllowsCellularAccess:allowsBackgroundDownloading:`, or use default settings with `init`. Both methods return a `ModelDownloadConditions` instance.\n"]]