[Mono-osx] PermFormSelectOnMainThread patch for monomac

Maxi Combina maxi.combina at passwordbank.com
Mon May 23 09:48:00 EDT 2011


Hi,
I attach the patch in this message.
I am not sure which is the best way to submit the patch, please let me know.

Regards,
Maxi

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

> Yes adding obj == null ? IntPtr.Zero : obj.Handle to the implementation of
> InvokeOnMainThread is correct.  Did you submit that patch?
>
> Duane
>
> On Mon, May 23, 2011 at 8:24 AM, Maxi Combina <
> maxi.combina at passwordbank.com> wrote:
>
>> 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.
>>
>>
>


-- 
*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/cfa14071/attachment-0001.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: invokeOnMainThreadNullCheck.patch
Type: text/x-patch
Size: 702 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/mono-osx/attachments/20110523/cfa14071/attachment-0001.bin 


More information about the Mono-osx mailing list