Questions tagged [afhttprequestoperation]
84 questions
0
votes
1 answer
How to download multiple files from multiple url by NSOperationQueue
I'm struggling to implement download mechanism for multiple files using AFNetworking. I want to download zip file one after another from multiple url with progression message. I tried like following code, but getting error as -
*** Terminating app…

Nuibb
- 1,800
- 2
- 22
- 36
0
votes
1 answer
Couldn't save data in given path of document directory by NSOutputStream
How to save downloaded content/data in the given path in document directory by NSOutputStream. If i append file name with DD then it works (ex- DD/contentPath.zip), But if i append a path like DD/hello/contentPath.zip then it doesn't work. Why ? I…

Nuibb
- 1,800
- 2
- 22
- 36
0
votes
0 answers
iOS SDK global error handler for errors from server
I have a class called Request. A request is asynchronous. At the end of the request, I check the response for a server error. If there is a server error, I send out a notification.
+(BOOL)checkForResponseError:(NSArray*)response{
if ([[response…

maor10
- 1,645
- 18
- 28
0
votes
1 answer
AFHTTPRequestOperation setCacheResponseBlock Cannot convert value of type
I’m using AFHTTPRequestOperation in swift like this :
let operation : AFHTTPRequestOperation? = manager.GET(requestURL, parameters: nil,
success: { (operation:AFHTTPRequestOperation!, responseObject:AnyObject!) -> Void in
...
...
...
…

MGY
- 7,245
- 5
- 41
- 74
0
votes
1 answer
AFHTTPRequestOperation dependency
I have the following scenario in an application that uses AFNetworking to make services calls:
I call a special service that will generate a token for me
I call the service that I want, sending this token as a parameter
I call another special…

o15a3d4l11s2
- 3,969
- 3
- 29
- 40
0
votes
2 answers
Get the value of Error-Message in failure block of AFHTTPRequestOperation
I need to get the value of Error-Message in the failure block of my request.
Here's the error:
Error Domain=com.alamofire.error.serialization.response Code=-1011
"Request failed: bad request (400)" UserInfo=0x165151b0
…

Lie-An
- 2,563
- 3
- 17
- 20
0
votes
1 answer
iOS) How to set parameter when getting response using AFHTTPRequestOperation with 'GET' method
My code is below:
NSString *urlString = [[NSString stringWithFormat:@"/players?skip=%ld",(long)skipSize] DVURL];
NSURL *url = [NSURL URLWithString:urlString];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
//[request set]
[request…
user2649058
0
votes
0 answers
IOS Background Mode AddOperation Queue
I want to send my files in background mode but when i switch to background uploading stops.But there is no problem while sending video.i sending video post method.However i send my images as string...
my way to start operation
…
user3236289
0
votes
1 answer
How do I access an AFHTTPRequest's Completion Block?
I'm posting a notification in the request failure block:
[manager POST:path
parameters:nil
success:^(AFHTTPRequestOperation *operation, id responseObject) {
if (operation.response.statusCode == 200) {
//message…

quantumpotato
- 9,637
- 14
- 70
- 146
0
votes
1 answer
Run Request In Background IOS
I want to run some request while my app is in background.My App supports background mode -> background fetches.
But below code is always return failure while my app is in background!
Is there a way to run request?I also tried NSURLConnection it…
user3236289
0
votes
1 answer
Objc-C: RACObserve rapidly changing values (RACSignal for AFHTTPRequestOperation)
I am using reactive cocoa to create download file from server. I have a DownloadMapFileOperation.m file with a progress property (progress value, currentBytes, totalBytes). It changes very rapidly in my next RACSignal method and float progress (it's…

Artem Z.
- 1,243
- 2
- 14
- 36
0
votes
1 answer
return data from AFHTTPRequestOperation?
I'm moving my app code to an MVC model and so I created a method to retrieve some data from an API.
+ (NSMutableArray *)loadFromFeed {
NSString *feed = @"https://api.test.com";
NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL…

user4486205
- 105
- 1
- 7
0
votes
1 answer
AFHTTPRequestOperation download file even when server return error
I'm new in Objective-c, I want to send a URL request with token to server to download the file. If token is invalid, server will return HTTP 500 error.
But I got one problem was that even operation return error, the file still been created, but the…

yun
- 125
- 2
- 11
0
votes
1 answer
Caching Larger Image Using AFNetworking
I new to AFNetworking and less experience in iOS development.
I use AFNetworking to download image from the internet, here is the code:
- (void)dowloadPoject {
AFHTTPRequestOperationManager *manager = [AFHTTPRequestOperationManager…

Terry Tan
- 421
- 5
- 12
0
votes
1 answer
Get value out of setCompletionBlockWithSuccess block
I want to get some data from web service and it works fine bu now I want to store the returned value from a variable from a block, but the variable's value is changed only inside the block and it returns null outside the block, how can I do it ?…

user2389273
- 31
- 7