ข้อมูลอ้างอิงเฟรมเวิร์ก MLKitCommon
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
MLKModelDownloadConditions
@interface MLKModelDownloadConditions : NSObject <NSCopying>
การกำหนดค่าเงื่อนไขการดาวน์โหลดโมเดล
-
ระบุว่าควรส่งคำขอดาวน์โหลดผ่านเครือข่ายมือถือหรือไม่ โดยมีค่าเริ่มต้นเป็น YES
คำประกาศ
Objective-C
@property (nonatomic, readonly) BOOL allowsCellularAccess;
-
ระบุว่าสามารถดาวน์โหลดโมเดลขณะที่แอปอยู่ในเบื้องหลังได้หรือไม่ ค่าเริ่มต้นคือ
NO
คำประกาศ
Objective-C
@property (nonatomic, readonly) BOOL allowsBackgroundDownloading;
-
สร้างอินสแตนซ์ใหม่ที่มีเงื่อนไขที่กำหนด
คำประกาศ
Objective-C
- (nonnull instancetype)initWithAllowsCellularAccess:(BOOL)allowsCellularAccess
allowsBackgroundDownloading:
(BOOL)allowsBackgroundDownloading;
พารามิเตอร์
allowsCellularAccess
|
พิจารณาว่าควรส่งคำขอดาวน์โหลดผ่านเครือข่ายมือถือหรือไม่
|
allowsBackgroundDownloading
|
ดาวน์โหลดโมเดลขณะที่แอปอยู่ใน
พื้นหลัง
|
ผลลัพธ์
อินสแตนซ์ ModelDownloadConditions
ใหม่
-
สร้างอินสแตนซ์ใหม่ที่มีเงื่อนไขเริ่มต้น ค่าเริ่มต้นจะระบุไว้ในฟิลด์
สำหรับพร็อพเพอร์ตี้อินสแตนซ์แต่ละรายการ
คำประกาศ
Objective-C
- (nonnull instancetype)init;
ผลลัพธ์
อินสแตนซ์ ModelDownloadConditions
ใหม่
เนื้อหาของหน้าเว็บนี้ได้รับอนุญาตภายใต้ใบอนุญาตที่ต้องระบุที่มาของครีเอทีฟคอมมอนส์ 4.0 และตัวอย่างโค้ดได้รับอนุญาตภายใต้ใบอนุญาต Apache 2.0 เว้นแต่จะระบุไว้เป็นอย่างอื่น โปรดดูรายละเอียดที่นโยบายเว็บไซต์ Google Developers Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2024-09-20 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 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"]]