uitableview

Determine section index from UITableView section header or footer?

I have a multi-section table view, and each section has a button in its footer that should add a new item to that section. The number of sections is not pre-determined or limited, so I can't make a separate selector for each section like "addItemToSection1", etc. I also can't just store the section index in the button's "tag" property s...

How to create iPhone UITableview object by hand

Hi. I'm new to Objective C, and to the iPhone and Mac development environments in general. I like the object model - it takes me back about 20 years to when I first started OO programming in the way that the object methodologies are implemented. Much of the basics seem to have been lost in the ensuing years, and to some extent, this is ...

Detecting which UIButton was pressed in a UITableView

Hi, I have a UITableView with 5 UITableViewCells. Each cell contains a UIButton which is set up as follows: - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { NSString *identifier = @"identifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:identif...

iPhone + cellForRowAtIndexPath

Hello, I am using UITableView in my application. I am using the cellForRowAtIndexPath method of the UITableView control. My question is that why this method cellForRowAtIndexPath is called whenever I scroll the table. ...

NSArray ObjectAtIndex:0 --- get count ?

I have an NSArray that I pass in through a delegate method: - (void)didFinishParsing:(NSArray *)array { [self.myArray addObjectsFromArray:array]; NSLog(@"%@", self.myArray); [self.tableView reloadData]; } There's only one object in the array and I'd like the tableView row count to equal the amount of objects in the array o...

iPhone + UITableView + access cell of particular row

Hello, I am using following method in my application: (UITableViewCell *)tableView:(UITableView *)tblView cellForRowAtIndexPath:(NSIndexPath *)indexPath In this method by using indexPath.row I can get the row number of each row. But I want to actually access the cell at that row and do some formatting on that cell only. Please gui...

iPhone + UITableView + format cells

Hello, I am using following method in my application: - (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.row == 0) { cell.contentView.backgroundColor = [UIColor lightGrayColor]; cell.contentView.alpha = 0.5; } } When I run ...

Error when deleting from an NSFetchedResultsController controlled UITableView outside of the table view

I'm trying to remove an object managed by an NSFetchedResultsController in a UITableView - and I'm attempting to do so from a separate view via add/remove buttons. However, it seems as though controller and table are getting out of whack as I switch between views and I can't quit figure out why. Here is the error I am getting - unfortu...

iPhone: moreController change frame of UITableView

hi all, i want to change the frame of tablview which is within the morecontroller tab of UItabbar please suggest. ...

Searching with UISearchBar in UITableView like iPod App

I am working on making a search bar above the UITableView, like in the iPod App or Mail app. In the iPod App when you start to type in the search bar the navigation controller disappears and the UISearchBar goes to the top. The animation hasn't been too bad to create, but I want to make sure it behaves exactly like the other search bars ...

UITableView crashes on scroll

I have a TableView that builds and draws ok, but then crashes on scrolling the view. I've run through the debugger and it appears that my class level variables are being overwritten somehow so they no longer exist when the titleForHeaderInSection is being called again. The very strange thing is that if I replace the code: -(NSString *...

How do I create a TableView like in network Settings App on the iphone?

Hey, How do i make such a Table view? So if I turn on the switch, 2 cells should be added. I've already tried [tableView numberForRowsInSection:6]; [tableView reloadData]; but this doesn't work as expected :( any ideas? The best thing would be 2 sections the first section contains 5 cells, the second section contains one cell wit...

Shared or sub UIViewController concept in iPhone programming

I have (at least) two views which have the same table view but other stuff around, depending on how the user navigated in the app. Ideally, I would like to have a generic table view and controller which other views and controllers could, for lack of a better term, "include". This would then allow me to encapsulate all the table view and ...

How can I select multiple rows in UITableView

Hi I want to display some selected contacts in a list and then I need a feature to select multiple contacts at a time and then on clicking a button it should trigger an email to the selected contacts. For this I am using UITableView to display the contacts but I am not able to find any way to unable the multiple selection for UITable...

How to realize the same effect like iPhone's homescreen

I want to add some custom buttons and realize the same effect like the iPhone's home screen. What I can think of is to calculate the position of each button and add them to the view. Are there any other ways to do this? e.g. add buttons to the tableview ...

Why doesn't delegate/datasource show in IB?

I have a uiviewcontroller declared like this: @interface RootViewController : UIViewController<UITableViewDelegate, UITableViewDataSource> I've dragged a tableview onto the rootcontroller's view. When clicking the File's Owner, all I see is tableview. Where is the delegate and datasource, which need to be connected for the tableview...

how to initialize UITableView? Both from XIB and programmatically?

Hi all, I have a simple request that I have spent much time on (embarrassingly).. I have sub-classed a UITableView to add some functionality. These new features require things like NSMutableSet which require allocation/initialization. I have put my object's initialization routine in - (id)initWithFrame:(CGRect)frame style:(UITableVie...

Assigning the value of selected row to a variable, iphone SDK

I want to assign the value of indexpath.row of the row which is currently selected, to a variable, How to do that??? ...

White Line across UIToolbar when table view present

I have a programmatically created UIToolbar in a couple of views. In my view that has a table present, there is a white line across the middle of the toolbar, that appears to be where the border of the table cell would be. Is there a way to get rid of this line? Here's a screen shot: Here's the code I'm using to create the toolbar ...

UItableview returns more row?

hi, i have done like - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 3; } tableview is in UITableViewStylePlain.but it shows correctly 3 data on 3 tableview cell.but after that there is empty tableview cells ...but when i declared UITableViewStyleGrouped, it shows only 3 tablev...