开发者

ipad populating table with coredata

Please help with this issue that is driving me insane... I want to populate a table with coredata (in a UIViewcontroleer), not a UITableController, as I need the table to be small and not take the whole screen, I have tried different approaches, to no avail, and no answer to fix the problems, Im adapting some code from tutorials that use the whole screen, example problem, Request for member tableView in something not a structure or union

all my searches for code show the use 开发者_运维知识库in iphone with tableview, It would be awesome if you know of a sample for ipad with a view controller (not in split view), thanks in advance


Your error stems most likely from you using the tableView property which is not available in UIViewController. It's difficult to judge what you did wrong, did you implement the necessary UITableViewDataSource and UITableViewDelegate methods? If you implement these it's no problem to use a UIViewController with core data. But remember the UITableViewController does more than just fill the table, it also resizes the table view when the keyboard is shown. You'll have to do this yourself, too.


UITableView has a rowHeight property that you can set directly or via the delegate method tableView:heightForRowAtIndexPath:.

UITableViewCell has a font property that you can set, to make the font smaller.

UITableView class ref says rowHeight is in points. If that means the same as points in NSFont, it should be easy to coordinate the two.

And of course you can resize the table view’s frame in IB.

So you ought to be able to get what you want using a UITableViewController.

As for the error, do you know what line is generating it? Have you set breakpoints to find out?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜