Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Converting NSpoint and passing the values in to CGRectMake

I am getting a point in NSPoint as:

NSPoint: {273,534}

I want to pass 273 and 534 into CGrectMake.
For example:

viewTwo.frame=CGRectMake(273,534,someValue,someValue)

I am not able to get the values in that NSpoint.
I tried passing it to NsArray and NSDictionary. Nothing works. Pls help

I use Po command in console and found the value which i need is in NSPoint. But dont know how to convert it

like image 300
iworld Avatar asked Dec 18 '14 14:12

iworld


1 Answers

NSPoint is a Mac OS type. I don't think it's defined in iOS. In iOS you can just cast an NSPoint to a CGPoint:

//Probably not valid in iOS because NSPoint isn't defined, but is shows a variable
NSPoint somePoint = MakePoint(273,534); 

//Cast an NSPoint to a CGPoint in order to get at it's values...
viewTwo.frame=CGRectMake(273,534,((CGPoint)somePoint).x,((CGPoint)somePoint).y);
like image 102
Duncan C Avatar answered Nov 11 '22 11:11

Duncan C