On May 11, 2009, at 12:20 AM, James Lin wrote:

Hi all,

This is strange, i don't know what to make of it.

I have a view with a TableView in it.

If i use UITableViewController class, which is supposed to be the correct class to use, the tableview (which has 1 UILabel and 1 UITextField combined cells) is only correctly rendered up to cell 7. starting with 8 to 10 (which are off-screen to begin with) won't render correctly when scrolled into view.

With my limited experience, trouble shooting this one is a headache.

So what do i do?

I changed the UITableViewController to UIViewController.

AND?

Problem solved! ALL 1 to 10 TableViewCells renders beautifully!

BUT, i am not using the correct class...

Any suggestions?

James
_______________________________________________

UITableViewController is mostly a convenience class that stubs the required protocol for UITableView when you create a new subclass using Xcode. It doesn't really matter what controller class you use if you implement the protocol and set the delegate and data source.

Your observation makes complete sense if you have a view with a tableview and other views with it. A UITableViewController assumes that 'view' is a table view and you can't put other views in it other than programatically filling it with cells via the data source methods. Making it a UIViewController instead and connecting the tableview's delegate and data source will make it behave properly.

Matt
_______________________________________________

Cocoa-dev mailing list ([email protected])

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to