Fork me on GitHub
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 125 下一页

2012年3月20日

摘要: 1.概述许多初学者对C/C 语言中的void及void指针类型不甚理解,因此在使用上出现了一些错误。本文将对void关键字的深刻含义进行解说,并详述void及void指针类型的使用方法与技巧。2.void的含义void的字面意思是“无类型”,void *则为“无类型指针”,void *可以指向任何类型的数据。void几乎只有“注释”和限制程序的作用,因为从来没有人会定义一个void变量,让我们试着来定义:void a;这行语句编译时会出错,提示“illegal use of type 'void'”。不过,即使void a的编译不会出错,它也没有任何实际意义。void真正发挥的 阅读全文
posted @ 2012-03-20 01:23 pengyingh 阅读(30376) 评论(3) 推荐(4)
摘要: 1.Preprocessor Glue: The ## Operator预处理连接符:##操作符Like the # operator, the ## operator can be used in the replacement section of a function-like macro.Additionally, it can be used in the replacement section of an object-like macro. The ## operator combines two tokens into a single token.##将两个符号连接成一个。F 阅读全文
posted @ 2012-03-20 01:21 pengyingh 阅读(12067) 评论(0) 推荐(3)

2012年3月19日

摘要: IOS 入门开发之使用XCODE4制作静态库详解注意:首先确保你的XCODE4使用IOS5,否则请下载IOS5在继续阅读。IOS程序是由Objective-c语言构成,而是Objective-c语言中每一个类又分成.h .m 文件。静态库可以将这些程序的类封装成一个.a文件,第三方应用程序只需要拿到这个.a文件和代码对应的.h文件即可使用静态库中封装的方法。总的来说IOS静态库适合去制作第三方提供的SDK,废话不多说了我们直接进正题。首先打开Xcode4创建一个静态库工程,如下图选择Framework&Library ->Cocoa Touch Static Library (创 阅读全文
posted @ 2012-03-19 22:08 pengyingh 阅读(2317) 评论(0) 推荐(0)
摘要: -(IBAction)button:(id)sender{ UIButton* button = (UIButton*)sender; UITableViewCell* buttonCell = (UITableViewCell*)[sender superview]; NSUInteger row = [[tableView indexPathForCell:buttonCell]row]; } 阅读全文
posted @ 2012-03-19 21:24 pengyingh 阅读(2737) 评论(1) 推荐(0)
摘要: 默认情况下。是有生成,可能你不知道在哪里。Xcode-->perferences--> locationsDerived Data,下面有一个路径:/Users/Liam/Library/Developer/Xcode/DerivedData这个就是默认的生成路径。点击旁边的箭头就可跳转到该文件夹。这里不值程序的目标文件,还有其他的生成的文件。如果你想在项目中也生成一份,那么就点击Advanced按钮。将Build Location,选择“locations specified by targets”就可以了。这时你在Build,那么项目路径下就会产生Build目录。targets 阅读全文
posted @ 2012-03-19 21:23 pengyingh 阅读(4248) 评论(0) 推荐(0)
摘要: 前置简短概述引入内联函数的目的是为了解决程序中函数调用的效率问题。 函数是一种更高级的抽象。它的引入使得编程者只关心函数的功能和使用方法,而不必关心函数功能的具体实现;函数的引入可以减少程序的目标代码,实现程序代码和数据的共享。但是,函数调用也会带来降低效率的问题,因为调用函数实际上将程序执行顺序转移到函数所存放在内存中某个地址,将函数的程序内容执行完后,再返回到转去执行该函数前的地方。这种转移操作要求在转去前要保护现场并记忆执行的地址,转回后先要恢复现场,并按原来保存地址继续执行。因此,函数调用要有一定的时间和空间方面的开销,于是将影响其效率。特别是对于一些函数体代码不是很大,但又频繁地被调 阅读全文
posted @ 2012-03-19 10:38 pengyingh 阅读(30856) 评论(0) 推荐(1)
摘要: 论坛会员kibernet分享的iOS Framework 制作教程,并且不是静态包。我们使用一种变通的方法来制作 iOS framework,废话不多说,上步骤:1.打开Xcode创建一个“Cocoa Touch Static Library”工程,并删除现有的target.2.右键project选择添加New Target,在弹出的窗口中找到Cocoa ,在Cocoa右侧窗口中选择“Loadable Bundle”。注意:到这步的时候不要选择framework,应为framework是MAC OS上的,iOS是不支持的,但是iOS 支持“Loadable Bundle(cfbundle)”3 阅读全文
posted @ 2012-03-19 10:35 pengyingh 阅读(477) 评论(0) 推荐(0)
摘要: Previously I explainedhow to make a static librarythat simultaneously supports multiple different CPUs. At that time I was ignorant to the reason why there are no means to make iPhone frameworks. But I did not give up searching, especially since apparently a few individuals seemed to have pulled it 阅读全文
posted @ 2012-03-19 10:32 pengyingh 阅读(200) 评论(0) 推荐(0)
摘要: For some reason Apple reserves the ability to create iPhone frameworks for their own use. They are a very useful ability to have because they package headers together with a universal binary. „Universal“ meaning that you get binary code for multiple platforms rolled into a single file. Frameworks ar 阅读全文
posted @ 2012-03-19 10:31 pengyingh 阅读(367) 评论(0) 推荐(0)
摘要: 很多iPhone聊天程序消息显示都喜欢做成iChat的泡泡样式,这样是不是很apple呢?那么下面用一种简单的方法来实现它。主要通过UIlabel的sizeToFit方法自动计算文本区域大小UIImage的- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWidth topCapHeight:(NSInteger)topCapHeight;方法拉伸图片可以根据文本内容自动适应算泡泡高度- (UIImage *)stretchableImageWithLeftCapWidth:(NSInteger)leftCapWid 阅读全文
posted @ 2012-03-19 10:29 pengyingh 阅读(374) 评论(0) 推荐(0)
上一页 1 ··· 51 52 53 54 55 56 57 58 59 ··· 125 下一页

导航