0
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已經增加,但委託方法不被在那裏叫。有任何想法嗎?
在推送另一個視圖控制器後,您正在調用ServerIO.m的方法,您需要從ViewControllerB的viewDidload/viewWillAppear中調用此方法 – rishi 2012-01-15 12:19:11