Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

-[UIView init] must be used from main thread only #29

Open
mudassir-abbas-brainx opened this issue Mar 10, 2021 · 3 comments
Open

-[UIView init] must be used from main thread only #29

mudassir-abbas-brainx opened this issue Mar 10, 2021 · 3 comments

Comments

@mudassir-abbas-brainx
Copy link

initWithTitle is showing UIMainThread issue and app crashes

  • (id)initWithTitle:(NSString *)title message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle otherButtonTitles:(NSString *)otherButtonTitles, ...
    {
    self = [super init]; // Error -[UIView init] must be used from main thread only
    }
@kconner
Copy link
Contributor

kconner commented Mar 10, 2021

It's true of UIKit in general that you may only call it from the main thread. Try stopping at the point of your call to -initWithTitle: using a breakpoint. Then inspect which thread is running.

@mudassir-abbas-brainx
Copy link
Author

mudassir-abbas-brainx commented Mar 12, 2021

it is showing other than main thread because i'm calling this pod in the response of Apple Health Kit Api

@mudassir-abbas-brainx
Copy link
Author

kindly update the pods

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants