开发者

What is the equivalent of NSString.stringWithContentsOfURL in Monotouch?

I'm missing NSString开发者_开发知识库.stringWithContentsOfURL in Monotouch. Does it exist?


Even easier:

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


[NSString stringWithContentsOfURL:] is not bound in monotouch.

You could invoke it manually like this:

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));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜