Tag: uitableview

Why does reloadRowsAtIndexPaths not work for iOS 5.0?

SOLVED: See my answer (and possible explanation) below. I’m making an app that works on iOS 5.1 devices, but not on iOS 5.0 devices. Here is the trouble code that works on 5.1 but NOT on 5.0: – (void) expandIndexPath: (NSIndexPath *) indexPath afterDelay: (BOOL) delay { NSIndexPath *oldSelectedIndexPath = [NSIndexPath indexPathForRow:self.mySelectedIndex inSection:0]; self.mySelectedIndex= indexPath.row; […]

How to hide tab bars and show full tableview on screen?

In my app’s implementation, I have a tabbar controller with 5 different tabs. After I hide my tab bar via the following code – (void)hideTabBar { for(UIView *view in self.tabController.view.subviews) { if([view isKindOfClass:[UITabBar class]] || [view isKindOfClass:[UIButton class]]) { view.hidden = YES; } } } I still see the bottom portion of my tableview obscured […]

Bottom-up UITableView with different item height scroll to end

I have a UITableView with different item height. At the beginning the user should see the last items (that are at the end of the list) and should be able to scroll manually to the top. To get to the end of the list I use [tableView scrollToRowAtIndexPath:lastIndexPath atScrollPositionBottom animated:NO] on the main thread after […]

How is backgroundColor handled for UIView in Objective_C?

I have been playing with some of Apple’s example code for customizing UITableViewCells. I have run into some weird behavior that has left me completely confused about how backgroundColor works. The following code is a much reduced version of Apple’s example custom UIView within custom UITableViewCell. The init function sets the background color to purple […]

UITableView reloadData EXC_BAD_ACESS code=2

I have this code for loading the UITableView: – (int)numberOfSectionsInTableView:(UITableView *)tableView { if (tableView == self.peopleTableView) return [self.people count]; else return [[[self.scheduleDays objectAtIndex:self.dayInt] periods] count]; } – (int)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { if (tableView == self.peopleTableView) return [[self.people objectAtIndex:section] count]; else return 1; } – (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section { if (tableView == self.peopleTableView) return [self.headers […]

The best way to load, save and reload data

I think I have got a little performance problem with my iPhone app. I like to show you how I load Data from the Internet, store them on the Phone and reload them to print it out on a table view. I have several modules on the app so I hope it is ok, if […]

sectioned tableview index selection highlighting

I feel this should be a simple property, but for the life of me I’ve searched and cannot find the answer. I have a tableview index to the right of my table. When selected, it grays out everything. I’d like to mimic the iPod app, whereby when the index itself is selected, it is semi-transparent […]

White Separator Above Table Section Headers

I’m having a really weird issue with table view separators. I have set the separator color to a dark gray which works great below the cells, but for some reason, there is a white separator before my section header (see the screenshot, above November). When I set the separator style to none, the line disappears […]

viewForHeaderInSection disappears when scrolling

I am using a custom header view in my UITableView, but as soon as i begin scrolling down the header disappears instead of staying in place like with the default headers. And it’s not scrolling off the screen either, just completely disappering. viewForHeaderInSection is still being called but the drawRect method of my custom header […]

UISearchController searchBar don't disappear when push viewcontroller

I’m using a UISearchController inside ma UIViewcontroller that contains a UITableView, I do this in viewDidLoad: self.searchController = [[UISearchController alloc] initWithSearchResultsController:nil]; self.searchController.delegate = self; self.searchController.searchResultsUpdater = self; self.searchController.searchBar.delegate = self; self.searchController.dimsBackgroundDuringPresentation = NO; self.searchController.hidesNavigationBarDuringPresentation = NO; self.definesPresentationContext = NO; when I push a button in the navbar i do this: self.tableView.contentOffset = CGPointMake(0, 0 – […]