Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/95.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios joinOnce在NehospotConfiguration中做什么?_Ios_Iphone_Networking - Fatal编程技术网

Ios joinOnce在NehospotConfiguration中做什么?

Ios joinOnce在NehospotConfiguration中做什么?,ios,iphone,networking,Ios,Iphone,Networking,我正在尝试用下面的代码在iOS中进行自动连接 if([Utils isEmpty:password]){ configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID]; }else{ configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID passphrase: password isWEP: NO]; } configu

我正在尝试用下面的代码在iOS中进行自动连接

if([Utils isEmpty:password]){
  configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID];
}else{
  configuration = [[NEHotspotConfiguration alloc] initWithSSID: wifiSSID passphrase: password isWEP: NO];
}
configuration.joinOnce = YES;

/* Alert the OS that the user wants to connect to the WiFi */
[[NEHotspotConfigurationManager sharedManager] applyConfiguration: configuration completionHandler: ^ (NSError * _Nullable error) {
  if (nil == error) {
    DLog (@ "Is Connected!!");
    [WiFiManager sendCallback:CONNECTED callback:callback];
  } else {
    DLog (@ "Error is:%@", error);
    [WiFiManager sendCallback:UNKNOWN callback:callback];
}}];
这里我有一次=是的。 当设置为“否”时,它实际上做了什么。 我觉得“是”和“否”没有什么区别


任何人请解释。

joinOnce
设置为
true
时,这意味着一旦设备休眠或应用程序在后台运行一段时间,与热点的连接就会断开,配置就会被忘记。

似乎很清楚这是否意味着如果joinOnce设置为false,当应用程序被关闭或处于后台时,wifi不会断开连接?这是正确的。@Paulw11..谢谢。)
joinOnce
是否有默认值?如果我根本懒得设置
joinOnce
,该怎么办?