nsurlconnection

Get content of webservice

Hi there, I've got a problem which I thought is pretty simple to fix but somehow I can't figure out what to do. I've got an URL like http://www.myserver.com/myservice.php?param=foobar. When I type that into Safari's address bar I see an result like "Error" or "OK". So, how do I properly call that URL from within my code and get that re...

Reachability or connectionDidFailWithError?

I have implemented connectionDidFailWithError to alert the user of any errors that happen in the network connections like time out, no internet connection etc. It gives me correct notification when no internet connection is available. So do I still need to implement Apple's reachability code? ...

Problem in file download on Ipad

Hi all, I have an app in which I download file using NSURLConnection class object and the code works well on the iphone device 3.0 but when I run the same code for a different build on iPad it doesn't. So I want to ask are there any changes have been done in iPhone OS 3.2 related to NSURLConnection or something else is the prob. Here ...

Need tips on how to download mp3 on iphone

Hi am Going to make App that play some mp3 but my mp3 is big about 10 mb and above i dont wana put them on my app coz it will be very big so i will let users chose which files they need and download them on the app on iphone what am looking for is is it possiple ? i have seen many app on app store download and play files can you po...

iPhone SDK: How to send data to a server over the internet?

hi everyone, i wrote a gps-application for the iphone and it all works fine but now i want to send the latitude and longitude to a server over the internet using the most simple way... I have a url from the server in which there are parameters for latitude and longitude. Also i want the lat. and long. to be sent every 90 seconds or so. ...

iPhone app crashing on iPhone 3G iOS4

Hi, My iphone application is crashing on iPhone 3G with iOS4 device with some of the logs as below: 9 libobjc.A.dylib 0x00006504 objc_exception_throw + 104 10 CoreFoundation 0x000a3e08 -[NSObject(NSObject) doesNotRecognizeSelector:] + 92 11 CoreFoundation 0x000a32a4 ___forwarding___ ...

NSURLConnection + NSMutableData for file downloads is really slow

Hi guys. Basically what's happening is that I need to download a whole bunch of files in my app and I've set up a queue of sorts that downloads each file with an NSURLConnection and stores the server response incrementally in an NSMutableData until the download is finished and then writes the whole thing to disk. Here's the relevant par...

Loading and Deleting Remote Data From The Same View Controller

Hello, Sorry if this question has all ready been asked, maybe someone can point me in the right direction, I had trouble formatting it. I have a view controller, when it appears an NSURLConnection loads remote data asynchronously from a server into a table view, similar to how the Mail application loads data. However I also want to be...

Fastest way for iPhone to contact Web server just to create a log entry

I track user activity in my iPhone app by having certain user actions call an almost empty Web page that the app does nothing with. Rather, attached to the URL are some querystring paramaters that tell me who's doing something and what it is (after I analyze the logs, that is). I don't want launching the URL to slow down the app, so I p...

iphone nsurlconnection async, wait for done

Hello My code has a function (F1) to return YES/NO based on information read from server. So it uses async nsurlconnection to receive data. So F1 starts connection and MUST wait for data to be loaded The question is how can i implement it? thanks ...

hiding table view data loaded from local path before completely loaded from web server

Hi friends, how to hide table view data before loading. because my tableview shows immediately the local image that i have put in cellForRowAtIndexPath tableview that is in local path(show 20 more message) even before NSURLConnection. Thanks in advance for your suggestion Regards, sathish ...

NSURL declaration /allocation showing error

Hi I Have tried NSString *alertTxt =textfieldName.text; NSLog(@"Name: %@",alertTxt); NSURL *urlAddress = [[NSURL alloc ] initWithString: @"%@/login/index.php",alertTxt]; error : too many argument to function initstring .. the user will giv the url address to the alertText field and i hav to embed in to the webkit may i know the proc...

iphone nsurlconnection read cookies

Hello I am using async NSURLConnection to connect to a web site from iPhone. Handle didReceiveResponse is activated on response and I am trying to get all cookies, by using allHeaderFields from NSHTTPURLResponse I see many hreader, but no Set-Cookie - it looks like iphone simulator just ignores them... And I am sure cookies are present...

NSURLConnection doesn't call delegate methods

Hello everybody, I saw similar questions here, but I couldn't find solution to my problem. I have a simple NSURLConnection in main thread (At least I didn't create any other threads), but my delegate methods aren't get called [[[NSURLConnection alloc] initWithRequest:request delegate:self] autorelease]; and no methods called, e.g. - ...

Receive Cached Data after http status code 204 recevied

I use NSURLConnection like this (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse )response { if ( [response isKindOfClass:[NSHTTPURLResponse class]]) { int code = [(NSHTTPURLResponse)response statusCode]; } } i get a response whose statusCode is 204,then i send another request,but all responses i r...

Weird problems on iPhone simulator but not device?

I'm having some problems with the iPhone simulator that don't seem to be occurring on the device. I have made a web service reference class with a bunch of static methods so different calls to a web service can be made from all over the application. The methods themselves contain a lock so only one request will be performed at a time. ...

Does NSURLConnection block the main thread?

I'm using NSURLConnection in an iPhone application and the interface seems to slow down after sending initWithRequest: to my NSURLConnection instance. I'm not sure if this is occurring because my processing code is taking a long time to handle the response, or if it's because NSURLConnection is blocking the main thread. Can anyone conf...

Loading PDFs or Images from URL into a CoverFlow view

Hi, I want to load PDFs or Images into a View, but when the source is an URL there might be connection lags, so I wonder what is the best approach when loading content (like magazines) into a Coverflow view in the iPhone?. (For Coverflow, something like this: http://apparentlogic.com/openflow/ ) Is it ok to get a pdf file then obtain...

Get remote file size via HTTP without downloading said file.

Any way to get the size of a (remote, http) file without actually downloading it? All other similar questions seem to revolve around grabbing the expectedContentLength from the NSURLResponse object in didReceiveResponse: but I don't want to download the file, I just want to know how big it is. ...

Objective-C NSURLConnection

Can I put all connection related functions into it's own (singleton?) class or possibly the app delegate? I've got a lot of code repetition right now... eg. this method is in at least 5 files: - (void)connection:(NSURLConnection*)connection didFailWithError:(NSError*)error; Would I just import a class with these methods in it? Do I ...