可以使用CocoaPods在github上下载源码,这个库擅长处理从Web API上请求的数据,用法如下:
NSURL *twitterSearch = [NSURLURLWithString:@"http://api.douban.com/v2/book/search?tag=computer"];
NSData *data = [NSData dataWithContentsOfURL:twitterSearch];
NSDictionary *json = [NSJSONSerializationJSONObjectWithData:data options:NSJSONReadingMutableContainerserror:nil];
NSArray *books = [json objectForKey:@"books"];
NSArray *tweets = Underscore.array(books)// 实际上books里面需要是字典
.filter(Underscore.isDictionary)//如果不是字典,那么下面得不到执行
.reject(^BOOL (NSDictionary *tweet) { //拒绝出版社为中国电力的书,这里遍历了 books
return [tweet[@"publisher"] isEqualToString:@"中国电力"];
})
.map(^NSString *(NSDictionary *tweet) { //进行映射,也就说返回的对象只包含这两个key的 value
NSString *name = tweet[@"title"];
NSString *text = tweet[@"image"];
return [NSString stringWithFormat:@"%@: %@", name, text];
})
.unwrap;
相关推荐
UAV_swarm_formation_under_attack.m
I.O.U.S.A. One Nation. Under Stress. In Debt
NSEB2M8U1 There's a pair of shorts under th.pdfNSEB2M8U1 There's a pair of shorts under th.pdfNSEB2M8U1 There's a pair of shorts under th.pdfNSEB2M8U1 There's a pair of shorts under th.pdfNSEB2M8U1 ...
Portfolio selection with coherent Investor’s expectations under uncertainty.pdfPortfolio selection with coherent Investor’s expectations under uncertainty.pdfPortfolio selection with coherent ...
Tuning TCP under Linux.pdf
Acquiring Linear Subspaces for Face Recognition under Variable Lighting.pdf
Radar SAR imaging simulation under Matlab.zip
Kahneman, D. , & Tversky, A. (1979). Prospect theory: An analysis of decision under risk. In Econometrica, XVLII (pp. 263–291) .
2008考研英语阅读理解真题解析第一篇女性压力Women Under Stress.pdf
This source make CView window under CView using CWnd control. You need Visual C++ 7.1 to read this source project. I create this project on Visual Studio .NET 2003.
Robotic Platform forHigh-Intensity FocusedUltrasound Surgery Under Ultrasound TrackingTheFUTURA Platform.pdf
官方版本...linked is licensed under a BSD style license (ref. the comment headers of the files in the src directory). Version 2.4 is known to not work, even experimentally, on Mac OS X.
* [Lazarus] Fixed modal dialogs in preview under linux GTK - Fixed Detail report bug when rebuilds report using TfrxCustomPreview.Report (Collapse/expand drills). - Fixed bug with KeepHeader and ...
To this aim, we have developed the TRex tool, published as an open-source Eclipse plugin under the Eclipse Public License, which provides IDE functionality for the TTCN-3 core notation and supports ...
Install under Linux 安装说明
To this aim, we have developed the TRex tool, published as an open-source Eclipse plugin under the Eclipse Public License, which provides IDE functionality for the TTCN-3 core notation and supports ...
关于Interpretable Deep Learning under Fire这篇论文的演讲PPT和讲稿
This is the complete source code for Quake 2, version 3.21, buildable with visual C++ 6.0. The linux version should be buildable, but we haven t tested it for the release. The code is all licensed ...
Economics003 Choice Under Uncertainty
chapter_5 Choice Under Uncertainty