在Xcode控制台中读取Obj-C的TIC状态?

4

我的应用程序一直很完美地运行,直到昨天。现在,突然间,当我启动应用程序时,与平常连接到我的数据库不同,我的Xcode控制台中会多次出现以下错误:

2018-09-28 22:18:55.376987-0700 [2378:1001370] TIC Read Status [2:0x0]: 1:57 2018-09-28 22:18:56.927081-0700 [2378:1001370] TIC Read Status [3:0x0]: 1:57 2018-09-28 22:18:56.927210-0700 [2378:1001370] TIC Read Status [3:0x0]: 1:57

我绝对不知道为什么-但现在我根本无法登录我的应用程序。您有任何想法为什么会发生这种情况吗?

不是重复问题:答案不可能是“解决方案:只需等待Xcode 9的新版本/更新。” 此外,上述错误正在阻止我的应用程序连接到数据库-其他人报告此错误已经说明它不会影响他们应用程序的性能。

编辑: 这是我如何连接(使用Drupal iOS SDK)。

更新2018年10月1日):史诗级更新……只要我将DIOSSession从AppDelegate中移到我的初始ViewController中,我就可以像往常一样连接。有人知道为什么吗?我很高兴……但我想在ViewController中这样做而不是在AppDelegate中肯定会有某种后果。

AppDelegate.m

#import "AppDelegate.h"
#import "DIOSSession.h"
#import "AFNetworking.h"
#import "DIOSSystem.h"


@interface AppDelegate  ()

@end

@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {

    [DIOSSession setupDios];

   }

ViewController.m

- (void)viewDidLoad {
    [super viewDidLoad];


    if ([[NSUserDefaults standardUserDefaults] boolForKey:@"HasLaunchedOnce"])

    {
      //  NSLog(@"not first launch");

    }

    else

    {


        [[NSUserDefaults standardUserDefaults] setBool:YES forKey:@"HasLaunchedOnce"];
        [[NSUserDefaults standardUserDefaults] synchronize];


    }



    NSDictionary *user = (NSDictionary*) [NSKeyedUnarchiver unarchiveObjectWithData:[[NSUserDefaults standardUserDefaults] objectForKey:@"diosSession"]];

    NSString *token = [[NSUserDefaults standardUserDefaults] objectForKey:@"diosToken"];


    if (user && token) {


        [[DIOSSession sharedSession] setUser:user];

        [[DIOSSession sharedSession] setCsrfToken:token];


        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        UITabBarController *yourViewController = (UITabBarController *)[storyboard instantiateViewControllerWithIdentifier:@"tabBar"];
        [self.navigationController pushViewController:yourViewController animated:YES];


    } else {

        NSLog(@"No session present");

    }

}

2
可能是什么是iOS11/Xcode 9中的TIC Read Status 1:57?的重复问题。 - Kerberos
@Kerberos 这个问题的答案不可能是“解决方案:只需等待Xcode 9的更新版本/更新。”此外,上述错误导致我的应用程序无法连接到数据库 - 其他报告此错误的人已经说明它不会影响其应用程序的性能。 - Brittany
你尝试使用Postman或cURL请求连接到后端数据库了吗? - Md. Ibrahim Hassan
@Md.IbrahimHassan 请查看上面的编辑内容,了解我是如何连接的。 - Brittany
@Brittany 你是否在使用这个SDK https://github.com/elpablo/drupal-ios-sdk? - Md. Ibrahim Hassan
不要使用 -[NSUserDefaults synchronize]。根据苹果文档的描述,这个方法是不必要的,不应该被使用。 - Ashley Mills
1个回答

1
我能够通过将DIOSSession从AppDelegate中移动到我的初始ViewController的viewDidLoad方法中来重新连接我的数据库。由于某种原因,iOS 12似乎不喜欢在AppDelegate中使用didFinishLaunchingWithOptions... 我放置在该方法中的任何内容都不会执行或导致我的应用程序崩溃。如果您有任何见解,我会非常感激。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接