Home > Back-end >  Objective C, Correct way to "Call from Main Thread"?
Objective C, Correct way to "Call from Main Thread"?

Time:12-16

I am aware most people do dispatchqueue.main.async or dispatch_async(dispatch_get_main_queue(), ^{ but what would be the correct way to call from main thread for Objective C?

Specifically I wanna call a textfieldview from main thread inside a query code.

Ex:

    NSString *qry = [NSString stringWithFormat:                         
                        @"SELECT [ID]        AS Identify          "
                         "     , Number     AS Zeros       "
                         "     , Facils AS Buildings          "
                         "  FROM tableTod                    "
                         "    WHERE Facils ='%@'               "

                     , self.websiteTextField.text
      ];

CodePudding user response:

Answer:

I found the solution by just implementing the dispatch async code. It is not SQL injection. Thanks.

  • Related