Xcode Table View Stuck After Update to 5.1.1

Discussion in 'iOS Programming' started by cvbfgt18, May 1, 2014.

  1. cvbfgt18 macrumors newbie

    Joined:
    May 1, 2014
    #1
    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;
    }
     
  2. waterskier2007 macrumors 68000

    waterskier2007

    Joined:
    Jun 19, 2007
    Location:
    White Lake, MI
    #2
    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
     
  3. cvbfgt18 thread starter macrumors newbie

    Joined:
    May 1, 2014
    #3
    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.
     
  4. waterskier2007 macrumors 68000

    waterskier2007

    Joined:
    Jun 19, 2007
    Location:
    White Lake, MI
    #4
    could you give us a shot of your storyboard with that view controller highlighted and the properties inspector open?
     
  5. cvbfgt18 thread starter macrumors newbie

    Joined:
    May 1, 2014
    #5
    sorry about the late reply, I didn't have access to my mac. Here is the screenshot:

    [​IMG]
     
  6. cvbfgt18 thread starter macrumors newbie

    Joined:
    May 1, 2014
    #6
    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.
     
  7. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #7
    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.
     
  8. cvbfgt18 thread starter macrumors newbie

    Joined:
    May 1, 2014
    #8
    Thanks! Should I try a clean Xcode reinstall first?
     
  9. dejo Moderator

    dejo

    Staff Member

    Joined:
    Sep 2, 2004
    Location:
    The Centennial State
    #9
    First, I would check to see if you have the same issue under a different account.
     

Share This Page