I am having a heck of time with this. Using storyboard, I created a table view controller with a static cell that contains a UITextField to allow for user input. When the user is finished, I want to retrieve the contents of the text field.
Here is what I did:
- Created a subclass of
UITableViewCellnamedSingleLineFieldTableViewCell - Added
IBOutlet UITextField *textField;to the subclass and declared it as a property (nonatomic, retain) and synthesized it. Added
IBOutlet SingleLineFieldTableViewCell *cellNamed;to the owning table view controller, and declared it as a property (nonatomic, retain) and synthesized it.In storyboard, I have a table view controller with static cells. One of the cells is the custom cell, which is declared as
SingleLineFieldTableViewCelland owns aUITextField. It is also assigned a cell identifier.- I attached referencing outlets of the table view cell and the text field to the appropriate IBOutlets listed above.
When I run, dequeueReusableCellWithIdentifier returns nil. I thought that with Xcode 4 and storyboards, dequeueReusableCellWithIdentifier, according to Converting to Storyboards Release Notes, "The dequeueReusableCellWithIdentifier: method is guaranteed to return a cell (provided that you have defined a cell with the given identifier)".
The weird part is that when I run in the Simulatior, the table appears as expected (section, cell size, etc.), except that I can't edit the custom cell.
I'm at a loss. Any help or ideas?
--John