iOS11 SDK can't access Application's Delegate

Viewed 659
- (NSString *)getAuthorizationHeader{
    iKMAppDelegate *delegate = (iKMAppDelegate *)[UIApplication sharedApplication].delegate;
    NSString *header = [NSString stringWithFormat:@"Bearer %@", delegate.appDataObject.oauth2AcessToken];
    return header;
}

this method will got a warning in XCode9

[UIApplication delegate] must be called from main thread only

and i dont think a dispatch in main queue will be working for my function . so how to fix this warning well?

2 Answers
Related