Home:ALL Converter>Updating UITableViewDelegate not on draw

Updating UITableViewDelegate not on draw

Ask Time:2012-12-08T00:10:32         Author:wanovak

Json Formatter

I have a class definition as follows:

@interface ClassViewController : ContentViewController <UITableViewDelegate,
UITableViewDataSource> {
    IBOutlet UITableView* mTableView;
    NSMutableArray *feeds;
    NSMutableData *responseData;
}
@property (nonatomic, retain) UITableView* mTableView;
@property (nonatomic, strong) NSMutableArray* feeds;
@property (nonatomic, strong) NSMutableData* responseData;

I'm trying to load contents after a JSON request. However, the table doesn't update with the new contents until after I manipulate the screen (e.g., scroll down).

I am using [self->mTableView reloadData]; to no effect. Also, in:

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section

I'm setting:

self.mTableView = tableView;

Otherwise the results don't propagate to the table at all.

Is there something I'm missing, or should that self.mTableView definition be placed elsewhere?

I'm new to Objective-C and iOS development, so if I'm leaving something out, please let me know.

Author:wanovak,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/13766759/updating-uitableviewdelegate-not-on-draw
yy