我正在使用UITableView
带有单元格样式的UITableViewCellStyleValue1
.
我想要多行detailTextLabel
,这可能吗?或者我必须制作自定义单元格?
我想知道分配一个具有保留属性的对象,类似于:
RootViewController *viewController;
@property (nonatomic, retain) RootViewController *viewController;
@implementation ...
viewController = [[RootViewController alloc] init];
Run Code Online (Sandbox Code Playgroud)
因为做这样的事情是不对的:
self.viewController = [[RootViewController alloc] init];
Run Code Online (Sandbox Code Playgroud)
因为这会使对象保留计数增加2,你必须释放你的对象两次,其中一个是dealloc方法.
如果我正在分配我的对象,那么使用assign属性会更好吗?或何时需要保留我使用alloc方法分配的对象.
我对这个问题非常困惑,所以请你向我举例说明这种情况是如何有效的.
非常感谢,我真的很感激.
问候,