Objective C, "Call from Main Thread" 的正确方法?
Objective C, Correct way to "Call from Main Thread"?
我知道大多数人都这样做 dispatchqueue.main.async
或 dispatch_async(dispatch_get_main_queue(), ^{
但是从主线程调用 Objective C 的正确方法是什么?
具体来说,我想在查询代码中从主线程调用 textfieldview。
例如:
NSString *qry = [NSString stringWithFormat:
@"SELECT [ID] AS Identify "
" , Number AS Zeros "
" , Facils AS Buildings "
" FROM tableTod "
" WHERE Facils ='%@' "
, self.websiteTextField.text
];
答案:
我通过实施分派异步代码找到了解决方案。它不是 SQL 注入。谢谢。
我知道大多数人都这样做 dispatchqueue.main.async
或 dispatch_async(dispatch_get_main_queue(), ^{
但是从主线程调用 Objective C 的正确方法是什么?
具体来说,我想在查询代码中从主线程调用 textfieldview。
例如:
NSString *qry = [NSString stringWithFormat:
@"SELECT [ID] AS Identify "
" , Number AS Zeros "
" , Facils AS Buildings "
" FROM tableTod "
" WHERE Facils ='%@' "
, self.websiteTextField.text
];
答案:
我通过实施分派异步代码找到了解决方案。它不是 SQL 注入。谢谢。