nsurlconnection

Objective C - UITableView after calling reloadData my object properties are null/nil

I have a ViewController defined as follows: @interface SectionController : UITableViewController { NSMutableArray *sections; } - (void) LoadSections; When LoadSection is call it makes a call to NSURLConnection to load a url which in turn calls - (void)connectionDidFinishLoading:(NSURLConnection *)connection { NSString *res...

iOS device goes idle, network stops. How do i get notified about entering the 'idle' state?

My app has a screen where it is constantly polling a server for information. When the user does not interact with the app it goes idle, the screen goes dim and then black. In the background, the app still tries to poll to service, but gets -1009 error codes from NSURLConnection. (-1009 == NSURLErrorNotConnectedToInternet) My idea is to...

How can I understand this crash log?

Looks like its related to NSURLConnection, but not sure how I can diagnose? Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x1ab98c00 Crashed Thread: 0 Thread 0 Crashed: 0 libobjc.A.dylib 0x000027da objc_msgSend + 18 1 CFNetwork 0x000...

iOS/Objective-C Multiple URL Connections

I have a few apps that I am trying to develop a reusable URL connection layer. I have done some research and am struggling between architectures. Specifically the APIs this layer utilizes. In the past, I have used NSURLConnection and NSOperation on a separate RunLoop. This seems overkill. I've seen libraries that subclass NSURLConnectio...

iOS: How can i receive HTTP 401 instead of -1012 NSURLErrorUserCancelledAuthentication

I have a problem similar to the one described in the link below. http://stackoverflow.com/questions/2188099/nshttpurlresponse-statuscode-is-returning-zero-when-it-should-be-401 I use [NSURLConnection sendSynchronousRequest:returningResponse:error:] to get data from a server. When NSURLConnection receives the HTTP Code 401, it does not...

NSURLConnection plays up

Hi there. I have an iphone app which has an NSURLConnection downloading a large video file. It takes about 5-10 minutes to download (a little bit of data at a time). There are some problems though. If the iPhone is just left on the side to download then the screen turns off and the iPhone locks. This seems to cause the download to sto...

recommended cache policy for download of 25 mb file

hi, I download 5 files of size 5 MB each through my app. I find the download is slow even at a peek 3g connection. Please let me know if i should fine tune the cache settings to speed up the downloading process. ...

NSFetchedResultsController with NSURLConnection

I have a User class and want to display many users' thumbnails w/ their name overlayed & a green dot overlayed if they're online, etc. in a grid-like tableView (like Grindr, similar to iPhone's Camera Roll). First, I fetch a JSON array of user data for the nearest (geographically) 20 users from the server. Then, I parse the JSON and ins...

How can I tell if Heroku is sending gzipped responses?

I'm making an iPhone application that requests JSON from Heroku. Am I getting a gzipped response? And, does the iPhone automatically unzip gzipped responses, or do you have to program that in? I'm using NSURLConnection asynchronously (with the delegate protocol) as described in the Xcode docs. When I do: curl -I http://acani.heroku.c...

CFHTTPCookieGetCreateDate is deprecated in this OS build (iOS4)

Hi, I have a simple application which accesses cookies from a webpage using a standard NSURLConnection. The existing version of the application works fine (developed for 3.0), however, I have modified the app (making it fully iOS4 compatible) and I now recieve the following warning in the log: CFHTTPCookieGetCreateDate is depr...

l[20]ve: invalid chunk type?

Hi there I don't know why I'm getting this error. I'm also getting an EXC_BAD_ACCESS issue from the following code. Any ideas why? Running breakpoints on the didRecieveResponse and didRecieveData and didFinishLoading shows the first two get run and mid way through recieving data the program crashes. - (void)connection:(NSURLConnection...

When does NSURLConnection's initWithRequest return nil

Does anyone know in which situations initializing a NSURLConnection returns nil instead of the created connection. The documentation says it's possible but fails to specify when this happens. The method/message in question: [[NSURLConnection alloc] initWithRequest:request delegate:self]; - According to the NSURLConnection Class Refer...

NSURLConnection didFailWithError not called?

Why, when an image does not exist at a specified URL, does didFailWithError not get called? For example: NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.google.com/images/someImageIknowDoesntExist.jpg"] cachePolicy:NSURLRequestReturnCacheDataElseLoad ...

reloading a tableview when source is NSURLConnection and gets new data

I tabController app with uitableview getting NSURLconnection data and trying to display it. I can't figure out the issue. If I replace the connection with an array I'm storing all the drill-down works, but updating doesn't, So I think that the tableView end of things is fine. BUT: If I put [[self.tableview] reloadData]; in the -(void) ...

iPhone: NSURLConnection not working with POST data for https on WiFi

Hi All, I have a piece of code that uses NSURLConnection to send a request to the server(HTTPS). The request has POST data (url parameters) attached to it using setHTTPBody. The piece of code works fine on device on GPRS data network. But, when trying on a secured WiFi network, the NSURLConnection calls delegates didRecieveResponse and ...

What's the equivlent code for stringWithContentsOfURL using a NSURLRequest?

Hi, I used to have: NSURL *url = [NSURL URLWithString:escapedUrlString]; NSString *responseString = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil]; But, I was reading online that I should probably be using an NSURLRequest instead if I want to add a timeout. The first code works fine, but the second co...

Am I releasing memory correctly?

I have the following helper object: LikeHelper* likeHelper = [[LikeHelper alloc]init]; likeHelper.delegate = self; [likeHelper performLike:self.messageID]; [likeHelper release];likeHelper=nil; performLike will do some NSURLConnection stuff and then tell the delegate whether or not it was successful. #pragma mark LikeHelperDelegate Me...

trying to set a delegate method to get urlConnection data.

I've been going around and around, I've been trying to use this example but running into trouble in the delegate method. I'm trying to figure out how to close this out. Looks like I've got a lot set correctly but need help on final step: I'm getting a -[ThirdTab apiFinished:]: unrecognized selector sent to instance. On line two o...

Load HTML NSString into a UIWebView

Im doing a project where I connect to a webpage using the NSURLConnection to be able to monitor the status codes that are returned (200 OK / 404 ERROR). I would like to send the user to the top url www.domain.com if I recieve 404 as status code and if i recieve as 200 status code I would like to load the page in to a webview. I have seen...

ASIHTTPRequest vs NSURLConnection

Just wondering which is faster in terms of performance and usability? Or if there's anything better out there? ...