Note that there are some explanatory texts on larger screens.

plurals
  1. POsubview not showing on already displayed view
    primarykey
    data
    text
    <p>I'm new on iPhone development and I'm stuck with a subview not showing after the controller is notified to refresh these items.</p> <p>So, it's my main page showing, showing the 3-last items of a newsfeed at the bottom. The view controler handles the loading of the newsfeed (in a NSArray). When loading the page, the newsfeed is correctly displayed as a subview of the main view. However, when the view already exists (for example just after login for the first time), the newsfeed is not displayed, or refresehed. The avatar images that are fetched from internet asynchronously are displayed correctly. But not the labels.</p> <p>The debug shows that the code is correctly executed...but nothing happens...</p> <p>Here is the code handling the notification and refresh. </p> <p>I'm sure I miss something stupid but cannot put my finger on it. Does an UILabel or UIImage of the subview can avoid the element to be refreshed?</p> <p>Thanks for the help!</p> <p>The controler code</p> <pre><code>-(void) handleRefreshNewsfeed:(NSNotification*)notification{ if (self.newsfeedMostRecentDate == nil){ NSDateFormatter* dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyyMMdd HH:mm"]; self.newsfeedMostRecentDate = [dateFormatter dateFromString:@"20100101 00:00"]; [dateFormatter release]; } NSArray * newsfeed = [cdw getNewsfeedForUser:self.currentUser andLimit:self.newsfeedLimit]; if ([newsfeed count] &gt; 0){ self.newsfeedMostRecentDate = [(Newsfeed *)[newsfeed objectAtIndex:0] posted]; if ([self.view isKindOfClass:[MenuView class]]){ [(MenuView *)self.view refreshNewsfeed:newsfeed]; } } </code></pre> <p>}</p> <p>The main view declaration:</p> <pre><code>@interface MenuView : UIView { MenuNewsfeed * newsFeedView; } @property(nonatomic, retain) IBOutlet MenuNewsfeed *newsFeedView; -(void)displayNewsfeed:(NSArray *)newsfeed; -(void)refreshNewsfeed:(NSArray *)newsfeed; </code></pre> <p>The main view code :</p> <pre><code>-(void)displayNewsfeed:(NSArray *)newsfeed{ [self.newsFeedView setCurrentUser:currentUser]; [self.newsFeedView displayNewsfeed:newsfeed]; [UIView animateWithDuration:0.75f delay: 0.0 options: UIViewAnimationOptionCurveEaseIn animations:^{ self.newsFeedView.alpha = 1.0; } completion:^(BOOL finished){ //nothing } ]; } -(void)refreshNewsfeed:(NSArray *)newsfeed{ if ([self.newsFeedView.newsfeed count] &gt; 0){ [UIView animateWithDuration:0.50f delay: 0.0 options: UIViewAnimationOptionCurveEaseIn animations:^{ self.newsFeedView.alpha = 0.0; } completion:^(BOOL finished){ // [self displayNewsfeed:newsfeed]; } ]; }else { [self displayNewsfeed:newsfeed]; } } </code></pre> <p>Michael</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. 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