GCKLaunchOptions 类
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
继承自 NSObject、<NSCopying> 和 <NSCoding>。
- (instancetype) initWithRelaunchIfRunning: |
|
(BOOL) |
relaunchIfRunning |
|
使用发送方设备的语言代码和指定的重新启动行为初始化对象。
- (instancetype) initWithLanguageCode: |
|
(NSString *__nullable) |
languageCode |
relaunchIfRunning: |
|
(BOOL) |
relaunchIfRunning |
|
|
| |
指定初始化程序。
使用指定的语言代码和重新启动行为初始化对象。
- Parameters
-
languageCode | The language code as per RFC 5646. |
relaunchIfRunning | A flag indicating whether the receiver application should be relaunched if it is already running. |
- (NSString*) languageCode |
|
readwritenonatomiccopy |
发件人的语言代码(根据 RFC 5646)。
默认值为发送方设备的语言。
- (BOOL) relaunchIfRunning |
|
readwritenonatomicassign |
一个标志,用于指示接收器应用是否应在已运行时重新启动。
默认值为 NO
。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-07-26。
[null,null,["最后更新时间 (UTC):2025-07-26。"],[[["\u003cp\u003e\u003ccode\u003eGCKLaunchOptions\u003c/code\u003e objects are used to specify how a receiver application is launched on a Cast device.\u003c/p\u003e\n"],["\u003cp\u003eThese options include the sender's language code and whether to relaunch the receiver application if it's already running.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eGCKLaunchOptions\u003c/code\u003e provides three initializers to set these options with varying levels of customization.\u003c/p\u003e\n"],["\u003cp\u003eYou can access and modify the \u003ccode\u003elanguageCode\u003c/code\u003e and \u003ccode\u003erelaunchIfRunning\u003c/code\u003e properties of a \u003ccode\u003eGCKLaunchOptions\u003c/code\u003e instance.\u003c/p\u003e\n"],["\u003cp\u003eBy default, the receiver application will not be relaunched if it is already running, and the language code will be the sender device's language.\u003c/p\u003e\n"]]],["The GCKLaunchOptions class manages receiver application launch settings. Key actions include initializing the object with default values, the device's language code, and a specified relaunch behavior. The designated initializer accepts both a language code and a relaunch flag. Properties include `languageCode`, which follows RFC 5646 and defaults to the sender's language, and `relaunchIfRunning`, a boolean indicating whether to relaunch an already running application, defaulting to `NO`.\n"],null,["# GCKLaunchOptions Class\n\n[Instance Methods](#pub-methods) \\| [Properties](#properties) \nGCKLaunchOptions Class Reference \n\nOverview\n--------\n\nReceiver application launch options.\n\nInherits NSObject, \\\u003cNSCopying\\\u003e, and \\\u003cNSCoding\\\u003e.\n\n|----------------|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| Instance Method Summary ----------------------- ||\n| (instancetype) | - [init](/cast/v3/reference/ios/interface_g_c_k_launch_options#a517758eee4ced6050e6c1828f2dd99ff) |\n| | Initializes the object with default values. [More...](#a517758eee4ced6050e6c1828f2dd99ff) |\n| ||\n| (instancetype) | - [initWithRelaunchIfRunning:](/cast/v3/reference/ios/interface_g_c_k_launch_options#aaffd323b75c8c8575cd11117c176878b) |\n| | Initializes the object with the sender device's language code and the specified relaunch behavior. [More...](#aaffd323b75c8c8575cd11117c176878b) |\n| ||\n| (instancetype) | - [initWithLanguageCode:relaunchIfRunning:](/cast/v3/reference/ios/interface_g_c_k_launch_options#aeb3de5baa2a2bd9e822158b4b060281c) |\n| | Designated initializer. [More...](#aeb3de5baa2a2bd9e822158b4b060281c) |\n| ||\n\n|-------------|-------------------------------------------------------------------------------------------------------------------------------------------------|\n| Property Summary ---------------- ||\n| NSString \\* | [languageCode](/cast/v3/reference/ios/interface_g_c_k_launch_options#a945553da0a01cb4bfd16ca587f21bc08) |\n| | The sender's language code as per RFC 5646. [More...](#a945553da0a01cb4bfd16ca587f21bc08) |\n| ||\n| BOOL | [relaunchIfRunning](/cast/v3/reference/ios/interface_g_c_k_launch_options#a130bec9fa71e880bef4aec51be5dcf56) |\n| | A flag indicating whether the receiver application should be relaunched if it is already running. [More...](#a130bec9fa71e880bef4aec51be5dcf56) |\n| ||\n\nMethod Detail\n-------------\n\n|-----------------------|---|---|---|\n| - (instancetype) init | | | |\n\nInitializes the object with default values. \n\n|---------------------------------------------|---|--------|---------------------|---|\n| - (instancetype) initWithRelaunchIfRunning: | | (BOOL) | *relaunchIfRunning* | |\n\nInitializes the object with the sender device's language code and the specified relaunch behavior. \n\n|----------------------------------------|---|-------------------------|---------------------|\n| - (instancetype) initWithLanguageCode: | | (NSString \\*__nullable) | *languageCode* |\n| relaunchIfRunning: | | (BOOL) | *relaunchIfRunning* |\n| | | | |\n\nDesignated initializer.\n\nInitializes the object with the specified language code and relaunch behavior.\n\nParameters\n:\n\n |-------------------|---------------------------------------------------------------------------------------------------|\n | languageCode | The language code as per RFC 5646. |\n | relaunchIfRunning | A flag indicating whether the receiver application should be relaunched if it is already running. |\n\n\nProperty Detail\n---------------\n\n|-----------------------------------------------------------------|------------------------|\n| |-----------------------------| | - (NSString\\*) languageCode | | readwritenonatomiccopy |\n\nThe sender's language code as per RFC 5646.\n\nThe default is the sender device's language. \n\n|---------------------------------------------------------------|--------------------------|\n| |----------------------------| | - (BOOL) relaunchIfRunning | | readwritenonatomicassign |\n\nA flag indicating whether the receiver application should be relaunched if it is already running.\n\nThe default is `NO`."]]