2
ImageWithCaptionView라는 UIView 하위 클래스에서 xib를로드하는 데 다음 코드를 사용합니다. xib Inspector에서 뷰의 이름 인 ImageWithCaptionView를 지정했습니다.iOS : xib에 클래스를 할당하고 인식하지 못함
그러나 if 문 (isKindOfClass)은 사실이 아니므로 삭제해야합니다. 내가 여기서 무엇을 놓치고 있니?
UINib *nib = [[UINib nibWithNibName:NSStringFromClass([ImageWithCaptionView class]) bundle:nil] retain];
NSArray *myArray = [nib instantiateWithOwner:self options:nil];
for (id currentObject in myArray) {
if ([currentObject isKindOfClass:[ImageWithCaptionView class]]) {
self = (ImageWithCaptionView *) currentObject;
break;
}
}
관리자에서 어디에서 지정 했습니까? –
@Nick Weaver 식별 및 유형 탭 : http://d.pr/bZcx – aneuryzm
ID 관리자 탭으로 전환 할 수 있습니까? 왼쪽에서 세 개의 탭. "Custom Class"라는 필드가 있는데, 거기에 클래스가 나열되어 있습니까? –