Tag: uitableview

Turning a UITableView into an UIImageView

I have got a UITableView, and I want to capture the visible portion of it, and put it into a UIImage. Any way of doing this? EDIT Self-answered below

SearchBar not displaying results until cancel button clicked

I have implemented a UITableView with search bar (and search display) – all works fine, but the table results do not get updated until the search bar cancel button is tapped. Delegate methods: – (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar { // asynchronous request with [self.tableView reloadData] in the connectionDidFinishLoading [self getProductData:searchBar.text]; [searchBar resignFirstResponder]; [self.tableView reloadData]; } – (void)searchBar:(UISearchBar […]

Set UITableViewCell's height depending on the height of a UILabel

I would really appreciate it if you could tell me how I could set the height of a UITableViewCell depending on the height of a UILabel. My current code to set the UILabel’s height is: cell.textLabel.lineBreakMode = UILineBreakModeWordWrap; cell.textLabel.numberOfLines = 0; cell.textLabel.text = [self getItemForKey:kSummary]; cell.textLabel.font = [UIFont systemFontOfSize:15]; cell.textLabel.textColor = [UIColor colorWithRed:54.0f/255.0f green:54.0f/255.0f blue:54.0f/255.0f […]

Core Data and UITableView Practices/Questions

Im new with iPhone programming and for that matter CoreData. I was just wondering about some general practices and ways of doing things. I am trying to add/load entities from CoreData to a UITableView. So in the AppDelegate I am loading an NSArray of entities (NSManagedObjects) on didfinishlaunchingwithoptions and populating the NSArray for my table […]

Using container view as a Dashboard

i have used container view on the right side and i used another view controller as a child view controller to this container view. i want to change the data appearing in that container view. FYI i m loading the EKEventViewController in that container view. So obviously the tableview contains the events from the calendar. […]

UITableViewCell reorganize subviews when the 'delete' button appears

Does anyone knows any method to resize subviews(I.E. UILabelView) when Delete button appears. There could be two methods: 1.Capture a notification, if there’s one, when the button appears in the UITableViewCell 2.Tell the framework re-arange it automatically.

load Game Center friends and their scores into UITableView

So I was wondering after reading the apple docs(https://developer.apple.com/library/ios/documentation/GameKit/Reference/GKLeaderboard_Ref/Reference/Reference.html#//apple_ref/occ/instp/GKLeaderboard/category) how would one create a UITableView and fill it with the localPlayers Game Center friends and there scores in a specific leaderboard. I know how to get the friends list and friends scores individually by using the loadScoresWithCompletionHandler: method. Edit: So far I got this to […]

UITableView slightly goes up when keyboard hides

I am using UITableView (chatTable) along with UITabBar (chatTabBar) and one textField inside imageView. I am using autolayout. I used the following code to change the views when keyboard appears and disappears. – (void)keyboardWasShown:(NSNotification*)aNotification { NSDictionary* info = [aNotification userInfo]; // get animation info from userInfo NSTimeInterval animationDuration; CGRect keyboardFrame; [[info objectForKey:UIKeyboardAnimationDurationUserInfoKey] getValue:&animationDuration]; [[info objectForKey:UIKeyboardFrameBeginUserInfoKey] […]

UITableViewCell subclass

I have this code segment: if (cell == nil) { CGRect cellFrame = CGRectMake(0,0,300,250); cell = [[UITableViewCell alloc] initWithFrame:cellFrame reuseIdentifier:CellTableIndetifier]; CGRect nameLabelRect = CGRectMake(0, 5, 70, 20); UILabel* nameLabel = [[UILabel alloc] initWithFrame:nameLabelRect]; nameLabel.textAlignment = NSTextAlignmentCenter; nameLabel.text = @”Name”; nameLabel.font = [UIFont boldSystemFontOfSize:12]; [cell.contentView addSubview: nameLabel]; CGRect colorLabelRect = CGRectMake(0, 25, 70, 20); UILabel* colorLabel […]

how to use UItableViewCell reuseIdentifier

I want to use UITableviewCell reuse,I have a custom UITableViewCell and using ARC,my UITableViewCell is different . my code is: – (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { PostCount *post=[listArr objectAtIndex:indexPath.row]; static NSString *CellIdentifier = @”TimeLineViewCell”; TimeLineViewCell *cell = (TimeLineViewCell*)[tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(cell==nil){ cell = [[TimeLineViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@”CellIdentifier11″]; } cell.tag=indexPath.row+1000; cell.lab_time.text=[ModelClass intervalSinceNow:post.when btime:0]; cell.delegate=self; [cell setViewStyle:post]; […]