0
나는 예를 들어 https://github.com/st3fan/iphone-bitly 클래스를 사용하고 있는데, 나는 당신의 도움을 원한다.iphone-bitly 질문
- (void) demo
{
URLShortener* shortener = [[URLShortener new] autorelease];
if (shortener != nil) {
shortener.delegate = self;
shortener.login = @"LOGIN-REPLACE-ME";
shortener.key = @"KEY-REPLACE-ME";
shortener.url = [NSURL URLWithString: @"http://stefan.arentz.ca"];
[shortener execute];
///// I want to get result on here not in the delegate for further usage in my function
}
}
어떤 도움이나 제안 당신이 현재 스레드를 차단하는 것입니다 요청하는 무엇
내 데모 funtion에 결과를 얻고 싶습니다. 다른 함수 나 클래스를 사용하여 저의 함수 데모에서 짧은 링크를 얻을 수 있습니까? ?? 또는 다른 말로하면 나는 짧은 링크를 가질 수 없다면 어디로 든 이동할 수 없다. 어떤 생각? – Zaksh
예, URLShortener -execute를 다시 작성하여 sendSynchronousRequest : returningResponse : error :를 사용하고 백그라운드 스레드에서'demo'를 실행합니다. 그러나 위임 콜백을 기다렸다가'demoFinish' 메서드를 계속 사용하는 것이 좋습니다. 이것이 네트워크 가져 오기를 처리하는 일반적인 방법입니다. 그들을 기다리는 주 스레드를 차단하지 않습니다. –
나를 도와 주셔서 고맙습니다 :) – Zaksh