Issue
I trying to port this line to xamarin
let textStorage = NSTextStorage(attributedString: self.attributedText!)
but I can't find a constructor or static method that takes an NSAttributedString.
Solution
NSTextStorage's attributedString: initializer is missing on Xamarin.iOS.
You can perform an Append|Insert on your NSTextStorage object (which is really appending/inserting on the NSMutableAttributedString subclass).
Since your NSTextStorage would be empty as it was just instanced, just use Append:
var textStorage = new NSTextStorage();
textStorage.Append(someMutableAttributedString);
Note: This initializer was manually added to the Xamarin.Mac's AppKit framework as a partial class (something in the API generator must not like how it is defined).
Answered By - SushiHangover
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.