Re: NSURLConnection doesn't post
Re: NSURLConnection doesn't post
- Subject: Re: NSURLConnection doesn't post
- From: "Tom Harrington" <email@hidden>
- Date: Thu, 10 Apr 2008 10:34:57 -0600
On Thu, Apr 10, 2008 at 6:27 AM, Micha Fuhrmann <email@hidden> wrote:
> Now if I place a button on my interface and call test everything is fine,
> the post is submitted and the delegate method is called. Suffice I call the
> test method from another class and nothing gets posted (break points show me
> the sendLogs method is indeed called), the didReceiveData method is not
> called either. I've looked into adding the NSURLConnection into an array so
> it wouldn't be scraped, created a separate send class just for the post etc.
> to no avail, I really don't know what I'm doing wrong.
When you call -sendLogs from another class, does the run loop have the
chance to run, or does the code block, or busy-wait, or something else
that might prevent it from running? You'll need a working run loop
for NSURLConnection to successfully post the data and call its
delegate methods.
Also, is it possible that when -sendLogs is called from another class,
it's also called from a separate thread? NSURLConnection's delegate
methods are called on the same thread that initiated the connection,
and if you've started a different thread, you have to create your own
run loop.
--
Tom Harrington
email@hidden
AIM: atomicbird1
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden