code is as below:
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithFrame:frame reuseIdentifier:reuseIdentifier]) {
// STUFF CONFIGURED HERE
}
return self;
}
Question:
since initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier is deprecated
i use –(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier instead
and then, the compiler reports an error that is ” Use of undeclared identifier ‘frame’ “
could anyone tell me how could i handle the “frame”?
Does not provide the frame parameter (unlike the previous one, which did), yet your implementation is referring to a variable called
frame, as such you’re getting the errorUse of undeclared identifier 'frame'The frame can be changed via its
.frameproperty, so it’s the responsibility of the caller ofinitWithStyle...to set the frame. For aUITableViewCell, you typically don’t need to set any frame, as the table view will manage it instead.Might be worth having a look at the
initdocumentation:http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html