Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

cvbfgt18

macrumors newbie
Original poster
May 1, 2014
6
0
I was working in Xcode 4.6 and have a UItableview set up where the cells are populated from an array. When working in 4.6, the view behaved perfectly and was just how I liked it. After the update to 5.1.1, scrolling seems to have been enabled on the table view, the table view is loaded from the bottom of the view and the 3 populated cells at the top are not visible. Sometimes the view will rubber band and not allow me to scroll all the way back up to the top, and sometimes it won't rubber band and will let me. I am fairly new to this, but have tried messing around with auto layout, but to no avail. I've tried posting to stack overflow also, but so far no luck.

Code in my .m

Code:
- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];


_Manufacturers = @[@"1",
               @"2",
               @"3"];

}

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
// Return the number of rows in the section.
return _Manufacturers.count;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath            *)indexPath
{
static NSString *CellIdentifier = @"TableCell";
TableCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier   forIndexPath:indexPath];

// Configure the cell...

int row = [indexPath row];

cell.TitleLabel.text = _Manufacturers[row];


return cell;
}
 
Haven't pored through your code, but it may be as simple as checking the box for "Adjusts Scroll View Insets" on the view controller in your storyboard (assuming you are using them). This is due to the fact that in iOS 7, the view property of View Controllers is set to extend underneath top and bottom bars. Therefore, your top 3 rows could be covered if you have a navigation bar. If you enable the setting I mentioned, it will adjust your table view (subclass of UIScrollView) so that the insets make all of your rows properly positioned when scrolling
 
Thanks for the reply. Unfortunately, the scroll inset box was already checked. It is also worth noting that the header and status bar do not appear at the top.
 
sorry about the late reply, I didn't have access to my mac. Here is the screenshot:

9VnTILs.png
 
Sorry for the double post/bump. But I have found that this issue is not just in this project. I remade a new project without any code with a table view embedded in a navigation controller and the table view loads at the bottom of the view. I have to scroll up to get to the top of the view.
 
Hmm, seems to me that you have a corrupted system. I would start by trying the same things under a different account. If it continues, I would suspect an OS-level corruption and you may need to diagnose the cause of the corruption, fix that (hopefully) and reinstall the OS.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.