我们有一个定制的UIApplication对象,所以我们的main.
swift是
import Foundation import UIKit UIApplicationMain(Process.argc,Process.unsafeArgv,NSStringFromClass(MobileUIApplication),NSStringFromClass(AppDelegate))
这在Xcode 8 beta 5中没有起作用,所以我们使用了这一点
//TODO Swift 3 workaround? https://forums.developer.apple.com/thread/46405 UIApplicationMain( Process.argc,UnsafeMutablePointer<UnsafeMutablePointer<CChar>>(Process.unsafeArgv),nil,NSStringFromClass(AppDelegate.self))
在Xcode 8 beta 6上,我们得到使用未解析的标识符’Process’
在Xcode 8 beta 6 / Swift 3中需要做什么来定义UIApplicationMain?
解决方法
我这样写:
UIApplicationMain( CommandLine.argc,UnsafeMutableRawPointer(CommandLine.unsafeArgv) .bindMemory( to: UnsafeMutablePointer<Int8>.self,capacity: Int(CommandLine.argc)),NSStringFromClass(AppDelegate.self) )
要更改UIApplication类,请在该公式中替换NSStringFromClass(MobileUIApplication.self)为零.