标签:
1 #import "Adapter.h" 2 3 @implementation Adapter 4 -(int)changeTo220:(int)adaptee{ 5 return 220; 6 } 7 @end
1 #import "ViewController.h" 2 #import "Adapter.h" 3 @interface ViewController () 4 5 @end 6 7 @implementation ViewController 8 9 - (void)viewDidLoad { 10 [super viewDidLoad]; 11 12 int current = 110; 13 Adapter * adapter = [[Adapter alloc]init]; 14 int new = [adapter changeTo220:110]; 15 NSLog(@"%d",new); 16 17 } 18 19 - (void)didReceiveMemoryWarning { 20 [super didReceiveMemoryWarning]; 21 } 22 23 @end
2016-05-09 16:46:26.262 Factory[2766:204337] 220
标签:
原文地址:http://www.cnblogs.com/conorBlogs/p/5474589.html