2012-01-15 139 views
0

場景:ASIHTTPRequest委託方法不會被調用

ViewControllerA.m樹立ASIHTTPRequest與ViewControllerB.m爲代表,它傳遞給ServerIO.m啓動ASIHTTPRequest和ViewControllerA推視圖控制器ViewControllerB。

但是,委託方法沒有被調用。下面的代碼:

ViewControllerA.m

ViewControllerB *drc = [[ViewControllerB alloc] initWithRequestID:requestID]; 

[self.navigationController pushViewController:drc animated:YES]; 

[ServerIO findRooms:[NSDictionary dictionaryWithObjectsAndKeys:drc, @"delegateController", nil]];` 

ServerIO.m

[request setDelegate:[parameters objectForKey:@"delegateController"]]; //I checked the delegate here and it's valid. 

ViewControllerB.m已經增加,但委託方法不被在那裏叫。有任何想法嗎?

+0

在推送另一個視圖控制器後,您正在調用ServerIO.m的方法,您需要從ViewControllerB的viewDidload/viewWillAppear中調用此方法 – rishi 2012-01-15 12:19:11

回答

0

要回答我的問題:

您必須使用實例方法( - ),而不是類的方法(+)。

相關問題