Swift Error quot;UIButton.currentTitle must be used from main thread onlyquot;(Swift 错误“UIButton.currentTitle 必须仅在主线程中使用)
问题描述
我刚刚从以下链接关注了这个你管教程:
网址:
MPMediaLibrary.requestAuthorization 是异步调用,布局组件只能在主线程中修改.你应该这样使用:
I just followed this you tube tutorial from the following link:
URL: https://www.youtube.com/watch?v=aiXvvL1wNUc
I cam across an error saying "UIButton.currentTitle must be used from main thread only"
Not really sure how to fix this as I am new to making apps, can anyone help me?
Greatly appreciated and thanks in advance!
The MPMediaLibrary.requestAuthorization is an async call, and layout components only can be modified in the Main Thread. You should use this way:
这篇关于Swift 错误“UIButton.currentTitle 必须仅在主线程中使用"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!