Fork me on GitHub
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 125 下一页

2012年5月15日

摘要: [timer release] only needs to be called if you “own” the timer. From Apple’s documentation:Because the run loop maintains the timer, from the perspective of memory management there’s typically no need to keep a reference to a timer once you’ve scheduled it. Since the timer is passed as an argument w 阅读全文
posted @ 2012-05-15 20:06 pengyingh 阅读(1096) 评论(0) 推荐(0)
摘要: 本文介绍Objective C中实现观察者模式(也被称为广播者/监听者、发布/注册或者通知)的五种方法以及每种方法的价值所在。该文章将包括:1 手动广播者和监听者(Broadcaster and listeners)2 键-值观察(Key Value Observing)3 通知中心(Notification center)4 上下文通知(Context notification)5 用于观察的委托(Delegate)关于观察者观察者模式是维持两个模块之间抽象关系的最强大的方式之一。观察者模式包括一个发布已发生事件的模块以及响应该事件的另一模块的若干个的实例。它和直接调 用第二个模块的方法不同 阅读全文
posted @ 2012-05-15 20:05 pengyingh 阅读(305) 评论(0) 推荐(0)
摘要: 1、确定你的项目工程的resouce下有你要用的字体文件(.ttf,.odf)。2、 然后在你的工程的Info.plist文件中新建一行(Add Row),添加key为:UIAppFonts,类型为Array或Dictionary都行;在UIAppFonts下再建立一个键值对,key 为:Item 0,添加Value为XXX.ttf(你字体的名字,string型),可以添加多个,使用的时候写对应字体名字就行。3、在你的项目里要用字体的时候 xx.font = [UIFont fontWithName:@"XXX" size:20.0],这样就可以了 阅读全文
posted @ 2012-05-15 20:04 pengyingh 阅读(259) 评论(0) 推荐(0)
摘要: http://www.10bay.com/一般来说UINavigationController是作为UIWindow的子view来使用的,例如当你创建一个Navigation类型的应用程序时,系统会将AppDelegate中的navigationController做为window的根控制器self.window.rootViewController = self.navigationController; [self.window.makeKeyAndVisible];UINavigationController在放置自己的位置时,会默认考虑到状态条,并在顶部留出20px的空白位置。但是当将 阅读全文
posted @ 2012-05-15 19:31 pengyingh 阅读(1189) 评论(0) 推荐(0)
摘要: ModalViewController可以有不同的呈现类型(modalPresentationStyle),在ipad下要提供多方向支持时,就要注意可能要改变ModalViewController的呈现方式,列举如下:1. UIModalPresentationFullScreen:全屏模式,即弹出窗口占满整个屏幕,在portrait模式和landscape模式下都一样。2. UIModalPresentationFormSheet:会将窗口缩小,使之居于屏幕中间,在portrait和landscape下都一样,但要注意landscape下如果软键盘出现,窗口位置会调整。3. UIModalP 阅读全文
posted @ 2012-05-15 19:29 pengyingh 阅读(622) 评论(0) 推荐(0)
摘要: rom:http://mithin.in/2009/08/26/detecting-taps-and-events-on-uiwebview-the-right-way/Recently, I was working on a project which required detection of tap and events on the UIWebView. We wanted to find out the HTML element on which the user taps in the UIWebView and then depending on the element tapp 阅读全文
posted @ 2012-05-15 19:28 pengyingh 阅读(488) 评论(0) 推荐(0)
摘要: http://www.10bay.com/?p=149[[session inputStream] scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];因主线程有事务要处理,会阻塞主线程外设事件的触发;解决:“将socket的runloopsource添加到新开的线程的runloop中,并在新线程中显示启动runloop就可以了”创建一个线程,取得它的runloop,然后用类似上面的代码将其加入,这样就不会阻塞接收数据事件的回调了。即[NSThread detachNewThreadSelec.. 阅读全文
posted @ 2012-05-15 19:25 pengyingh 阅读(616) 评论(0) 推荐(0)
摘要: I'm trying to useCommonCryptoto generate keys usingPBKDF2but I can't seem to importCommonCrypto/CommonKeyDerivation.h, I just errors that it is not found.Any ideas?edit: I should probably mention I have already added the security framework and I can import all of the otherCommonCryptoheaders 阅读全文
posted @ 2012-05-15 12:01 pengyingh 阅读(3373) 评论(1) 推荐(0)
摘要: ask: I want to upload an image to server .I know to convert image ti NSData and then send it to server but is there any way to send complete image from your bundle to server without byte conversion? If there is a way i will be thankful if someone provide me details about thisanswer:Any thing that ha 阅读全文
posted @ 2012-05-15 11:58 pengyingh 阅读(266) 评论(0) 推荐(0)
摘要: Apple Keychain Services offer a secure means to store sensitive information. Through the keychain, all the hardwork is managed for you to store and retrieve content. As powerful as the keychain services are, I was recently tinkering with some code to see if I could obfuscate content within an applic 阅读全文
posted @ 2012-05-15 11:00 pengyingh 阅读(439) 评论(0) 推荐(0)
上一页 1 ··· 22 23 24 25 26 27 28 29 30 ··· 125 下一页

导航