Note that there are some explanatory texts on larger screens.

plurals
  1. POSubview presentation delayed
    primarykey
    data
    text
    <p>In my UITableViewController subclass I want to prepare the tabular data and reload the table after the view has already appeared (the table therefore initially loads empty). In my app delegate I have methods to produce and remove an activity screen. My problem seems to be that the activity view presentation is being delayed until after the reloadData call has been made. I proved this by removing the hideActivity line and sure enough my activity view appeared simultaneously with the reloading of the table. Here's the viewDidAppear for my view controller...</p> <pre><code>- (void)viewDidAppear:(BOOL)animated { [super viewDidAppear:animated]; [(AppDelegate *)[[UIApplication sharedApplication] delegate] showActivity]; [self prepare]; [self.tableView reloadData]; [(AppDelegate *)[[UIApplication sharedApplication] delegate] hideActivity]; } </code></pre> <p>I'm assuming this may have to do with the views not redrawing mid-method, but don't remember this happening before. Any ideas?</p> <p>...although I know they work, here's my activity methods. Maybe the way I'm doing these allows for some sort of delayed appearance...</p> <pre><code>- (void)showActivity { self.activityView = [[UIView alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 320.0f, 480.0f)]; self.activityView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.75f]; UIActivityIndicatorView *spinner = [[[UIActivityIndicatorView alloc] initWithFrame:CGRectMake((320.0f / 2.0f) - (37.0f / 2.0f), (480.0f / 2.0f) - (37.0f / 2.0f) - (20.0f / 2.0f), 37.0f, 37.0f)] autorelease]; spinner.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhiteLarge; [spinner startAnimating]; UILabel *label = [[[UILabel alloc] initWithFrame:CGRectMake(0.0f, spinner.frame.origin.y + spinner.frame.size.height + 10.0f, 320.0f, 30.0f)] autorelease]; label.textAlignment = UITextAlignmentCenter; label.text = @"Working"; label.textColor = [UIColor whiteColor]; label.backgroundColor = [UIColor clearColor]; [self.activityView addSubview:label]; [self.activityView addSubview:spinner]; [self.window addSubview:self.activityView]; } - (void)hideActivity { [self.activityView removeFromSuperview]; [self.activityView release]; } </code></pre>
    singulars
    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. 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