Hi,

I know that I can pass information to the constructor of a new view in exactly the same way as I would in a standard C# application, so

Foo foo = new Foo("hello");

will pass a string to the ctor of class Foo.

My problem is this. I have two buttons, both of which are linked to the same event on my first view. When I click on either button, the simulator dies with the following error

iPhoneWebView[85232:1607] -[WebView _doCommonSetup]: unrecognized selector sent to instance

What does this error mean? The code causing the issue is this

private void loadPage_TouchUpInside (object s, EventArgs e)
                {
                        UIButton loader = (UIButton)s;
                        string p1 = "Page 1", p2 = "Page 2";
                        if (loader.CurrentTitle.Contains ("1"))
                                wv = new WebView (p1);
                        else
                                wv = new WebView (p2);
                        
                        NavigationController.PushViewController (wv, true);     
                }

The correct button is always found (they contain the text "Page 1" and "Page 2" respectively), but the error is thrown on the wv = new WebView(p1) [or p2] line.

The ctor for the WebView class is

public WebView (string title) : base("WebView", null)
                {
                        titleBar.TopItem.Title = title;
                        if (title.Contains ("1"))
                                url = 
"http://www.all-the-johnsons.co.uk/test1.html";;
                        else
                                url = 
"http://www.all-the-johnsons.co.uk/test2.html";;
                }
                
                private string url;


Thanks

Paul

--
"Space," it says, "is big. Really big. You just won't believe how vastly, hugely, mindbogglingly big it is. I mean, you may think it's a long way down the road to the chemist's, but that's just peanuts to space, listen..."
Hitch Hikers Guide to the Galaxy, a truly remarkable book!

_______________________________________________
MonoTouch mailing list
[email protected]
http://lists.ximian.com/mailman/listinfo/monotouch

Reply via email to