
这是我目前的代码,如果有人能让我知道它出了什么问题会很棒.谢谢!
// Initialize ManagerNETunnelProvIDerManager *manager = [[NETunnelProvIDerManager alloc] init];[manager loadFromPreferencesWithCompletionHandler:^(NSError *error) { if (error) { NSLog(@"Load Error: %@",error.description); } else { // Create the protocol object NETunnelProvIDerProtocol *protocol = [[NETunnelProvIDerProtocol alloc] init]; // Create the protocol object // Configure the protocol object protocol.provIDerBundleIDentifIEr = @"com.nfisc.testvpn.ptp"; // Bundle ID of tunnel provIDer protocol.provIDerConfiguration = @{}; // Currently blank,but will be used later protocol.serverAddress = @"0.0.0.0"; // Ommited for security reasons protocol.username = @"username"; // The username for the configuration protocol.IDentityDataPassword = @"password"; // The password for the configuration protocol.disconnectOnSleep = NO; // Configure the manager with the protocol manager.protocolConfiguration = protocol; manager.enabled = true; [manager savetoPreferencesWithCompletionHandler:^(NSError *error) { if (error) { NSLog(@"Save Error: %@",error.description); } else { if ([[manager connection] status] != NEVPNStatusConnected) { NSLog(@"Starting VPN"); [self start:manager]; } else { NSLog(@"VPN Already Connected"); [_statusLabel setText:@"Connected"]; [_statusLabel setTextcolor:[UIcolor greencolor]]; } } }]; }}];@H_301_4@解决方法 使用(voID)loadAllFromPreferencesWithCompletionHandler 总结 以上是内存溢出为你收集整理的iOS NETunnelProviderManager保存多个配置全部内容,希望文章能够帮你解决iOS NETunnelProviderManager保存多个配置所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)