I have an NSValue that I am returning from an NSDictionary. The NSValue was created using sizeWithAttributes. I would like to know how to get the NSValue back into a value where I can use it to create the label size.
I get the size of the label calculated from this
betweensLabelSize = [betweensString sizeWithAttributes: @{
NSFontAttributeName: [UIFont systemFontOfSize:14.5f]
}];
I put this into the NSDictionary as a NSValue and retrieve like so
NSValue *tempSize = [currAxisDictionary objectForKey:@"betweensLabelSize"];
which returns this value
NSSize: {64.278503, 86.4925}
To be clear, you presumably created the
NSValue
using+[NSValue valueWithCGSize:]
.-sizeWithAttributes:
didn't create theNSValue
; it returned aCGSize
which you wrapped in anNSValue
.Anyway, you can get the
CGSize
out of theNSValue
object by calling-CGSizeValue
on it: