我有用来创建信号的 UITextField。我有以下转换/管道(不确定正确的术语!)
[[[self.searchText.rac_textSignal
throttle:0.3]
map:^(NSString *text) {
NSString* url = [NSString stringWithFormat:@"http://search.twitter.com/search.atom?rpp=20&since_id=0&q=%@", text];
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]];
return [NSURLConnection rac_sendAsynchronousRequest:request];
}]
subscribeNext:^(id x) {
NSLog(x);
}];
基本上我想根据当前的文本字符串执行搜索。
但是,通过 map 返回的结果是一个 RACSignal。我想要的是让我的地图返回来自 URLConnection 的响应,而不是信号。
有任何想法吗?