开发者

How to access UITableViewCell's UITextView from the UIViewController?

开发者 https://www.devze.com 2023-01-03 15:34 出处:网络
I have created my own UITableViewCell with XIB file. There\'s an UITextView inside. Howeve开发者_如何学Cr, I don\'t know how to access its features and use its outlets with the UIViewController. What\

I have created my own UITableViewCell with XIB file. There's an UITextView inside. Howeve开发者_如何学Cr, I don't know how to access its features and use its outlets with the UIViewController. What's the way to do it?

alt text http://cl.ly/a13e180c260e5e550b78/content


You can access it by pulling the subview out of the cell's subviews array and casting it to UITextView:

How you created your view hierarchy will determine the index to pass to objectAtIndex.

UITextView *textView = (UITextView*) [cell.subviews objectAtIndex:whateverIndex];

0

精彩评论

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