Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You've got several problems in here, mostly related to modifying the UI on a background thread, which you must never do. For example:</p> <pre><code>dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, (unsigned long)NULL), ^(void) { UIActivityIndicatorView *indicator = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray]; indicator.frame = CGRectMake(140, 85, 40.0, 40.0); [indicator bringSubviewToFront:self.view]; [indicator startAnimating]; [self.view addSubview:indicator]; ... </code></pre> <p>Here you're modifying the current view's list of subviews on a background thread. That's not legal. Most UIKit methods have to run on the main thread (from a GCD point of view, this is the main queue).</p> <p>This line is also extremely dangerous inside of <code>viewWillAppear:</code> (or most anywhere):</p> <pre><code>[self performSelectorInBackground:@selector(getDataFromDatabase) withObject:nil]; </code></pre> <p>Your view could appear and disappear multiple times during <code>getDataFromDatabase</code> (side note: you should call this <code>fetchDataFromDatabase</code>. "get" has a special meaning in Cocoa). If the view appears multiple times, you can wind up with many threads running simultaneously, which is certainly not what you meant.</p> <p>You should almost never use <code>performSelectorInBackground:withObject:</code>. Use <code>NSOperationQueue</code> or dispatch queues to manage background operations.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload