>                                NSUrl url =new NSUrl(@"http://www.amazon.com";);
>                                NSUrlRequest req = new NSUrlRequest(url);
>                                req.SetValueForKey(???,"Foobar/1.0");
>

req.SetValueOfKey("User_Agent", "Foobar/1.0");

check the params, tho. Its often SetXforY(Value, Key)

when you'd expect it to be (Key, Value)

But the intellisense should tell you. Failing that, MonoMac (which
uses Cocoa, which is almost the same as CocoaTouch when you have NS*
stuff), says:

http://docs.go-mono.com/index.aspx?link=C:MonoMac.Foundation.NSUrlRequest(MonoMac.Foundation.NSCoder)

.. maybe look at requestObj.Headers["User_Agent"] = "Foobar/1.0";

(maybe not, but most likely yes)




>
> I don't know how to convert the following line
>
> [requestObj setValue:@"Foobar/1.0" forHTTPHeaderField:@"User_Agent"]
>
>
> Is there any tutorial on converting Objective-C code to Mono?
>
> Thanks
> Art
>
> --
> View this message in context: 
> http://monotouch.2284126.n4.nabble.com/Converting-ObjectiveC-code-to-MonoTouch-tp3807631p3807631.html
> Sent from the MonoTouch mailing list archive at Nabble.com.
> _______________________________________________
> MonoTouch mailing list
> MonoTouch@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/

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
_______________________________________________
MonoTouch mailing list
MonoTouch@lists.ximian.com
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to