相关疑难解决方法(0)

无法endBackgroundTask:没有带标识符的后台任务,或者它可能已经结束

我正在使用后台任务在后台运行计时器来更新用户的位置.它被声明为:

UIBackgroundTaskIdentifier bgTask;
Run Code Online (Sandbox Code Playgroud)

在头文件中,并初始化为:

bgTask = UIBackgroundTaskInvalid;
Run Code Online (Sandbox Code Playgroud)

但是,我仍然在gdb中收到此消息:

无法endBackgroundTask:标识符23dc不存在后台任务,或者它可能已经结束.在UIApplicationEndBackgroundTaskError()中断以进行调试.

为什么?我该如何解决这个问题?

objective-c ios7 xcode5

30
推荐指数
5
解决办法
2万
查看次数

application:openURL:options: not called

I have created html with following body:

<html>
    <head>
        <meta http-equiv="Refresh" content="3; URL='MyApp://?Success'">
    </head>
    <body>
      success
    </body>
</html>
Run Code Online (Sandbox Code Playgroud)

When i try to open page where html uploaded. from my iphone (safari) my app successfully opened but

application:openURL:options:
Run Code Online (Sandbox Code Playgroud)

does not called. Have u any ideas?

my info plist look like this:

<array>
        <string>MyApp</string>
    </array>
    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>MyApp</string>
            </array>
            <key>CFBundleURLName</key>
            <string>url here</string>
        </dict>
    </array>
Run Code Online (Sandbox Code Playgroud)

My appDelegate Methods:

func application(_ app: UIApplication, open url: URL, options [UIApplication.OpenURLOptionsKey : Any] = …
Run Code Online (Sandbox Code Playgroud)

ios swift

-1
推荐指数
5
解决办法
270
查看次数

标签 统计

ios ×1

ios7 ×1

objective-c ×1

swift ×1

xcode5 ×1