-3
두 개의 싱글 톤을 만드는 클래스가 있습니다. 이것은 2 개의 개별 싱글 톤을 생성하고 각각에 대한 참조를 유지합니까, 아니면 동일한 싱글 톤을 덮어 쓰시겠습니까?iOS의 다중 클래스 싱글 톤
+(ListingManager *)sharedListings
{
static dispatch_once_t pred;
static ListingManager *sharedListings = nil;
dispatch_once(&pred, ^{
sharedListings = [[ListingManager alloc] init];
});
return sharedListings;
}
+(ListingManager *)sharedSellingListings
{
static dispatch_once_t pred;
static ListingManager *sharedSellingListings = nil;
dispatch_once(&pred, ^{
sharedSellingListings = [[ListingManager alloc] init];
});
return sharedSellingListings;
}
왜 모든 다운 투표가 성공 했습니까? 나는 그것이 유효한 질문이라고 생각한다. ... – AMI289