我从网络进程
收到此JSON字符串gulp.task('default', function() {
return gulp.src(files, { base:'./' })
.pipe(rename(function(path) {
path.dirname = path.dirname.replace(/(.*)?\/images\/?/, '');
}))
.pipe(gulp.dest('public_html/assets/images/'));
});
当我使用以下内容获取数据时:
{
"result":"ok",
"description":"",
"err_data":"",
"data":[
{
"id":"14D19A9B-3D65-4FE2-9ACE-4C2D708DAAD8"
},
{
"id":"8BFD10B8-F5FD-4CEE-A307-FE4382A0A7FD"
}
]
}
它记录为:
NSError *jsonError = nil;
NSData *objectData = [ret dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *json= [NSJSONSerialization JSONObjectWithData: objectData options:kNilOptions error: &jsonError];
NSLog(@"data: %@",[json objectForKey:@"data"]);
如何使用值和键将数据解析为NSDictionary?
答案 0 :(得分:1)
Web返回一个具有属性的对象,该属性是一个对象数组,所以......
function loop(){
if(check > 0){
check++;
}
if ( (check===0) || (check===3) {
check = 0;
document.write("doing something every 1sec");
}
}