다른보기로 nib
파일을 만들었습니다. 이 nib
파일을 웹 (예 : html)처럼 템플릿으로 사용할 계획이었습니다. 그래서, 실제 데이터로 채우기이 nib
의 새 인스턴스를 만들 nib
&의 또 다른 새 인스턴스를 만들 실제 데이터 등 채우기 ...iOS (재) 템플릿으로 NIB 사용
을하지만이 작업을 수행 할 때, nib
인스턴스는 같은 행동을하지 않습니다. 하나만 생성됩니다. 내가 놓친 게 있니? 이 방법으로 nib
파일을 사용해야합니까?
int yCoord = 0;
for(int i=0; i<[resultSet count]; i++)
{
[[NSBundle mainBundle] loadNibNamed:@"msgView" owner:self options:nil];
UIView *tmpMsgView = [[UIView alloc] initWithFrame:CGRectMake(0, yCoord, msgView.view.frame.size.width, msgView.view.frame.size.height)];
tmpMsgView = msgView.view;
UILabel *senderLabel = (UILabel *)[tmpMsgView viewWithTag:1];
[senderLabel setText:@"trial"];
[self.view addSubview:tmpMsgView];
[tmpMsgView release];
yCoord += msg.view.frame.size.height;
}
이 msgView
은 (IB를 통해) nib
파일에 매여 너무이의 ViewController 클래스로 정의되는 nib
파일의 소유자 -
여기 내 펜촉 파일을 사용하려고 방법입니다.