2
Objective-C를 처음 접했고 우수 사례에 대한 기사를 읽은 후 (void) initialize 클래스 메서드가 내 전역 정적 변수를 초기화하는 가장 좋은 장소 인 것으로 보입니다.+ (void) 초기화 및 메모리 문제
static NSArray *tableCellBackgrounds = nil;
+ (void)initialize
{
if (self == [VariableDisplayViewController class])
{
tableCellBackgrounds = [NSArray arrayWithObjects:
[[UIImage imageNamed:@"ListLine_Pair.png"] stretchableImageWithLeftCapWidth:40 topCapHeight:27],
[[UIImage imageNamed:@"ListLine_Impair.png"] stretchableImageWithLeftCapWidth:40 topCapHeight:27],
nil
];
[tableCellBackgrounds retain];
}
}
내 문제는 다음과 같습니다. 언제/어디에서 '출시'메시지를 보내야합니까? 감사합니다 ...
좋습니다, 감사합니다 :) – J0o0