Ich implementiere einige schnelle 3D-Aktionen für meine iOS 9 App in Swift, und ich habe ein seltsames Problem. Wenn meine App im Hintergrund ist und ich mit der schnellen Aktion starte, läuft alles wie geplant. Wenn meine App tot ist (d. H. Ich habe sie aus dem Multitasking-Menü gelöscht), und ich starte mit der schnellen Aktion, stürzt die App ab. Ich habe Probleme beim Debuggen. Sobald ich die App beendet habe, wird die Debug-Sitzung in Xcode gelöst. Gibt es eine Möglichkeit für mich, eine Verbindung zur App herzustellen, um wie üblich zu debuggen, oder gibt es etwas in meinem Code, das das verursacht? Danke im Voraus.Starten mit UIApplicationShortcutItem
Code:
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
var launchedFromShortCut = false
//Check for ShortCutItem
if let shortcutItem = launchOptions?[UIApplicationLaunchOptionsShortcutItemKey] as? UIApplicationShortcutItem
{
launchedFromShortCut = true
self.handleShortCutItem(shortcutItem)
}
return !launchedFromShortCut
}
func application(application: UIApplication, performActionForShortcutItem shortcutItem: UIApplicationShortcutItem, completionHandler: (Bool) -> Void)
{
self.handleShortCutItem(shortcutItem)
}
func handleShortCutItem(shortcutItem: UIApplicationShortcutItem)
{
//Get type string from shortcutItem
if let shortcutType = ShortcutType.init(rawValue: shortcutItem.type)
{
//Get root navigation viewcontroller and its first controller
let rootNavigationViewController = window!.rootViewController as? UINavigationController
if let rootViewController = rootNavigationViewController?.viewControllers.first as! LaunchViewController?
{
//Pop to root view controller so that approperiete segue can be performed
rootNavigationViewController?.popToRootViewControllerAnimated(false)
switch shortcutType
{
case .Compose:
rootViewController.shouldCompose()
break
}
}
}
}
Dank!
Sie können immer noch die Crash-Log-Datei der App sehen, nachdem es getötet wurde ... –
Sie bekommen dies sortiert, habe ich das gleiche Problem? – theiOSDude
@theiOSDude nein habe ich nicht. –