Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

iOS 7: NSString.DrawString() chokes on UIStringAttributes

$
0
0

When using the new DrawString() method added in iOS 7 that takes an UIStringAttributes argument, I get a runtime Exception (Xamarin.iOS 7.0.5.2)

Code

UIStringAttributes attributes = new UIStringAttributes{ForegroundColor = UIColor.FromRGB(1,0,0)}; new NSString("Test").DrawString(new PointF(10, 10), attributes);

The exception I get is

Objective-C exception thrown. Name: NSInvalidArgumentException Reason: -[__NSCFString drawAtPoint:withAttributes:]: unrecognized selector sent to instance 0x14839730

Any ideas why this is happening?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>