开发者

updating textfield in tablecell

NSString *cel=@"text"; NSIndexPath *a = [NSIndexPath indexPathForRow:1 inSection:1]; CustomCell *c = (CustomCell *)[tableView cellForRowAtIndexPath:a]; c.yes.text = cel; I am using these line for updating the UITextfield placed on the tablecell ..... but it giving me s开发者_Go百科ome error like this

RootViewController.m:110: error: 'tableView' undeclared (first use in this function)


The compiler is telling you that tableView is unknown within the scope of execution of the calling function. If you have added a UITableView in interface builder then you need to add one to your class definition of RootViewController also like so:

@interface RootViewController:UIViewController< UITableViewDelegate, UITableViewDataSource> 
...

IBOutlet UITableView *tableView;

...
@end

@property (nonatomic,retain) IBOutlet UITableView *tableView;

and then in the implementation you add

@synthesize tableView;

In Interface Builder link the table view you have created to this tableView variable by right clicking (or control clicking) on the table view and dragging the line to the RootViewController line in the display window and select tableView from the pop up gray window.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜