0

My code

Open func

Code in the picturePacket Tunnel Provider.m is so written, the ProvisioningProfiles are set up. It has already applied to the NetworkExtension.entitlements.

I would like to run the main program, then execution target, but the target time is running out wrong.

Will I doing wrong? PacketTunnelProvider this Target should be how to use ?

(Code in the picture)

Thomas
  • 1
  • 1
  • 1
    Instead of adding code as image, try writing it in your question only. It will be better for both you and others – Nehal Mar 15 '16 at 12:25

1 Answers1

0

You are doing it wrong. To run the PacketTunnelProvider, you need to use the function startVPNTunnel()

And since it's can throw an exception, you need to do something like

    do {
        try vpnManager!.connection.startVPNTunnel()
        }
   catch {
         }
Witterquick
  • 6,048
  • 3
  • 26
  • 50
  • hello, I was in the main program, wrote [self.manager.connection startVPNTunnelAndReturnError: & startError]; I added a new picture, you can look at. – Thomas Mar 17 '16 at 11:07
  • My error was running Target when direct crash, open VPN instead of running after time. – Thomas Mar 17 '16 at 11:17