0

I am using swift 4.0 to re-write main.swift of my iOS application. And this is my main.swift:

UIApplicationMain(CommandLine.argc,
              CommandLine.unsafeArgv
              NSStringFromClass(MyAPP.self),
              NSStringFromClass(AppDelegate.self))

there's an compile error here:

Cannot convert value of type 'UnsafeMutablePointer<UnsafeMutablePointer<Int8>?>' to expected argument type 'UnsafeMutablePointer<UnsafeMutablePointer<Int8>>!'

AnyOne know how to convert UnsafeMutablePointer<UnsafeMutablePointer<Int8>?> to UnsafeMutablePointer<UnsafeMutablePointer<Int8>>! here?

archerLj
  • 199
  • 1
  • 2
  • 14
  • Possible duplicate of [Xcode 8 beta 6: main.swift won't compile](https://stackoverflow.com/questions/39088928/xcode-8-beta-6-main-swift-wont-compile) – matt Oct 01 '18 at 17:01

2 Answers2

0
UIApplicationMain(
    CommandLine.argc,
    UnsafeMutablePointer(CommandLine.unsafeArgv),
    NSStringFromClass(MyAPP.self),
    NSStringFromClass(AppDelegate.self)
)
-3

Please check :

UIApplicationMain(  
    CommandLine.argc,  
    UnsafeMutableRawPointer(CommandLine.unsafeArgv)  
        .bindMemory(  
            to: UnsafeMutablePointer<Int8>.self,  
            capacity: Int(CommandLine.argc)
        ),  
    NSStringFromClass(MyAPP.self),  
    NSStringFromClass(AppDelegate.self)  
)  
Vini App
  • 7,339
  • 2
  • 26
  • 43