我正在尝试使用带有AFPropertyListRequestOperation的AFNetworking来下载plist并使用它。不知何故,这不起作用,因为AFNetworking似乎不喜欢plist的格式或其他任何东西。区块甚至都没被解雇。取而代之的是触发错误块。
有什么提示为什么会这样吗?
NSURL *url = [NSURL URLWithString:@"https://dl.dropboxusercontent.com/u/9358444/iOS/zet.plist"];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
AFPropertyListRequestOperation *operation = [AFPropertyListRequestOperation propertyListRequestOperationWithRequest:request success:^(NSURLRequest *request, NSHTTPURLResponse *response, id propertyList) {
//do something
NSDictionary *myDic = (NSDictionary *)propertyList;
NSLog(@"%@", myDic);
NSLog(@"Fired PLIST");
} failure:^(NSURLRequest *request, NSHTTPURLResponse *response, NSError *error, id propertyList) {
//error
NSLog(@"Error PLIST");
}];
[operation start];发布于 2013-06-17 22:08:55
记录错误以启动-这将为您提供错误的指示。如果你仍然被难住了,请回帖。
NSLog(@"%@", error);https://stackoverflow.com/questions/17149509
复制相似问题