1
를 호출하고 여기에 내 코드에서이 방법은 없습니다있는 UITableViewCell :내가 프로그래밍 방식 (NO XIB) 내있는 UITableViewCell을 만들어 initWithFrame
문제는 나는 그것이 initWithFrame를 호출 볼 수 없다는 것입니다가 호출되고
- (id) initWithFrame: (CGRect)frame {
self = [super initWithFrame: frame];
if (self) {
NSLog(@"CALLING INIT WITH FRAME");
self.like_img = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 75, 30, 30)] autorelease];
[self.contentView addSubview: self.like_img];
self.comment_img = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 110, 30, 30)] autorelease];
[self.contentView addSubview: self.comment_img];
self.type_img = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 40, 30, 30)] autorelease];
[self.contentView addSubview:self.type_img];
self.avatar = [[[UIImageView alloc] initWithFrame:CGRectMake(5, 5, 30, 30)] autorelease];
[self.contentView addSubview:self.avatar];
self.post = [[[UITextView alloc] initWithFrame:CGRectMake(40, 40, 650, 100)] autorelease];
[self.contentView addSubview:self.post];
self.post_title= [[[UILabel alloc] initWithFrame:CGRectMake(40, 20, 650, 50)] autorelease];
[self.contentView addSubview:self.post_title];
self.post_detail = [[[UILabel alloc] initWithFrame:CGRectMake(40, 10, 650, 20)] autorelease];
[self.contentView addSubview:self.post_detail];
}
NSLog(@"NOT MY SELF");
return self;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"FTPostCell";
FTPostCell *cell = (FTPostCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
NSLog(@"INITIALIZING CELL");
cell = [[[FTPostCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
}
//snip some code here
return cell;
}
, 왜 이거 야? reuseIdentifier :
어떻게 해결할 수 있습니까? – adit
내 답변 편집 –