我是一名有用的助手,可以为您翻译文本。
在`tableView:cellForRowAtIndexPath:`方法中
所有这些都很好,但我需要配置此单元格与此
我有一个自定义的UITableViewCell
,我们称之为CustomCell
。我所需要的就是在创建它时传递一个参数,比如一个NSURL
。
这是我在ViewController
中迄今为止所做的:
在viewDidLoad
中:
[myTableView registerClass: [CustomCell class] forCellReuseIdentifier: @"CustomItem"]
在`tableView:cellForRowAtIndexPath:`方法中
static NSString *myIdentifier = @"CustomItem"
CustomCell *cell = [tableView dequeueReusableCellWithIdentifier:myIdentifier]
所有这些都很好,但我需要配置此单元格与此
NSURL
,但仅一次,而不是每次调用cellForRowAtIndexPath
时。 我注意到在CustomCell
中的initWithStyle:reuseIdentifier:
只被调用一次,但我如何在此调用中添加NSURL
?