[Solved] unexpectedly found nil while unwrapping an Optional value

[ad_1]

I have already solved the problem.When I use 4 g, access to the dataServer!ServerURL is nil.My solution is to give it a local IP

 if davServer?.serverURL == nil {
                serverAddress = NSURL.init(string: "http://localhost/playts.m3u8")!
            }else{
               serverAddress = (davServer?.serverURL.URLByAppendingPathComponent(self.m3u8!))!
            }

[ad_2]

solved unexpectedly found nil while unwrapping an Optional value