저는 iOS 용 멀티 스레드 응용 프로그램을 작성하고 있습니다. Objective-C를 처음 접해 왔기 때문에 이전에 iPhone에서 스레드를 사용 해보지 못했습니다. 자바를 사용하는 경우코코아 터치 스레딩 문제가 있습니다.
는 일반적으로, 나는 스레드를 생성하고 스레드 대상으로 "자기"를 보냅니다. 그리고 그 스레드로부터 주 스레드를 호출 할 수 있습니다. 목표 C에서 어떻게 수행됩니까?
나는 스레드에서 메인 스레드를 호출 할 수있는 방법? 나는 NSNotificationCenter으로 시도하고있다,하지만 난 sigbart 오류가 발생합니다 :/
이 스레드를 시작하는 방법입니다
NSArray *extraParams = [NSArray arrayWithObjects:savedUserName, serverInfo, nil]; // Parameters to pass to thread object
NSThread *myThread = [[NSThread alloc] initWithTarget:statusGetter // New thread with statusGetter
selector:@selector(getStatusFromServer:) // run method in statusGetter
object:extraParams]; // parameters passed as arraylist
[myThread start]; // Thread started
activityContainerView.hidden = NO;
[activityIndicator startAnimating];
어떤 도움도 좋을 것!