[Mono-osx] PermFormSelectOnMainThread patch for monomac

Maxi Combina maxi.combina at passwordbank.com
Mon May 23 08:24:10 EDT 2011


I have tried now and they didn't work.

However, I found the problem:
The patch I sent passes "obj == null ? IntPtr.Zero : obj.Handle", but the
implementation of InvokeOnMainThread() uses "obj.Handle" without checking
for null.

My selector does not take argument, so I use null as argument...
and InvokeOnMainThread() fails. If I change
monomac/src/Foundation/NSObject.cs:InvokeOnMainThread() to check for null,
it works.

So: could this small change be added? Or is it mandatory to pass a non-null
paramter to InvokeOnMainThread()?

Thanks!
maxi

2011/5/23 Duane Wandless <duane at wandless.net>

> Did you try NSObject.BeginInvokeOnMainThread or
> NSObject.InvokeOnMainThread?
>
> http://wiki.monotouch.net/HowTo/Threading
>
> Duane
>
> On Mon, May 23, 2011 at 6:35 AM, Maxi Combina <
> maxi.combina at passwordbank.com> wrote:
>
>> Hi,
>>
>> I need the functionallity of performing a selector on the main thread (as
>> WebKit methods can't be invoked from secundary threads). As I could not find
>> a way to achieve this with the current MonoMac API, I binded
>> NSObject.performSelectorOnMainThread:withObject:waitUntilDone:
>>
>> I would appreciate if this (o a better) patch is included in mainstream.
>> Or, if there is another way to perform a selector on the main thread without
>> this patch, you could give me some pointer :)
>>
>> Please let me know. Kind regards,
>> maxi
>>
>> --
>> *Maxi Combina*
>> Cell:+1 408 300 3614
>> Tel:  +1 408 524 1579
>> 440 N. Wolfe Road. Sunnyvale. CA. 94085. USA
>>
>> <http://www.passwordbank.com/>www.PasswordBank.com<http://www.passwordbank.com/>
>> This message and its attachments are sent from PasswordBank, Inc. and may
>> contain information that is
>> confidential. If you are not the intended recipient, you are prohibited
>> from printing, copying, forwarding or
>> saving them. Please delete the message and attachments without printing,
>> copying, forwarding or saving
>> them, and notify the sender immediately. Message transmission is not
>> guaranteed to be secure.
>>
>>
>> _______________________________________________
>> Mono-osx mailing list
>> Mono-osx at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/mono-osx
>>
>>
>


-- 
*Maxi Combina*
Cell:+1 408 300 3614
Tel:  +1 408 524 1579
440 N. Wolfe Road. Sunnyvale. CA. 94085. USA

<http://www.passwordbank.com/>www.PasswordBank.com<http://www.passwordbank.com/>
This message and its attachments are sent from PasswordBank, Inc. and may
contain information that is
confidential. If you are not the intended recipient, you are prohibited from
printing, copying, forwarding or
saving them. Please delete the message and attachments without printing,
copying, forwarding or saving
them, and notify the sender immediately. Message transmission is not
guaranteed to be secure.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-osx/attachments/20110523/44055ecb/attachment.html 


More information about the Mono-osx mailing list