• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLConnection from inside -[NSManagedObjectContext performBlock:]?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLConnection from inside -[NSManagedObjectContext performBlock:]?


  • Subject: Re: NSURLConnection from inside -[NSManagedObjectContext performBlock:]?
  • From: Laurent Daudelin <email@hidden>
  • Date: Mon, 18 Nov 2013 21:41:48 -0500

Most likely it doesn’t have a runloop.

Have you tried scheduleInRunLoop:forMode:?

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin  http://www.nemesys-soft.com/
Logiciels Nemesys Software email@hidden

On Nov 18, 2013, at 21:29, Rick Mann <email@hidden> wrote:

I think I'm starting to understand what I'm doing wrong here…

I seem to be having trouble calling making an NSURLConnection inside a call to -[NSManagedObjectContext performBlock:]. I can set it up, but my delegate never gets called back.

I create the NSURLConnection with:

conn = [[...] initWithRequest:req delegate: del startImmediately: NO];

and then, after setting up a few things, I call

[conn start];

The docs say start will schedule the connection in the "default" modes. The MOC's run loop mode is nil. Is this why it's not getting called back? What's the right thing to do here?

The nice thing about scheduling it on the MOC is that the callbacks happen in the MOC. But maybe -[NSMOC performBlock:] does more than just dispatch the block to the MOC's queue.

I just went to see if I could use setDelegateQueue: on the connection, realizing two things: 1) It's an NSOperationQueue, not a dispatch queue, and 2) I can't get at either for an NSMOC, so it looks like I really can't start a connection from inside -[NSMOC performBlock:].

Am I right about this?


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Prev by Date: Re: streams/sockets slow to close?
  • Next by Date: Re: NSURLConnection from inside -[NSManagedObjectContext performBlock:]?
  • Previous by thread: Re: streams/sockets slow to close?
  • Next by thread: Re: NSURLConnection from inside -[NSManagedObjectContext performBlock:]?
  • Index(es):
    • Date
    • Thread