0
OCUnit을 사용하여 작업을 테스트하고 싶습니다.nsthread에서 무언가를 테스트하는 방법
- (BOOL)testThread
{
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(thread) object:nil];
[thread start];
return YES;
}
- (void)thread
{
NSLog(@"thread**********************");
NSThread *thread = [[NSThread alloc] initWithTarget:self selector:@selector(thread2) object:nil];
[thread start];
}
- (void)thread2
{
NSLog(@"thread2**********************");
}
가 지금은 테스트 실행하려면 : 내 methodes의 하지만 하나 같이 내 테스트 케이스 에
- (void)testExample
{
testNSThread *_testNSThread = [[testNSThread alloc] init];
STAssertTrue([_testNSThread testThread], @"test");
}
을하지만 thread2는 어떻게해야합니까, 그래서 를 실행하지 복용량 ? 3Q! thread2
가 완료 될 때까지
을 나는이 그냥 코드 샘플과 질문과 아무 상관이 알고 있지만, thisNotation하지만 ThisNotation를 사용하지 않는 이름을 지정할 때 클래스 - 첫 번째 문자는 항상 대문자 여야합니다. 또한 지역 변수 이름의 밑줄은 적절하지 않으며 인스턴스 변수에 일반적으로 사용됩니다. – e1985