[iPhone] 変換 CGRect <-> NSValue
iPhoneに限った話ではないのですが。メモ:
via
http://dis
CGRect → NSValue
CGRect rect = CGRectMake
(x,y,w,h);
NSValue *rectValue = [NSValue valueWithCGRect:rect ];
NSValue → CGRect
CGRect rect = [someNSValu
e CGRectValu e];
iPhoneに限った話ではないのですが。メモ:
via
http://dis
CGRect rect = CGRectMake
(x,y,w,h);
NSValue *rectValue = [NSValue valueWithCGRect:rect ];
CGRect rect = [someNSValu
e CGRectValu e];
調べてわかったのですが、複数パラメータを持つメソッドのSELは作成できるのですが(下記)、UIButtonなどのtarget-act
-(void)methodWith
NoArgument s;
SEL noArgumentSelector = @selector(methodWith NoArgument s); -(void)methodWith
OneArgumen t:(id)argument;
SEL oneArgumentSelector = @selector(methodWith OneArgumen t:); // notice the colon here -(void)methodWIth
TwoArgumen ts:(id)argumentOn e and:(id)argumentTw o;
SEL twoArgumentSelector = @selector(methodWith TwoArgumen ts:and:); // notice the argument names are omitted
ちなみに、自分でSELのメソッドを呼び出すときには、パラメータを渡す事は可能:
-performSe
lector:
-performSelector:wit hObject:
-performSelector:wit hObject:wi thObject:
できないと言っても、if(sender == _myButton) {} とか sender.tag
How do SEL and @select work in iphone sdk?
http://sta
How to I pass @selector as a parameter?
http://sta
Help me understand
http://www
AppleのドキュメントのSelectors項
http://dev