`
woainike
  • 浏览: 78227 次
  • 性别: Icon_minigender_1
  • 来自: 武汉
最近访客 更多访客>>
社区版块
存档分类
最新评论
文章列表

宏表达式

    在方法头上通过   #define ELTYPE(typeName) (NSOrderedSame == [elementName caseInsensitiveCompare:@#typeName])的写法,在方法里面的实用   - (void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName                                         namespaceURI:(NSString *)namespaceURI              ...
Bells And Whistles The iPhone has a set of nice transition animations which makes the experience using it very pleasant. But after a while one get so used of them that one stop noticing that they are even there. But this is not necessary a bad thing. Often I think that really good things doe ...

动画过场

动画过场效果,今天想到一个好的效果,来改变,两个图片只见的,一闪而过的效果,   其实,这个办法也就是,当前的图片是一定的,如果用另外一个图片去替换的花,那就用一个效果,就是  图片a 图片b   过场:当前图片a,动画效果缩小,当达到自己规定的比例的时候,拿到最新的图片b,并且的初始的动画状态,为图片a,缩小后的大小,然后将图片b,放大到图片a,当初的位置和大小即可。     时间把握上,最好,就是中间的时间不能太长,至于这个时间比例,自己测试下吧。   有时间就上上代码。    
执行环境   可以从 UIDevice 的属性 model 得到在现在执行的环境。例子如下:     NSString *modelname = [[UIDevice currentDevice]model]; if ([modelname isEqualToString:@"iPhone"]) {   // iPhone } if ([modelname isEqualToString:@"IPod Touch"]) {   // iPod touch } if ([modelname isEqualToString:@&q ...
NSString是定义固定大小的字符串,NSMutableString可变,可对字符串做增、删、改、插入等操作。 源代码strings.m ----------------------------------- #import <Foundation/Foundation.h> int main (int argc, const char * argv[]) {    NSAutoreleasePool * pool = ...
本文来源自:http://www.cocoachina.com/bbs/read.php?tid=41245 类似参考还有:http://www.cocoachina.com/bbs/read.php?tid-31022.html 将ipone项目转到ipad平台,如果有多个xib文件,该怎么办? 1。 首先,不能把问题考虑复杂了,这个转化其实很简单。2。 ...
Bump 有一个小功能是给你身边的人交换应用程序;但是iOS是没有接口提供开发者去获取用户手机所安装的app的,但是,为什么Bump这款通过正规渠道(Appstore)下载的应用却能够获取用户安装应用清单呢?原来,我们还是有一些绕弯的方法来获得用户安装的软件的。网址:http://amitay.us/blog/files/how_to_detect_installed_ios_apps.php  中列出了4种用于检测用户安装的软件的方法:     方法一:http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLSch ...
很多时候,在使用Automatic Reference Counting的是时候,会提示一些很陌生的的错误提示,特别是使用conver to arc后,   比如bridged cast  给你的c代码上面加个_bridged。   这里面有个详细的描述,   A bridged cast is a C-style cast annotated with one of three keywords: (__bridge T) op casts the operand to the destination type T. If T is a retainable obje ...
明显的属性参数的改变 retain ---strong assing ---unsafe_unretaind   这里面说明下,assing, assign指的就是派遣,分配.     为什么id<sthDelegate> delegate 用的是assign?   elegate 实际上指向的是某个类的实例我的理解是assign 一般用在 int ,float 这些不需要释放的资源上。为什么 id delegate 也用 assign     这个要根据语境来判断吧。一般来说property的setter不应该是assign的,除非是poco的对象。 ...
开发iPhone 应用程序并不难,基本上就是三个词 - “memory, memory, memory” 。iPhone OS 对内存的要求很严格,有memory leak ,杀掉;内存使用超限额,杀掉。一个经过测试的程序,在使用过程中90%以上的崩溃都是内存问题造成的。在这里简单总结一下Object-C 内存管理。   基本概念   Object-C 的内存管理基于引用计数(Reference Count)这种非常常用的技术。简单讲,如果要使用一个对象,并希望确保在使用期间对象不被释放,需要通过函数调用来取得“所有权”,使用结束后再调用函数释放“所有权”。“所有权”的获得和释放,对应 ...

Iphone声明周期

看图。
对于不同的viewcontroller之间数据的共享和处理,总结有下面几种方式       1)采用代理模式 子viewcontroller设计 代理协议,定义协议接口,父viewcontroller 实现协议接口,实现子viewcontroller 退出时将相关数据更新到父视图。2)采用ios的消息机制 父viewcontroller注册消息 子viewcontroller 发送消息,触发父viewcontroller的消息处理。3)采用database做为数据中间的存储媒介,子viewcontroller将状态数据存入DB,父viewcontroller从DB获取数据更新view。4 ...
      NSArray 对象保存 NSString *strOne = @"Persistent data1"; NSString *strTwo = @"Persistent data 2";  NSMutableArray *persistentArray = [[NSMutableArray alloc] init]; [persistentArray addObject:strOne]; [persistentArray addObject:strTwo];    NSArray *filePathArray = NSSearch ...
    if([TabBarController.moreNavigationController.topViewController.view isKindOfClass:[UITableView class]]){           //         UITableView * moreView = (UITableView*)TabBarController.moreNavigationController.topViewController.view;           if([[TabBarController.moreNavigationController. ...
举例说明怎么简单的创建一个子线程。 用到的类是NSThread类,这里使用detachNewTheadSelector:toTagaet:withObject创建一个线程。 函数setupThread:(NSArray*)userInfor。通过userInfor将需要的数据传到线程中。 函数定义: -(void)setupThread:(NSArray*)userInfor{    [NSThread detachNewThreadSelector:@selector(threadFunc:) toTarget:self withObject:(id)userInfor]; ...
Global site tag (gtag.js) - Google Analytics