4

My app was running perfectly up until yesterday. Now, all of a sudden, for some reason when I start my app, instead of connecting to my database as per usual, I get the following error multiple times in my Xcode Console:

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

I have absolutely no idea why - but now I can't log into my app at all. Any idea as to why this is happening?

NOT a duplicate: The answer to this cannot possibly be "SOLUTION: Just wait for newer versions/updates of Xcode 9." Also, the above error is keeping my app from connecting to the database - others reporting this error have stated that it doesnt affect the performance of their app.

EDIT: Here is how I'm trying to connect (using Drupal iOS SDK).

UPDATE (OCT 1, 2018): Epic update...as soon as I take DIOSSession out of AppDelegate and put it into my initial ViewController, I'm able to connect as normal again. Anyone know why this is? I'm thrilled...but I imagine there's some sort of repercussion for doing this in ViewController and not in 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");

    }

}
Brittany
  • 1,359
  • 4
  • 24
  • 63
  • 2
    Possible duplicate of [What is TIC Read Status 1:57 in iOS11/Xcode 9?](https://stackoverflow.com/questions/46352735/what-is-tic-read-status-157-in-ios11-xcode-9) – Kerberos Sep 29 '18 at 09:29
  • @Kerberos The answer to this cannot possibly be "SOLUTION: Just wait for newer versions/updates of Xcode 9." Also, the above error is keeping my app from connecting to the database - others reporting this error have stated that it doesnt affect the performance of their app. – Brittany Sep 29 '18 at 17:06
  • Did you try connecting to the Backend database using Postman or cURL request? – Md. Ibrahim Hassan Oct 01 '18 at 17:56
  • @Md.IbrahimHassan See edit above re: how I've been connecting. – Brittany Oct 01 '18 at 21:01
  • @Brittany are you using this SDK https://github.com/elpablo/drupal-ios-sdk – Md. Ibrahim Hassan Oct 02 '18 at 05:02
  • Don't use `-[NSUserDefaults synchronize]` From [Apple's docs](https://developer.apple.com/documentation/foundation/nsuserdefaults/1414005-synchronize?language=objc)… _" this method is unnecessary and shouldn't be used."_ – Ashley Mills Oct 11 '18 at 14:05

1 Answers1

1

I was able to reconnect to my database by moving DIOSSession out of AppDelegate, and into my initial ViewController's viewDidLoad method. For some reason, iOS 12 does not seem to like didFinishLaunchingWithOptions in AppDelegate... Anything I put inside that method either never executes or crashes my app. Would love some insight into this if you all have any.

Brittany
  • 1,359
  • 4
  • 24
  • 63