iOS5.0中initWithFrame:(CGRect) reuseIdentifier:(NSString *)用法停用了。

在ios4.3时下列用法是可行的:

NSArray *nibfile = [[NSbound mainBundle] loadNibNames:@dcell" owner:self option:nil];

CGRect cellFrame = CGRectMake(0,0,300,30);

cell = [[UITableViewCell  alloc] initWithFrame:cellFrame reuseIdentifier:CellIdentifer] autorelease];

但是在iOS5.0之后initWithFrame方法的这一形态用法被停用了,据官方文档说,现在改用initWithStyle。具体如何使用呢?

cell = [[[UITableViewCell  alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];

以备参考!!

原文地址:https://www.cnblogs.com/lovecode/p/2265188.html