存在しないオブジェクトにアクセスしようとするような、メモリアクセスが悪いように見えます。NSZombieを使用して、何も起こらなかったことがわかる限り、何かが発生したかどうかを確認してみました。アプリデリゲートの宣言でクラッシュしています。
AppDelegate.swift
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate
{
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]) -> Bool
{
// Override point for customization after app launches
Parse.setApplicationId("removed on purpose", clientKey: "removed on purpose")
PFAnalytics.trackAppOpenedWithLaunchOptions(launchOptions)
PFFacebookUtils.initializeFacebook()
return true
}
func application(application: UIApplication, openURL url: NSURL, sourceApplication: String, annotation: AnyObject?) -> Bool
{
return FBAppCall.handleOpenURL(url, sourceApplication: sourceApplication, withSession: PFFacebookUtils.session())
}
func applicationDidBecomeActive(application: UIApplication)
{
FBAppCall.handleDidBecomeActiveWithSession(PFFacebookUtils.session())
}
func applicationWillResignActive(application: UIApplication)
{
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication)
{
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication)
{
// Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background.
}
func applicationWillTerminate(application: UIApplication)
{
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
DashboardViewController.swift
import UIKit
class DashboardViewController: UIViewController
{
override func viewDidLoad()
{
super.viewDidLoad()
// Do any additional setup after loading the view
}
}
ブレークポイントを使用して、アプリデリゲートのクラス宣言を通過していないことを確認しました。Main.storyboardファイル内のすべてのクラスもチェックして、すべてが正しくリンクされていることを確認しました。これも、私が知る限りです。
私は今日同じ問題に遭遇しました。Xcode 6ベータ6の時点で、オートコンプリートは次のことを示唆しています。
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]) -> Bool {}
これは、起動時にEXC_BAD_ACCESSと空白の画面でクラッシュします。
!
最後の引数にが追加されるとすぐに、すべてが正常に機能します。
func application(application: UIApplication,didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]!) -> Bool {}
では、現在のドキュメント!
にも欠落しています。
optional func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject : AnyObject]) -> Bool
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加