// 將像素point由point所在視圖轉換到目標視圖view中,返回在目標視圖view中的像素值
-?(CGPoint)convertPoint:(CGPoint)pointtoView:(UIView*)view;
//?將像素point從view中轉換到當前視圖中,返回在當前視圖中的像素值
-?(CGPoint)convertPoint:(CGPoint)pointfromView:(UIView*)view;
//?將rect由rect所在視圖轉換到目標視圖view中,返回在目標視圖view中的rect
-?(CGRect)convertRect:(CGRect)recttoView:(UIView*)view;
//?將rect從view中轉換到當前視圖中,返回在當前視圖中的rect
-?(CGRect)convertRect:(CGRect)rectfromView:(UIView*)view;
例把UITableViewCell中的subview(btn)的frame轉換到controllerA中
//?controllerA?中有一個UITableView,?UITableView里有多行UITableVieCell,cell上放有一個button
//?在controllerA中實現:
CGRect?rc?=?[cellconvertRect:cell.btn.frametoView:self.view];
或
CGRect?rc?=?[self.viewconvertRect:cell.btn.framefromView:cell];
//?此rc為btn在controllerA中的rect
或當已知btn時:
CGRect?rc?=?[btn.superviewconvertRect:btn.frametoView:self.view];
或
CGRect?rc?=?[self.viewconvertRect:btn.framefromView:btn.superview];