iwo*_*rld 4 objective-c ipad ios nspoint
我在NSPoint中得到一个观点:
NSPoint: {273,534}
Run Code Online (Sandbox Code Playgroud)
我想通过273和534 CGrectMake.
例如:
viewTwo.frame=CGRectMake(273,534,someValue,someValue)
Run Code Online (Sandbox Code Playgroud)
我无法得到那些值NSpoint.
我尝试将它传递给NsArray和NSDictionary.什么都行不通.请帮忙
我在控制台中使用Po命令,发现我需要的值是在NSPoint中.但不知道如何转换它
NSPoint是Mac OS类型.我不认为它是在iOS中定义的.在iOS中,您可以将NSPoint强制转换为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);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2812 次 |
| 最近记录: |