私のアプリケーションでは、関数を呼び出す必要があり、その関数は多くの関数を呼び出します。問題は、getweather
関数を呼び出して開始しstartprocess
、その後プロセスが完了したことです。processCompleted
メソッドは によって呼び出され、値はメソッドのrssparser
最後で使用できますprocessCompleted
。
-(void) getWeather: (NSDictionary *) dictionary {
_rssParser = [[BlogRssParser alloc]init];
self.rssParser.address = addressInterestedIn;
self.rssParser.delegate = self;
[[self rssParser]startProcess];
}
//Delegate method for blog parser will get fired when the process is completed
-(void)processCompleted
{
NSLog(@"the rssItems array is %@", [[[self rssParser]rssItems] description]);
int woeid = [[[[self rssParser] rssItems] objectAtIndex:0] intValue];
// get weather update from yahoo
NSLog(@"temperature option %d", [[[NSUserDefaults standardUserDefaults] objectForKey:@"temperature"] intValue]);
SCYahooWeatherParser *parser = [[SCYahooWeatherParser alloc] initWithWOEID:woeid weatherUnit: [[[NSUserDefaults standardUserDefaults] objectForKey:@"temperature"] intValue]];
//parse the returned xml from yahoo
SCWeather *result = [parser parse];
[parser release];
NSLog(@"the conditionDataDict is %@", [result.conditionDataDict description]);
}
関数processCompleted
を呼び出したので、メソッドによって返される値を取得するにはどうすればよいですか。getWeather