On Tue, Feb 24, 2015, at 04:57 AM, Charles Jenkins wrote:

> My latest fruitless attempt has involved trying to simply cast the value
> into something for which NSNumber has a corresponding init():
> 
>     let size:Float = font.pointSize as Float
>     let points = NSNumber( float: size )

You need to create either a Double or Float from the CGFloat before you
can pass it to the NSNumber initializer:

  1> let f: CGFloat = 2.0
f: CGFloat = 2
  2> let p = NSNumber(double: Double(f)) 
p: NSNumber = Double(2)

--Kyle

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to