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 initWithFrame:] must be used from main thread only #156

Open
leonhsieh opened this issue Oct 18, 2023 · 1 comment
Open

[UIView initWithFrame:] must be used from main thread only #156

leonhsieh opened this issue Oct 18, 2023 · 1 comment

Comments

@leonhsieh
Copy link

Hi there, I have encounter a thread issue when using indicatorView of JGProgressHUD:

Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Modifications to the layout engine must not be performed from a background thread after it has been accessed from the main thread.'

And a thread warning
-[UIView initWithFrame:] must be used from main thread only
appears on this line:

self = [super initWithFrame:CGRectZero];
@JonasGessner
Copy link
Owner

This is caused by calling JGProgressHUD methods on a background thread. JGProgressHUD is a UI element, inheriting from UIView and all UIView methods have to be called from the main thread.

So make sure that all your code that interacts with the hud is executed on the main thread.

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