Search Results

Search found 1119 results on 45 pages for 'tableview'.

Page 19/45 | < Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >

  • problem with IBoutlet UITableView connection

    - by ideafactory
    Hi,I'm having a problem with IBoutlet UITableView connection. It seems that the IBOutlet isn't connected to the TaleView. I set the delgate and the datasource to the files owner and set the iboutlet to the tableview in the nib. The tableview is well initialized. I just want to do some reloadData and it's not working. I try to do some deselectRow just to see if it isn't reloadData problem but it doesn't deselect so i assume that the iboutlet isn't associated with my tableview. This table view is in a viewcontroller that is called as a modalViewController. Here is some code: My .h file: @interface AddEditProjectsViewController : UIViewController <UITableViewDelegate, UITableViewDataSource, UIActionSheetDelegate, UIImagePickerControllerDelegate, UINavigationControllerDelegate, UITextViewDelegate, UIAlertViewDelegate>{ IBOutlet UITableView *addEditProjectTable; } @property (nonatomic, retain) IBOutlet UITableView *addEditProjectTable; @end My .m file: - (void)viewWillAppear:(BOOL)animated { (...) [addEditProjectTable reloadData]; [super viewWillAppear:animated]; Thanks for any help! :)

    Read the article

  • Can somebody explain this Objective C method declaration syntax

    - by Doug R
    I'm working through an iPhone development book* without really knowing Objective C. For the most part I'm able to follow what's going on, but there are a few method declarations like the one below that I'm having a bit of trouble parsing. For example: - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger) section { return [self.controllers count]; //controllers is an instance variable of type NSArray in this class } It looks this is a method called numberOfRowsInSection, and it returns an NSInteger, and takes an NSInteger as a parameter which is locally called 'section'. But I don't understand all the references to tableView, or why this takes a parameter when it is not used within the method. Can somebody clarify this? Thanks. *p. 258, Beginning iPhone 3 Development, by Mark and LaMarche, published by Apress

    Read the article

  • Show blank UITableViewCells in custom UITableView

    - by Typeoneerror
    I am trying to customize a UITableView. So far, it looks good. But when I use a custom UITableViewCell sub-class, I do not get the blank table cells when there's only 3 cells: Using the default TableView style I can get the repeating blank rows to fill the view (for example, the mail application has this). I tried to set a backgroundColor pattern on the UITableView to the same tile background: UIColor *color = [UIColor colorWithPatternImage:[UIImage imageNamed:@"score-cell-bg.png"]]; moneyTableView.backgroundColor = color; ...but the tile starts a bit before the TableView's top, so the tile is off once the actual cell's are done displaying: How can I customize my tableview but still keep the blank rows if there's less rows than fill a page?

    Read the article

  • qtableview (libqt) how do I correctly create a QModelIndex

    - by Chris Camacho
    I'm trying to enter edit mode on a specific cell like this void MainWindow::on_addButton_released(void) { tm->addRow(); tableView->scrollToBottom(); int ec=tm->firstWritableColumn(); int r=tm->rowCount(QModelIndex()); QModelIndex id = tm->index(r, ec, QModelIndex()); tableView->setCurrentIndex(id); tableView->edit(id); qDebug() << "row:" << r << " col:" << ec << "index:" << id; } my model creates an index like this QModelIndex TableModel::index(int row,int column,QModelIndex parent) const { Q_UNUSED(parent); return createIndex(row,column,0); } the debug output looks like this row: 9 col: 1 index: QModelIndex(9,1,0x0,TableModel(0xbf3f50) ) I'm fairly sure that the index is somehow invalid as setCurrentIndex doesn't seem to be working

    Read the article

  • Items mixed up after scrolling in UITableView

    - by jean
    When I scroll in my UITableView, the cells become mixed up. What am I doing wrong? This is my method: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"Cell"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if (cell == nil) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; } [cell insertSubview:[itemArray objectAtIndex:indexPath.row] atIndex:indexPath.row]; return cell; } Update It now works by using cell.contentView, but now when I select an item, the selected one is overlayed with the content of a different cell...

    Read the article

  • Add UIView behind UITableView in UITableViewController code

    - by Drew C
    I would like to use a fixed image as the background in a simple grouped table view in my iPhone program. Unfortunately, no matter what I do, the background is always solid white. I have followed several supposed solutions on this site and others to no avail. Here is the relavant code in the viewDidLoad method of the table view controller class (note, this code uses a solid blue color rather than an image for simplicity's sake): self.tableView.opaque = NO; self.tableView.backgroundColor = [UIColor clearColor]; UIView *backgroundView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 480)]; backgroundView.backgroundColor = [UIColor blueColor]; [self.tableView.window addSubview:backgroundView]; [backgroundView release]; I suspect that I am not positioning the backgroundView view in the right place. I have tried sendToBack:, bringToFront:, and others but I always just get a white background. Is it possible to do this from within the UITableViewController? Must I use Interface Builder?

    Read the article

  • UITableViewCell is 1px shorter in didSelectRowAtIndexPath than cellForRowAtIndexPath

    - by Calvin L
    I have a UITableViewCell that I create in tableView:cellForRowAtIndexPath:. In that method I call: UITableViewCell *cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:nil] autorelease]; NSLog(@"Cell height: %f", cell.contentView.frame.size.height); This gives me a return value of 44.000000. Then in my tableView:didSelectRowAtIndexPath: method, I call: UITableViewCell *cell = [tableView cellForRowAtIndexPath: indexPath]; NSLog(@"Cell height: %f", cell.contentView.frame.size.height); And this gives me a return value of 43.000000. Aren't they the same cell? What gives?

    Read the article

  • Animating a font size change in a UITableView

    - by nickthedude
    Hey Simple little app for educational purposes, its a simple uitableview and I want users to be able to use a uislider to adjust the font size as needed. The code I have now works to change the font but only when the view is updated, ie when i pull up or down the table view to reveal other cells. I'd like the font change to be reflected immediately as a user moves the uislider if possible, here's the code that I have working half way: -(UITableViewCell *) tableView: (UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *) indexPath { static NSString *SimpleTableIdentifier = @"SimpleTableIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier: SimpleTableIdentifier]; if (cell == nil) cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier: SimpleTableIdentifier] autorelease]; NSUInteger row = [indexPath row]; cell.text = [listData objectAtIndex:row]; UIImage *image = [UIImage imageNamed:@"star.png"]; cell.font = [UIFont systemFontOfSize:[fontSlider value]]; cell.image = image; return cell; }

    Read the article

  • Frame of viewForHeaderInSection is always the same size

    - by gabac
    - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { if(section != 0) { UIView *view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 100, 30)]; view.backgroundColor = [UIColor redColor]; return view; [view release]; } else { return tableView.tableHeaderView; } } This is my implementation of viewForHeaderInSection but whatever frame I make it's always showing me the same red frame. Do you see any problem with my code? Can't post the picture because of my rep but here is the link ;-) http://img638.imageshack.us/img638/3350/bildschirmfoto20100315uq.png

    Read the article

  • UITableView via NSFetchedResultsControllerDelegate, select first record by default?

    - by deafgreatdane
    I have a UITableView that gets populated from CoreData via a controller that implements NSFetchedResultsControllerDelegate. How can I have it automatically select the first row (and fire the tableView:didSelectRowAtIndexPath message)? The tableview is used for a variety of predicate queries, so I'm suspicious of solutions that work on the UIViewController lifecycle (viewDidLoad, etc), but I'm new to the platform, so I'm open. I've tried a variety of things, but I'm not sure where in the call stack to put it. I've tried calling cell.selected = true inside tableView:cellForRowAtIndex: method, but that just ends up turning the cell black (and doesn't fire the selected callback method) A tagent question, with all the delegating and core data protocols, does it imply asynchronous data fetch (multiple threads)? Or is the NSFetchedResultsController calling all its related methods in the same thread? Maybe I'm just scared that if it is async, there would be race conditions that would be tough to troubleshoot later.

    Read the article

  • iPhone equivalent of Application.DoEvents();

    - by BahaiResearch.com
    iPHone: We use MonoTouch, but Obj-C answers are ok. My singleton domain object takes a while to get all the data so it runs internally parts of the fetch in a thread. I need to inform the UI that the domain is done. Currently I do this. Is there a better way? In WinForms I would call Application.DoEvents() instead of Thread Sleep. PlanDomain domain = PlanDomain.Instance (); while (domain.IsLoadingData) { Thread.Sleep (100); //this is the main UI thread } TableView.Hidden = false; TableView.Source = new TableSource (this); TableView.ReloadData ();

    Read the article

  • Accessory view in UITableView: view doesn't update

    - by Kamchatka
    I'm trying to add checkmarks to items when the user select rows in a table view. However, the view is not refreshed and the checkmarks do no show up: - (void)tableView:(UITableView *)tv didSelectRowAtIndexPath:(NSIndexPath *)indexPath { UITableViewCell* oldCell = [self tableView:tv cellForRowAtIndexPath:[NSIndexPath indexPathForRow:selectedIndex inSection:0]]; oldCell.accessoryType = UITableViewCellAccessoryNone; if (indexPath.section == 0) { selectedIndex = indexPath.row; } UITableViewCell* newCell = [self tableView:tv cellForRowAtIndexPath:indexPath]; newCell.accessoryType = UITableViewCellAccessoryCheckmark; [tv deselectRowAtIndexPath:indexPath animated:NO]; } What could be a reason for that?

    Read the article

  • Why does Custom UITableViewCell *sometimes* cause an NSInvalidArgumentException?

    - by Wayne Hartman
    I have created a custom UITableViewCell, but when I dequeue the cell, sometimes it throws an NSInvalidArgumentException: [UITableViewCell nameLabel]: unrecognized selector sent to instance 0x3b4e7f0 Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[UITableViewCell nameLabel]: unrecognized selector sent to instance 0x3b4e7f0' Now, my custom UITableViewCell does have an attribute nameLabel, so I am confused why it is throwing this error. Below is the code I use to dequeue the cell: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSUInteger row = [indexPath row]; CTMenuItemVO* key = [[[self retrieveCartItems] allKeys] objectAtIndex:row]; NSNumber* quantity = [[self retrieveCartItems] objectForKey:key]; static NSString* SectionsTableIdentifier = @"SectionsTableIdentifier2"; OrderItemCell* cell = (OrderItemCell*)[tableView dequeueReusableCellWithIdentifier: SectionsTableIdentifier]; if (cell == nil) { NSArray* topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"OrderItemCell" owner:nil options:nil]; for(id currentObject in topLevelObjects) { if ([currentObject isKindOfClass:[UITableViewCell class]]) { cell = (OrderItemCell*) currentObject; break; } } } cell.nameLabel.text = key.Name; cell.qtyLabel.text = [quantity stringValue]; return cell; }

    Read the article

  • iPhone/Obj-C - Archiving object causes lag

    - by Dylan
    Hi I have a table view, and when I delete a cell I am removing an item from an NSMutableArray, archiving that array, and removing the cell. However, when I do this, it is causing the delete button to lag after I click it. Is there any way to fix this? // Override to support editing the table view. - (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { int row = [indexPath row]; [savedGames removeObjectAtIndex:row]; [tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade]; //this line causing lag [NSKeyedArchiver archiveRootObject:savedGames toFile:[self dataFilePath]]; } } Thanks

    Read the article

  • Weird Animation when inserting a row in UITableView

    - by svveet
    I have tableview which holds a list of data, when users press "Edit" i add an extra row at the bottom saying "add new" - (void)setEditing:(BOOL)editing animated:(BOOL)animated { [super setEditing:editing animated:animated]; NSArray *paths = [NSArray arrayWithObject: [NSIndexPath indexPathForRow:1 inSection:0]]; if (editing) { [[self tableView] insertRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationTop]; } else { [[self tableView] deleteRowsAtIndexPaths:paths withRowAnimation:UITableViewRowAnimationTop]; } } and of course the UITableView transform with animation, but weird thing is the row before the row that i just added, has different animation than all others. all rows perform "slides in" animation, but that 2nd last one did a "fade in" animation. and i didnt set any animation on the 2nd last row (or any other row), and if i didnt add the new row in, the animation slides in as normal when i switch to editing mode. somehow i cant find an answer, i check with contact app on my phone, it didnt have that weird animation as i have, when they adding a new row on editing mode. Any help would be appreciated. Thanks

    Read the article

  • Why Can't I import a UITableViewCell subclass ? That's weird....

    - by user320064
    It's like this, I created a UITableViewCell subclass called NewsItemCell, then I wanna use it in my FirstViewController.m, then I tried to import it, but the compiler keeps telling me this Below is my code, it is driving me mad, thank you if you can help. import "NewsItemCell.h" import "FirstViewController.h" @implementation FirstViewController @synthesize computers; (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"NewsItemCellIdentifier"; NewsItemcell *cell = (NewsItemcell *)[tableView dequeueReusableCellWithIdentifier: CellIdentifier]; if (cell == nil) { NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"NewsItemCell" owner:self options:nil]; for (id oneObject in nib) if ([oneObject isKindOfClass:[NewsItemcell class]]) cell = (NewsItemcell *)oneObject; } NSUInteger row = [indexPath row]; NSDictionary *rowData = [self.computers objectAtIndex:row]; cell.newsTitle.text = [rowData objectForKey:@"Color"]; cell.newsDate.text = [rowData objectForKey:@"Name"]; return cell; } Jason

    Read the article

  • Custom nib UITableViewCell height

    - by Chuck
    I've created a custom UITableViewCell in IB, linked it to the root view controller's property for it, and set it up in CellForRowAtIndexPath. But the height of my drawn cells doesn't match what I setup in IB, advice? Here's some screenshots and the code. - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *AddressCellIdentifier = @"AddressCellIdent"; UITableViewCell *thisCell = [tableView dequeueReusableCellWithIdentifier:AddressCellIdentifier]; if (thisCell == nil) { [[NSBundle mainBundle] loadNibNamed:@"AddressCell" owner:self options:nil]; thisCell = addressCell; self.addressCell = nil; } return thisCell ; } addressCell is a @property (nonatomic, assign) IBOutlet UITableViewCell *addressCell;, and is linked up in IB to the file's owner (the table view controller). I'm using the example from Apple's table view programming guide.

    Read the article

  • UITableViewCell select even doesn't work

    - by saimun
    I had a page control(UIPageControl) on a view (UIViewController) with table view (UITableView) on each page, each page have own table and can go to different view controller. i add the codes in "didSelectRowAtIndexPath" which can go to next level, is works perfect when i test it in a table view by itself, but it doesn't works when i have page controller with it. - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; if (pageNumber == 0) { PicturesViewController *picturesView = [[PicturesViewController alloc] init]; [self.navigationController pushViewController:picturesView animated:YES]; [picturesView release]; } else if (pageNumber == 1) { PictureDetailViewController *pictureDetailView = [[PictureDetailViewController alloc] init]; [self.navigationController pushViewController:pictureDetailView animated:YES]; [pictureDetailView release]; } else if (pageNumber == 2) { MessagesViewController *messagesView = [[MessagesViewController alloc] init]; [self.navigationController pushViewController:messagesView animated:YES]; [messagesView release]; } } here is the code, if view directly to this table view this code is work, how can i make it work under the pagecontrol??

    Read the article

  • Cell contents changing after I select rows present outside its height?

    - by wolverine
    I have set the size of the tableView that I show as the popoverController as 4*rowheight. And I am using 12cells in the tableView. Each cell contains an image and a label. I can see all the cells by scrolling. Upto 5th cell its ok. After th2 5th cell, the label and the image that I am using in the first four cells are being repeated for the remaining cells. And If I select the cell, the result is accurately shown. But when I again take the tableView, the image and labels are not accurate even for the first 5 cells. All are changed but the selection is giving the correct result. Did anyone got the idea what the problem is??

    Read the article

  • Iphone Orientation Change

    - by SG
    I am trying to implement orientation change functionality in my application.I have overrided -(void) didRotateFromInterfaceOrientation:(UIInterfaceOrientation)fromInterfaceOrientation. In this method i change the frame size of the tableview(including the position of the cell items) which is present in the view. The tableview Details: Added to the view as [self.view addSubView:tableView] in the viewDidLoad method of the view controller; Cell item (row) has a textfield and a segmented control. There are 10 cells in the table view and in landscape mode only 2 cells are visible and in potrait mode 5 cells are visible. I have implemented scroller. Issue: Certain times on changing the orientation to potrait mode certain segmented controls in the cell are not rendered (Not shown at all). This happens when i am viewing the last couple of cells in the landscape mode and i change the orientation to potrait mode.

    Read the article

  • How to perform a cell deselection when a user returns to a table view?

    - by Panagiotis Korros
    I am using a UITableView to display a list of cells, when the user selects a cell then a new view appears by using the following code: - (void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [self.navigationController pushViewController: detailsViewController animated: TRUE]; } By using the code above, the view is displayed correctly, but when I return back to the root table view, then the cell is still selected. I noticed, in many sdk examples, that the cell is deselected (with a nice animation) when the root view is poped pack, but I could not find the code that implemented this feature in any of the examples. I know that I can use: [tableView deselectRowAtIndexPath:indexPath animated: YES]; to implement this, but I am very curious on how these examples do it without using any code. Any ideas?

    Read the article

  • Wrong cells values of UITableView per section

    - by androniennn
    I have a UITableView that has a different rows count in every section. I made that code to try achieving a correct result: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier= @"channel"; ChannelsCell *cell= [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; if(!cell) { cell =[[ChannelsCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]; } NSInteger rowsCountSection = [[arrayofChannelsCount objectAtIndex:indexPath.section] intValue];// this variable has the number of rows of every section NSUInteger pos = indexPath.section*count+ indexPath.row; cell.channelName.text=[arrayofChannelName objectAtIndex:pos]; return cell; } I'm pretty sure that's a mathematic problem. Thank you for helping.

    Read the article

  • willSelectRowAtIndexPath Question....

    - by treasure
    How do you add a second section (SECOND_SECTION) here to be excluded from selection when editing? (NSIndexPath *)tableView:(UITableView *)tableView willSelectRowAtIndexPath:(NSIndexPath *)indexPath { NSIndexPath *rowToSelect = indexPath; NSInteger section = indexPath.section; BOOL isEditing = self.editing; // If editing, don't allow notes to be selected // Not editing: Only allow notes to be selected if ((isEditing && section == ONE_SECTION) || (!isEditing && section != ONE_SECTION)) { [tableView deselectRowAtIndexPath:indexPath animated:YES]; rowToSelect = nil; } return rowToSelect; } it s being driving me nuts... thanks

    Read the article

  • iPhone - Adding new sections and rows into UITableView

    - by Dev
    I have a UITableView to display a list of data. The list will contain images, so I am loading images with lazy loading. Now I don't want to load the whole list at a time. The loading should be like, first it should load some 10 records and when we scrolling down to the tableview, it should automatically load next 10 records as on. For this I need to add rows when I am scrolling to bottom. The tableview may contain different sections. So how can I add new rows and new sections at the end of the tableview while scrolling down?

    Read the article

  • UITableView cell selection disabled and UITableViewHeader Enabled

    - by andyPaul
    I am adding a my header view to self.tableView.tableHeaderView=headerView; This tableView has 10 cells. I want to disable the cell Selection but, headerView touch events must be enabled. To achieve this I added the following code: self.tableView.userInteractionDisabled=YES; self.headerView.userInteractionDisabled=NO; self.headerView.exclusiveTouch=YES; Where I am wrong? Basic idea of implementation is , If headerView is enabled then cell selection is disabled and vice-versa.

    Read the article

< Previous Page | 15 16 17 18 19 20 21 22 23 24 25 26  | Next Page >