[MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread dotnet projects
Hi, I am trying to convert the following code to .Net NSString *urlAddress = @http://www.amazon.com;; //Create a URL object. NSURL *url = [NSURL URLWithString:urlAddress]; //URL Requst Object NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url]; [requestObj

Re: [MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread Sebastien Pouliot
Hello, The 'forHTTPHeaderField' selector is mapped to the indexer of the NSMutableUrlRequest type, so requestObj [User_Agent] = Foobat/1.0; should do what you want. Sebastien On Mon, Sep 12, 2011 at 10:46 AM, dotnet projects coderproje...@gmail.com wrote: Hi, I am trying to convert the

Re: [MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread coderprojects
Yes Thank you Art -- View this message in context: http://monotouch.2284126.n4.nabble.com/seting-UIWebview-user-agent-objectiveC-question-tp3807602p3807638.html Sent from the MonoTouch mailing list archive at Nabble.com. ___ MonoTouch mailing list

Re: [MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread coderprojects
Hi I tried it and getting the following Error CS0200: Property or indexer `MonoTouch.Foundation.NSUrlRequest.this[string]' cannot be assigned to (it is read-only) I am trying to convert the code in the following URL

Re: [MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread Sebastien Pouliot
Hey, The original (objectivec) code was using NSMutableUrlRequest, not NSUrlRequest (it was also part of my previous answer ;-). FWIW you cannot change it if it's not mutable. Sebastien On Mon, Sep 12, 2011 at 11:20 AM, coderprojects coderproje...@gmail.com wrote: Hi I tried it and getting

Re: [MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread coderprojects
I missed the NSMutableUrlRequest NSMutableUrlRequest req = new NSMutableUrlRequest(url1); req[User_Agent] =Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US) AppleWebKit/532.0 (KHTML, like Gecko) Chrome/3.0.195.38 Safari/532.0; That worked. Thanks

Re: [MonoTouch] seting UIWebview user agent (objectiveC question)

2011-09-12 Thread Nic Wise
Thats a gotcha for new players (and old ones) Anything in Cocoa which isn't NSMutable is NOT Mutable (it can't be mutated - changed, altered etc) And, generally, if there is a NS, there is an NSMutable as well, if it makes sense to change it. On Mon, Sep 12, 2011 at 16:59,