我在Monotouch中缺少NSString.stringWithContentsOfURL
。它存在吗?
答案 0 :(得分:4)
更容易:
string msg = new WebClient ().DownloadString ("http://www.google.com");
答案 1 :(得分:3)
[NSString stringWithContentsOfURL:]未绑定在monotouch中。
您可以像这样手动调用它:
var url = new NSUrl ("http://www.google.com/");
var str = (NSString) Runtime.GetNSObject (Messaging.IntPtr_objc_msgSend_IntPtr (Class.GetHandle ("NSString"), Selector.GetHandle ("stringWithContentsOfURL:"), url.Handle));