Note that there are some explanatory texts on larger screens.

plurals
  1. POAFNetworking checking Availability
    primarykey
    data
    text
    <p>I've implemented <code>AFNetworking</code> without subclassing <code>AFHTTPClient</code>, in part using the following code in my <code>DownloadQueueManager</code>:</p> <pre><code>-(void)downloadPodcastAt:(NSString *)url toPath:(NSString *)path { NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:url] cachePolicy:NSURLRequestReturnCacheDataElseLoad timeoutInterval:60.0]; AFHTTPRequestOperation *operation = [[AFHTTPRequestOperation alloc] initWithRequest:request]; operation.outputStream = [NSOutputStream outputStreamToFileAtPath:path append:NO]; [operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) { [self saveQueuedItemInformation]; } failure:^(AFHTTPRequestOperation *operation, NSError *error) { // Other stuff }]; [operation start]; } </code></pre> <p>My question is manifold. I've googled til' my fingers went numb, and have yet to find a decent code sample that simply and easily checks for Reachability status using <code>AFNetworking</code>. (Oddly, there is plenty of discussion about importing <code>SystemConfiguration.framework</code>, which seems like a no-brainer). So if my user wants to minimize their data usage, and only download using wifi, how do I check for wifi, and only download if wifi is available?</p> <p>Second, it seems like <code>AFNetworking</code> wants to be a user-friendly front-end. But I could actually use a front-end to this front-end, because there's a LOT of stuff in there that one has to weed through to get to the stuff one needs. I just need to access a url, download an xml file (based on reachability), and do stuff with it. Am I missing something that makes this a simple task ? </p> <p>When I make sense of this, I'm totally building a front-end or five to simplify implementation (assuming I'm not just an idiot). Thanks in advance for any responses.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload