Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dantastic

macrumors 6502a
Original poster
Jan 21, 2011
572
678
Hi again,

I'm still trying to get my head around IB.

I am currently creating UITableViewCells programmatically.

In a UIView I have a UITableView
The cells have a label and 8 buttons. Each button has a different image for it's normal state.

If a button inside the UITableViewCell gets pressed I've a function to change the image for it's normal state.

This is working.


In my quest to understand this better I want to do this slightly differently.

I have created a custom UITableViewCell, with nib. I'm loading it as:
Code:
TeamSelectionCell *cell = [self.tableView dequeueReusableCellWithIdentifier:TeamSelectionCellIdentifier];
			if (cell == nil) {
				NSArray *objectList = [[NSBundle mainBundle] loadNibNamed:@"TeamSelectionCell" owner:self options:nil];
				for (id currentObject in objectList) {
					if([currentObject isKindOfClass:[UITableViewCell class]]){
						cell = (TeamSelectionCell *)currentObject;
						break;
					}
				}								
			}

It loads. I've been able to get the buttons to talk to the correct function when pressed. The nameLabel is correct as well for each cell.

How can I change the background image of the buttons? I have been looking for hours but I haven't been able to find anything that explains how you can modify objects within a custom uitableviewcell like this.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.