iphone - No Data Returned Using NSURLConnection Asynchronously -


I have a thing with some time which seems rather straightforward - but I can not seem to work. Creating an iPhone app that receives data from a web host I am trying to set up an asynchronous connection to host - because I want to free the free device during connection. (Download Synchronous Freeze - Phone until the request is made). Here is my connection code:

// temp url to see if the data has been returned : NSURL * theURL = [NSURL URLWithString: @ "http://www.theappleblog.com/feed"]; NSURLRequest * dataRequest = [NSURLRequest requestHeath URL: theURLCache policy: NSURLRequestReloadIgnoringLocalCacheData timeout interval: 60]; / * Establish connection / connection = [[NSURLConnection alloc] initWithRequest: dataRequest Representative: Self starting from start to end: Yes]; If (connection connection == zero) {NSLog (@ "connection failure!"); Self.urlData = Zero; } And {self.urlData = [[NSMutableData data] is retained); }

I have the establishment of all the appropriate representative methods:

  - (zero) connection: (NSURLConnection *) connection did the reception response: (NSURLResponse *) Response {[urlData setLength: 0]; UIApplication * Application = [UIApplication shared application]; Application.networkActivityIndicatorVisible = YES; NSLog (@ "Received Response!"); Connection: (NSURLConnection *) connection was Resuscript: (NSDT *) incremental data {}>  

[Self.urlData appendamentus: incremental data]; NSNumber * resourceLength = [User Integer with NSN Number Number: [Self-timed length]]; NSLog (@ "Resource Data Length:% d", [sourceLength intValue]); NSLog (@ "Files:% D", Self Arbitrage); NSLog (@ "Float Filesyes:% F", [Self-ralatatize Float Value]); }

  - (zero) connectionDifffish: Loading: (NSURLConnection *) Connection {NSLog (@ "The connection is finished loading \ n") ; NSLog (@ "Successful!% D bytes of data received", [urlData's length]); _isFinished = yes; UIApplication * Application = [UIApplication shared application]; Application.networkActivityIndicatorVisible = NO; }   

   
  - (zero) connection: (NSURLConnection *) connection was filewidth error: (NSError *) error {NSLog (@ "Error:% @", [Error localization]]; }  

As you can see, I got the boat load of the log messages because I wanted to see that anything is the medium of all Coming from. My connection comes back as test - truth but no data is ever loaded. Like I said, I'm sure - I should do something (or not) actually but stupid?
Any help would be most appreciated.

Thank you, Lawrence

This does not answer your question directly, but You may want to consider considering the Ben Capsy Library, which wraps around the CFNetwork sections and includes asynchronous, threaded request code, which makes a lot of work from doing it right.


Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -