iPhone开发工具介绍与应用 (上篇)

移动开发 iOS
本文来介绍iPhone开发工具的介绍与应用,iphone开发工具应有尽有,文中很详细的介绍了iphone开发工具的能力,来看本文内容。

iPhone开发工具介绍与应用是本文要介绍的内容,分为上下节为友们介绍,如若你对iphone开发工具感兴趣的话,请参考 iPhone开发工具介绍与应用 (下篇),内容更精彩。来看本文内容详解。

iPhone开发工具之将XIB文件转换为Objective-C源程序

nib2objc是一个小巧的转换工具,可以将XIB文件自动转换为Objective-C的源代码文件。

通常,考虑到程序的效率时,才将XIB直接转换为源代码文件。但是这样一来,通过Interface Builder设定的实例变量与行为方法的接续也没有了,需要从新手写。但是,该工具的源代码是公开的,稍加修饰,就能完成大部分工作。

使用的时候,首先下载的工程代码并用XCode编译一下,会生成一个命令行程序文件 nib2objc。然后如下所示执行转换:

$ nib2objc WebView.xib > WebView.m 
  • 1.

iPhone开发工具介绍与应用

像是上面view转换后会输出以下代码:

UIBarButtonItem *view39 = [[UIBarButtonItem alloc]   
initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];   
view39.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
view39.enabled = YESview39.style = UIBarButtonItemStylePlain;   
view39.tag = 0view39.width = 0.000; UIBarButtonItem   
*view64 = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAction target:nil action:nil];  
 view64.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
 view64.enabled = YES;   
 view64.style = UIBarButtonItemStylePlain;   
 view64.tag = 0view64.width = 0.000;   
 UIBarButtonItem *view57 = [[UIBarButtonItem alloc]   
 initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];   
 view57.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);  
  view57.enabled = YESview57.style = UIBarButtonItemStylePlain;   
 view57.tag = 0view57.width = 0.000;   
 UIBarButtonItem *view33 = [[UIBarButtonItem alloc]   
 initWithTitle:(null) style:UIBarButtonItemStylePlain target:nil action:nil];   
 view33.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
 view33.enabled = YESview33.image = nil;   
 view33.style = UIBarButtonItemStylePlain;  
  view33.tag = 0view33.width = 0.000;   
  UIBarButtonItem *view66 = [[UIBarButtonItem alloc]   
  initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];   
  view66.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);  
   view66.enabled = YES;   
  view66.style = UIBarButtonItemStylePlainview66.tag = 0view66.width = 0.000; UIWebView  
   *view31 = [[UIWebView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 460.0)];   
  view31.frame = CGRectMake(0.0, 0.0, 320.0, 460.0);   
  view31.alpha = 1.000;   
  view31.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;   
  view31.backgroundColor = [UIColor colorWithWhite:1.000 alpha:1.000];   
  view31.clearsContextBeforeDrawing = YESview31.clipsToBounds = YES;   
  view31.contentMode = UIViewContentModeScaleToFillview31.detectsPhoneNumbers = NOview31.hidden = NO;   
  view31.multipleTouchEnabled = YES;   
  view31.opaque = YES;   
  view31.scalesPageToFit = YES;  
  view31.tag = 0;   
  view31.userInteractionEnabled = YES;   
 UIBarButtonItem *view56 = [[UIBarButtonItem alloc]   
 initWithBarButtonSystemItem:UIBarButtonSystemItemStop target:nil action:nil];   
 view56.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
 view56.enabled = YES;   
 view56.style = UIBarButtonItemStylePlain;   
 view56.tag = 0;   
 view56.width = 0.000;   
 UIBarButtonItem *view48 = [[UIBarButtonItem alloc]   
 initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];   
 view48.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
 view48.enabled = YES;  
  view48.style = UIBarButtonItemStylePlain;   
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.

UIToolbar

*view32 = [[UIToolbar alloc]   
initWithFrame:CGRectMake(0.0, 416.0, 320.0, 44.0)];   
view32.frame = CGRectMake(0.0, 416.0, 320.0, 44.0);   
view32.alpha = 1.000;  
 view32.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleTopMargin;   
 view32.barStyle = UIBarStyleBlackTranslucent;   
 view32.clearsContextBeforeDrawing = NO;   
 view32.clipsToBounds = NO;   
 view32.contentMode = UIViewContentModeScaleToFill;   
 view32.hidden = NO;   
 view32.multipleTouchEnabled = NO;   
 view32.opaque = NO;  
  view32.tag = 0;  
 view32.userInteractionEnabled = YES;   
 UIBarButtonItem *view34 = [[UIBarButtonItem alloc]   
 initWithTitle:(null) style:UIBarButtonItemStylePlain target:nil action:nil];  
  view34.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
  view34.enabled = YESview34.image = nil;   
  view34.style = UIBarButtonItemStylePlain;   
  view34.tag = 0;   
  view34.width = 0.000;   
  UIBarButtonItem *view36 = [[UIBarButtonItem alloc]   
  initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];   
  view36.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
  view36.enabled = YES;   
  view36.style = UIBarButtonItemStylePlain;  
  view36.tag = 0;   
  view36.width = 0.000;   
  UIView *view27 = [[UIView alloc] initWithFrame:CGRectMake(0.0, 0.0, 320.0, 460.0)];   
  view27.frame = CGRectMake(0.0, 0.0, 320.0, 460.0);   
  view27.alpha = 1.000;  
view27.autoresizingMask = UIViewAutoresizingFlexibleRightMargin | UIViewAutoresizingFlexibleBottomMargin;   
view27.backgroundColor = [UIColor colorWithWhite:1.000 alpha:1.000]; view27.clearsContextBeforeDrawing = NO;   
view27.clipsToBounds = NO;   
view27.contentMode = UIViewContentModeScaleToFill;   
view27.hidden = NO;  
 view27.multipleTouchEnabled = NO;  
  view27.opaque = YES;   
  view27.tag = 0;   
  view27.userInteractionEnabled = YES;   
  UIBarButtonItem *view38 = [[UIBarButtonItem alloc]  
   initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];   
   view38.frame = CGRectMake(0.0, 0.0, 0.0, 0.0);   
   view38.enabled = YES;   
   view38.style = UIBarButtonItemStylePlain;   
   view38.tag = 0view38.width = 0.000;   
   UIBarButtonItem *view35 = [[UIBarButtonItem alloc]   
   initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:nil action:nil]; 
view35.frame = CGRectMake(0.0, 0.0, 0.0, 0.0); 
view35.enabled = YES;
 view35.style = UIBarButtonItemStylePlain;   
   view35.tag = 0;   
   view35.width = 0.000;   
   [view27 addSubview:view31];   
   [view32 addSubview:view33];   
   [view32 addSubview:view34];   
   [view32 addSubview:view36];   
   [view32 addSubview:view38];   
   [view32 addSubview:view39];   
   [view32 addSubview:view48];   
   [view32 addSubview:view57];   
   [view32 addSubview:view35];   
   [view32 addSubview:view56];   
   [view32 addSubview:view64];   
   [view32 addSubview:view66];   
   [view27 addSubview:view32]; 
  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53.
  • 54.
  • 55.
  • 56.
  • 57.
  • 58.
  • 59.
  • 60.
  • 61.
  • 62.
  • 63.
  • 64.
  • 65.
  • 66.

小结:iPhone开发工具介绍与应用 (上篇)的内容介绍完了,希望本文对你有所帮助,请深入来了解iphone开发工具。请继续阅读 iPhone开发工具介绍与应用 (下篇)

责任编辑:zhaolei 来源: 网络转载
相关推荐

2011-08-04 16:28:01

iPhone 开发工具 Accessoriz

2011-08-05 10:13:45

iPhone开发工具 Cocoa Xcode

2011-07-19 09:46:38

2010-09-10 13:19:48

放宽限制开发工具iPhone

2011-08-11 10:16:23

iPhoneUIView视图

2011-07-06 17:48:30

iPhone Xcode 模拟器

2017-01-05 14:28:43

Linux内核代码源码

2010-06-03 12:41:45

Linux 开发工具

2011-08-08 16:56:44

iPhone 字符处理 视图

2011-08-15 10:35:43

iPhone开发Atomicnonatomic

2022-10-27 15:57:26

开发工具鸿蒙

2010-02-24 10:57:19

Python开发工具

2010-06-10 17:45:03

Linux 开发工具

2010-01-21 10:44:59

Visual C++

2017-03-12 11:42:21

Linux致远电子内核源码

2010-03-10 09:55:56

Python开发工具

2020-11-19 10:05:03

Java

2010-03-15 15:55:00

Python开发工具

2010-05-28 13:38:29

Linux开发工具

2010-04-26 09:28:43

Oracle数据库
点赞
收藏

51CTO技术栈公众号