[MonoTouch] How to obtain message body

Nic Wise nicw at fastchicken.co.nz
Fri Mar 30 15:55:34 UTC 2012


Another option (possibly overkill and most likely the wrong thing to do):

branch the project
change the Tapped to include the MessageElement (WHY YOU NO PASS THIS??)
push back

:)

Just one of the (mostly bad) reasons I maintain my own version(s) of
MT.D. Most of my changes are like this - add a new param, make
something public or virtual I need which was private / not virtual,
change how something works to make it work better for me.

On Fri, Mar 30, 2012 at 15:51, Jeff Stedfast <jeff at xamarin.com> wrote:
> Hi Rafael,
>
> Try this:
>
> void msgSelected (DialogViewController dvc, UITableView tv,
> NSIndexPath path)
> {
>     var body = ((MessageElement) dvc.Root[path.Section][path.Row]).Body;
> }
>
> Hope that helps,
>
> Jeff
>
>
> On Thu, Mar 29, 2012 at 7:45 PM, rafaelc <rafaelc_70 at hotmail.com> wrote:
>>
>> Hello, I´m using MessageElement class, using this code:
>>
>> while(dr.Read())
>>                        {
>>                                var line = new MessageElement (msgSelected)
>> {
>>                                        Sender = dr.GetString (1),
>>                                        Subject = "",
>>                                        Body = dr.GetString (2),
>>                                        Date = dr.GetDateTime (3),
>>                                        NewFlag = false,
>>                                        MessageCount = 0
>>                                };
>>                                mensajesSection.Add(line);
>>                        }
>>
>>
>> I want to know how to show the complete body using the method
>>
>> void msgSelected (DialogViewController dvc, UITableView tv, NSIndexPath
>> path)
>> {
>>        // The message was selected
>>        // here I don´t know how to obtain the message body
>>       // I tried this
>>
>>   //in debug mode I found Body property in tv.CellAt(path).Subviews[0]
>>
>>    string msg = tv.CellAt(path).Subviews[0].Body;   // compiler error
>>
>> }
>>
>>
>>
>> regards
>>
>>
>> --
>> View this message in context:
>> http://monotouch.2284126.n4.nabble.com/How-to-obtain-message-body-tp4517449p4517449.html
>> Sent from the MonoTouch mailing list archive at Nabble.com.
>> _______________________________________________
>> MonoTouch mailing list
>> MonoTouch at lists.ximian.com
>> http://lists.ximian.com/mailman/listinfo/monotouch
>
>
>
> _______________________________________________
> MonoTouch mailing list
> MonoTouch at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/monotouch
>



-- 
Nic Wise
t.  +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise
b. http://www.fastchicken.co.nz/

Nearest Bus: find when the next bus is coming to your stop. http://goo.gl/Vcz1p
mobileAgent (for FreeAgent): get your accounts in your pocket.
http://goo.gl/IuBU
Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa
London Bike App: Find the nearest Boris Bike, and get riding! http://goo.gl/Icp2


More information about the MonoTouch mailing list