title: Activity Indicator not visibile
body: <p>I am having a weird issue that is I need to animate an <code>Activity Indicator</code> When I select a <code>Cell</code> from <code>CollectionView</code>. </p>
  
  <p>My problem is while Debugging the code with Breakpoint ,<code>Activity Indicator</code> is animating but without breakpoint when running the app <code>Activity Indicator</code> is not showing up. Kindly help.</p>
  
  <pre><code>loading = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
  loading.frame = CGRectMake(round((self.view.frame.size.width - 25) / 2), round((self.view.frame.size.height - 25) / 2), 25, 25);
  
  [self.view addSubview:loading];
  [loading startAnimating];
  NSString *videoStringUrl=[NSString stringWithFormat:@"%@",[[arrayPhotos objectAtIndex:indexPath.row]valueForKey:@"source"]];
  
  dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0), ^{
     dispatch_async(dispatch_get_main_queue(), ^{
        VideoURL=[NSURL URLWithString:videoStringUrl];
        AVURLAsset *sourceAsset = [AVURLAsset URLAssetWithURL:VideoURL options:nil];
        CMTime duration = sourceAsset.duration;
        float seconds = CMTimeGetSeconds(duration);
        if (seconds&lt;4) {
           [self performSegueWithIdentifier:@"Edit" sender:self];
        }
        else
        {
           [self performSegueWithIdentifier:@"Trimmer" sender:self];
        }
  
  });});
  </code></pre>