Re: wait for the event?
Re: wait for the event?
- Subject: Re: wait for the event?
- From: jon <email@hidden>
- Date: Mon, 05 Oct 2009 16:04:55 -0600
I had a bunch of arguments in the method and a returning boolean
value, which hampered the effort... I'm in the process of making
them variables in the class, so i can get it down to a void method
with no arguments, and am putting the rest of the method into the
selector as you suggested...
now i've got a new problem, i have two methods that are similar,
that run for different webpages, but use the same offscreen
webView, so i need to have the notification select two different
method/selectors (or one with a flag) (because the code that ends up
in them is vastly different).. so i'm going to have to have yet
another flag that says, "go off and do two different things" at the
selector method.... i'm trying to figure that out now too. If anyone
has a suggestion on that, that would be great too...
sorry for terminology, i'm still trying to wrap my brain around what
to call things (how they work)...
interestingly, i tried to put the
URLToLoad = [NSURL URLWithString:theUrlString];
[offScreenWebView setFrameLoadDelegate:self];
[[offScreenWebView mainFrame] loadRequest:[NSURLRequest
requestWithURL:URLToLoad]];
code into a secondary thread, and let it run, then had the thing
exit to the main thread when it was done, or so i thought, but it
appears to load
it into it's own thread, because the way i had it set up, it
immediately exited the secondary thread, and then the notification
fired sometime later....
i'm reverting to doing it in the main thread as you suggested...
here is what i was using as an example, which does not work in the
case of loading a webView for anyone thinking of doing it. (or
atleast i couldn't get it to work)
(last comment has the code example that i followed...)
Best way to make NSRunLoop wait for a flag to be set? - Stack Overflow
thanks,
jon.
On Oct 5, 2009, at 3:46 PM, Matthew Mashyna wrote:
Is there a reason you have to loop and wait for it to finish instead
of doing more work in the notification method
_______________________________________________
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