在iOS上(但我认为这在OSX上是一样的),我使用的是STTWitter。
除其他外,我想使用它来流主要的公共时间线。
我已经成功地使用getStatusesSampleDelimited:stallWarnings:progressBlock:stallWarningBlock:errorBlock:启动了流推。
一旦我得到足够多的信息,或者想要切换到另一个流(例如,流搜索),我如何停止流?
我尝试过销毁STTWitterAPI对象,但没有效果。我无法在对象上看到停止流流的方法,而且我已经跟踪了源代码,并且看不到任何方法可以在流启动后停止流。
我错过了什么?
发布于 2013-11-09 12:53:56
库不支持取消请求,所以我只是添加了以下功能:
id request = [twitter getStatusesSampleDelimited:nil
stallWarnings:nil
progressBlock:^(id response) {
// ...
} stallWarningBlock:nil
errorBlock:^(NSError *error) {
// ...
}];
// ...
[request cancel]; // when you're done with it在请求取消之后,使用取消错误调用错误块一次。
如果它不能满足你的需要,请告诉我。
https://stackoverflow.com/questions/19859569
复制相似问题