Re: NSURLConnection unhappiness

2009-05-04 Thread Kyle Sluder
On Fri, May 1, 2009 at 12:00 PM, Nick Hristov wrote: > One more comment on self->ivar... I used this approach because using [self > connection] or self.connection (they are both the same thing) amount to an > extra message call. This is true, and sometimes you want to do this, while other times y

Re: NSURLConnection unhappiness

2009-05-04 Thread Alexander Spohr
Am 01.05.2009 um 18:00 schrieb Nick Hristov: One more comment on self->ivar... I used this approach because using [self connection] or self.connection (they are both the same thing) amount to an extra message call. Then just use ivar, without self-> It amounts to the same (no call) but lo

Re: NSURLConnection unhappiness

2009-05-04 Thread Jeff Johnson
Yes, those result in a message call, though it's a very fast message call. Within your instance methods, however, you can just access the ivar directly, e.g, "connection" without a message call and without "self->connection". -Jeff On May 1, 2009, at 11:00 AM, Nick Hristov wrote: Thank

Re: NSURLConnection unhappiness

2009-05-04 Thread Nick Hristov
Thank you all for your suggestions. I will use the runloop to wait on response. One more comment on self->ivar... I used this approach because using [self connection] or self.connection (they are both the same thing) amount to an extra message call. Nick On Thu, Apr 30, 2009 at 11:09 AM, Jeff Jo

Re: NSURLConnection unhappiness

2009-04-30 Thread Jeff Johnson
On Apr 30, 2009, at 12:53 AM, Kyle Sluder wrote: On Thu, Apr 30, 2009 at 1:44 AM, Jeff Johnson wrote: On an unrelated note, your use of "self->connection", etc., is non- standard and not advised. You should be using direct ivar access "connection", properties "self.connection", or accessor me

Re: NSURLConnection unhappiness

2009-04-30 Thread Stephen J. Butler
On Wed, Apr 29, 2009 at 11:31 PM, Nick Hristov wrote: > - (id) initWithURL: (NSURL*) someurl > { >self = [super init]; >if (self != nil) { >self->url = [someurl copy]; >NSURLRequest * request = [NSURLRequest requestWithURL:self->url > cachePolicy: NSURLRequestUseProtocolCac

Re: NSURLConnection unhappiness

2009-04-29 Thread Richard Frith-Macdonald
On 30 Apr 2009, at 05:31, Nick Hristov wrote: Hello, I am currently working on a small iphone app, and I am facing some difficulty with getting NSURLConnection to ... connect. Basically my unit tests don't pass: connection is never made. Here is a snippet of the non-working code: - (id)

Re: NSURLConnection unhappiness

2009-04-29 Thread Kyle Sluder
On Thu, Apr 30, 2009 at 1:44 AM, Jeff Johnson wrote: > On an unrelated note, your use of "self->connection", etc., is non-standard > and not advised. You should be using direct ivar access "connection", > properties "self.connection", or accessor methods "[self connection]". Sure, `self->connecti

Re: NSURLConnection unhappiness

2009-04-29 Thread Jeff Johnson
Hi Nick. You can't sleep the thread. According to the documentation for - [NSThread sleepForTimeInterval:], "No run loop processing occurs while the thread is blocked.". You need to run the run loop for the connection to process. On an unrelated note, your use of "self->connection", etc.,

NSURLConnection unhappiness

2009-04-29 Thread Nick Hristov
Hello, I am currently working on a small iphone app, and I am facing some difficulty with getting NSURLConnection to ... connect. Basically my unit tests don't pass: connection is never made. Here is a snippet of the non-working code: - (id) initWithURL: (NSURL*) someurl { self = [super in