how can i add UITableViewCell to UIView dynamically in my code?

1,331 views
Skip to first unread message

mars

unread,
Sep 10, 2008, 10:51:41 PM9/10/08
to iPhone SDK Development
Dear All,

As the subject ,how can i archive that? I try the UIView's
addSubView method ,but seemed not work.

Frank Lynch

unread,
Sep 10, 2008, 10:57:37 PM9/10/08
to iphonesdkd...@googlegroups.com
A UITableViewCell, is supposed to go within a UITableView.
--Frank

mars

unread,
Sep 11, 2008, 1:57:43 AM9/11/08
to iPhone SDK Development

Yes ,It supposed , but in interface builder , i can drag the
UITableViewCell into the UIView,and it displayed well .

the feature i need to implement is something like YouTube(on iphone)
's "Relative Videoes" .
> > addSubView method ,but seemed not work.- 隐藏被引用文字 -
>
> - 显示引用的文字 -

Joseph Heck

unread,
Sep 11, 2008, 2:27:11 AM9/11/08
to iphonesdkd...@googlegroups.com
That convenience is so you may lay out a UITableViewCell and then use
it when returning a cell when coding up the guts of a
UITableViewController delegate method. It's often easier to use the IB
to set up that cell when the cell is focused on getting user input.

Classic example with code that's easily visible: WordPress. source at
http://iphone.svn.wordpress.org

2008/9/10 mars <mars...@hotmail.com>:

Usman Ismail

unread,
Sep 11, 2008, 3:10:18 AM9/11/08
to iPhone SDK Development
This is a tutorial showing how you can create a table view
programatically and hence dynamically add cells etc. Although it shows
how to add text only you can overload the method to add other elements
in the cell also.

http://knol.google.com/k/usman-ismail/iphone-sdk-using-table-views/

--Usman



On Sep 11, 2:27 am, "Joseph Heck" <joseph.h...@gmail.com> wrote:
> That convenience is so you may lay out a UITableViewCell and then use
> it when returning a cell when coding up the guts of a
> UITableViewController delegate method. It's often easier to use the IB
> to set up that cell when the cell is focused on getting user input.
>
> Classic example with code that's easily visible: WordPress. source athttp://iphone.svn.wordpress.org
>
> 2008/9/10 mars <mars_z...@hotmail.com>:
Reply all
Reply to author
Forward
0 new messages