【发布时间】:2017-08-03 13:23:05
【问题描述】:
我认为这是一个非常简单的问题,但我坚持了很长时间。我有一个函数,但遇到一些括号问题并且无法运行代码。我没有得到括号应该关闭的位置。
我的代码是,
-(void)Images{
NSString *eachImagePath;
if(_arrai.count == 0)
return;
eachImagePath = [NSString stringWithFormat:@"%@",_arrai[0]];
NSMutableDictionary *dictAddNewJobImages = [[NSMutableDictionary alloc]init];
dictAddNewJobImages[@"property_id"] = Propid;
dictAddNewJobImages[@"name"] = _arrainame;
NSString *strWebService = [NSString stringWithFormat:@"My URL"];
AFHTTPSessionManager *manager = [AFHTTPSessionManager manager];
manager.responseSerializer.acceptableContentTypes=[NSSet setWithObject:@"text/html"];
[manager.requestSerializer setTimeoutInterval:600.0];
[manager POST:strWebService parameters:dictAddNewJobImages constructingBodyWithBlock:^(id<AFMultipartFormData> _Nonnull formData)
{
NSURL *filePath = [NSURL fileURLWithPath:eachImagePath];
[formData appendPartWithFileURL:filePath name:@"image" error:nil];
} progress:^(NSProgress * _Nonnull uploadProgress)
{
} success:^(NSURLSessionDataTask* _Nonnull *task, id _Nullable responseObject)
{
NSLog(@"%@",responseObject);
[_arrai removeObjectAtIndex:0];
if(_arrai.count > 0)
[self Images];
} failure:^(NSURLSessionDataTask* _Nullable task, NSError* _Nonnull error) {
NSLog(@"%@",error);
}
}
【问题讨论】:
-
将代码添加为文本而不是图像
-
`[manage POST: is missing的结尾
-
是的,我要问的是如何结束它。 @詹斯
-
如何使用
] -
只需点击
cmd+f即可搜索{和}以查看号码是否匹配。[和]相同。那么你至少知道要寻找什么。
标签: ios objective-c