What is equivalent to NSString.stringWithContentsOfURL in Monotouch?

I miss NSString.stringWithContentsOfURLin Monotouch. He exists?

+3
source share
2 answers

Even simpler:

string msg = new WebClient ().DownloadString ("http://www.google.com");
+4
source

[NSString stringWithContentsOfURL:] is not linked in a single point.

You can call it manually as follows:

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));
+2
source

Source: https://habr.com/ru/post/1792270/


All Articles