Ios dispatch\u async不在每次远程通知(APNs)时执行

Ios dispatch\u async不在每次远程通知(APNs)时执行,ios,iphone,multithreading,ipad,apple-push-notifications,Ios,Iphone,Multithreading,Ipad,Apple Push Notifications,通常,下面的代码工作正常,但当我从远程通知APNS queue2 not get execute执行此代码时,我很想知道下面的代码片段中缺少了什么 //On didReceiveRemoteNotification, I am calling refresh method using singleton object - (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionar

通常,下面的代码工作正常,但当我从远程通知APNS queue2 not get execute执行此代码时,我很想知道下面的代码片段中缺少了什么

//On didReceiveRemoteNotification, I am calling refresh method using singleton object
- (void)application:(UIApplication *)application didReceiveRemoteNotification:(NSDictionary *)userInfo
{
    [[NetworkDispatcher sharedInterface] refresh];
}

//Created two queues, initialise in "NetworkDispatcher" init method
dispatch_queue_t queue1 = dispatch_queue_create("com.Test.NetworkDispatcher", NULL);
dispatch_queue_t queue2 = dispatch_queue_create("com.Test.NetworkDispatcher.PostRequests", NULL);
//下面是NetworkDispatcher类中的刷新方法

- (void)refresh
{
    dispatch_async(queue1, ^{
           if ([self refreshWorker])
           {
               dispatch_async(queue2, ^{
                  [self syncAllParties];
              });
       }
       });
}
dispatch_asyncqueue2被命中,但syncAllParties不会一直被调用 在调用其他post api的一些时间之后,这会自动开始执行 此时,所有排队的请求都将得到处理,就好像这些POST操作锁定并解锁了队列一样


任何帮助都将不胜感激。

显而易见的答案是[self-refreshWorker]返回否,因此代码永远不会到达第二个调度调用。你检查过它的返回值吗?没有。它返回了。是的,我用断点检查过。