随笔分类 -  IOS

When to use dequeueReusableCellWithIdentifier vs dequeueReusableCellWithIdentifier: forIndexPath
摘要:The most important difference is that the forIndexPath: version asserts (crashes) if you didn't register a class or nib for the identifier. The older 阅读全文

posted @ 2016-05-11 11:36 cokecoffe 阅读(936) 评论(0) 推荐(0)

iOS 7.1 安装 企业应用 提示 无法下载应用程序
摘要:首先这种情况排除https影响,这个就不提了。请自行查询iOS https 部署。 其次系统版本是iOS 7.1,之后的版本安装都没问题。 说下我是怎么发现问题的,我找了个真机,发现直接调试提示bundle version缺失,好了,问题就出在这里,我们程序中只使用了 bundle version 阅读全文

posted @ 2016-04-13 15:11 cokecoffe 阅读(427) 评论(0) 推荐(0)

AutoLayout那些坑
摘要:最近在做一个聊天界面,要适配iOS所有屏幕。以前的思路是键盘弹出的时候去改table 和输入框的frame。现在发现和autolayout的约束有冲突。搞了半天发现需要动态改Constraint。- (void)keyboardDidShow:(NSNotification *)notificati... 阅读全文

posted @ 2014-10-15 14:18 cokecoffe 阅读(517) 评论(0) 推荐(0)

欲善其事必先利其器---Xcode插件
摘要:Xcode所有的插件都安装在目录~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/Alcatraz(用于管理xcode插件、管理Xcode工程模版以及颜色配置的功能)Quick Start:1 mkdir -p ~/Libra... 阅读全文

posted @ 2014-07-02 16:13 cokecoffe 阅读(291) 评论(0) 推荐(0)

UnWind Segue
摘要:iOS 6 和 Xcode 4.5 中添加了一个新特性叫做“Unwind Segue”。使用Unwind Segue,可以方便的在Navigation Controller的Controllers之间回退–返回至前若干个Controller。例如,Navigation Controller栈中有五个Controller:A、B、C、D、E,其中A push B,B push C,…,以此类推。假如我想从E退回至B或D退回至A或E退回至A,可以方便的使用Unwind Segue实现。 阅读全文

posted @ 2014-02-25 14:32 cokecoffe 阅读(1840) 评论(0) 推荐(0)

EventKit 学习(译)
摘要:From:http://docs.xamarin.com/guides/ios/platform_features/introduction_to_eventkit/ 本教程展示了对于如何通过EventKit访问和使用存储在日历数据库(Calendar Database)中的日历(Calendars)、日历事件(CalendarEvents)和提醒的概述。并且讲述了重要的类(Class)还有他们的在编程中的用法,当然还有一些有关EventKit框架的常用任务。 概述 iOS有两个内建的日历应用:Calendar,Reminders。很显然能看出Calendar是管理日历数据的,而Remi... 阅读全文

posted @ 2014-01-08 23:44 cokecoffe 阅读(5040) 评论(0) 推荐(0)

IOS 多线程
摘要:1.NSThread2.NSOperation NSOperationQueue3.GCD 阅读全文

posted @ 2013-12-20 16:41 cokecoffe 阅读(323) 评论(0) 推荐(0)

Apple的优秀程序范例
摘要:1.The Elementsapple的一个元素周期表的demo,标准MVC范例。2.UICatalogapple的一个UI使用的demo。常用的控件都包括在内了,适合初学者。3.EADemoapple的连接MFI的demo。reference:https://developer.apple.com/library/ios/navigation/#section=Resource%20Types&topic=Sample%20Code 阅读全文

posted @ 2013-06-09 15:27 cokecoffe 阅读(505) 评论(0) 推荐(0)

关联引用(Associative References)-------为现有类添加变量
摘要:能够模拟添加一个实例变量到一个已有的类中,能够添加存储到一个对象中而不需要改变类的定义。1.通过分类给已有类添加属性1 @interface Person:NSObject2 @end3 4 @implementation Person5 @end 1 @interface Person(EmailAddress) 2 @property (nonatomic,readwrite,copy)NSString *emailAddress; 3 @end 4 5 @implement Person(EmailAddress) 6 7 static char emailAddressKe... 阅读全文

posted @ 2013-04-15 11:47 cokecoffe 阅读(284) 评论(0) 推荐(0)

IOS Soap WebService
摘要:项目中与服务器交互使用的是Soap WebServcie,原来是自己封装的Request结构。看这个例子。以前知道有wsdl2Objc这个东西,但是没研究过。今天试用了下,发现这个真是个好东西,使用起来非常方便。这里有个简单的教程:iPhone Development: Accessing SOAP Services with WSDL2ObjC这里有个中文的博客也说的比较清楚 IOS netProgramming这里是官方的使用说明我写的一个例子,里面也有用法说明https://github.com/cokecoffe/ios-demo/tree/master/WSDL2ObjC_examp 阅读全文

posted @ 2013-03-27 11:18 cokecoffe 阅读(2661) 评论(0) 推荐(0)

<译>IOS 外设编程主题
摘要:<原文链接>https://developer.apple.com/library/ios/#featuredarticles/ExternalAccessoryPT/Introduction/Introduction.html#//apple_ref/doc/uid/TP40009502关于外设 ExternalAccessory.framework为外设与任何iOS设备提供了一种交流的管道。开发者可以利用这个管道将外设的特性扩展到他们的应用程序中。 和外设交互需要你和外设硬件厂商密切合作,理解外设提供的服务。厂商必须在外设中构建与ios交互构建明确的支持。作为支持的一部分,一个 阅读全文

posted @ 2013-03-14 16:01 cokecoffe 阅读(6505) 评论(0) 推荐(0)

dispatch queue demo
摘要:Gist关于分发队列的demo,按照《IOS5 cook book》做的。 阅读全文

posted @ 2013-03-12 10:20 cokecoffe 阅读(193) 评论(0) 推荐(0)

Objective-C 中 +load 与 +initialize
摘要:+(void)load 阅读全文

posted @ 2013-01-06 14:50 cokecoffe 阅读(350) 评论(2) 推荐(0)

持久化 轻量数据
摘要:今天在使用NSUserDefault的时候报错Attempt to insert non-property value .... of class。原因是:我存储的是自定义对象,而NSUserDefault只支持部分内置对象的存储。解决办法:Here is one example per request:Save:NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];NSMutableArray *arr = ... ; // set valueNSData *data = [NSKeyedArchiver archi 阅读全文

posted @ 2012-11-19 11:31 cokecoffe 阅读(315) 评论(0) 推荐(0)

IOS 纹理填充 背景
摘要:1 UIView *testView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 200, 50)];2 testView.backgroundColor = [UIColor colorWithPatternImage: [UIImage imageNamed:@"纹理图片.png"]];原来一直都是用的都是一整张图 --! 阅读全文

posted @ 2012-11-15 23:45 cokecoffe 阅读(843) 评论(0) 推荐(0)

UITableView image gcd
摘要:1 if (![[NSFileManager defaultManager] fileExistsAtPath:[path stringByAppendingPathComponent:@"image.png"]]) 2 { 3 dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul); 4 dispatch_async(queue, ^{ 5 NSString *url=[pat stringByAppendingPathComponent:@... 阅读全文

posted @ 2012-11-08 17:53 cokecoffe 阅读(445) 评论(0) 推荐(0)

Core plot 的资料
摘要:ios上绘制统计的饼图、柱状图、曲线图。找到了比较好的教程,使用的是core plot开源库实现part1.讲了如何配置环境,和绘制饼图http://www.raywenderlich.com/13269/how-to-draw-graphs-with-core-plot-part-1part2.绘制柱状图和曲线图http://www.raywenderlich.com/13271/how-to-draw-graphs-with-core-plot-part-2这里有个不错的介绍:http://code.google.com/p/nevel-mercury/wiki/CorePlotHighL 阅读全文

posted @ 2012-10-11 15:50 cokecoffe 阅读(536) 评论(0) 推荐(0)

关于UIView的
摘要:有时候开发了很多时间,但是那些细节的东西缺可能没有关注到。UIView的几个属性frame(边框)bounds(边界)center(中心)frame是一个CGRect结构体类型的属性。它指的是该view相对于父view的坐标系统的位置和中心。bounds是指的该view在本身坐标系统中的位置和大小。区别就是参照的坐标系统,frame是父view,bounds是自身。看下编程指南里的示例图:左侧的frame决定了这张图片在灰色的父view中的位置和大小。右侧的bounds决定了要将自身的哪一部分显示出来,默认是原点是(0,0)。如果bounds改变,而frame不变,那么它显示在父视图的部分将改 阅读全文

posted @ 2012-09-23 00:07 cokecoffe 阅读(2327) 评论(0) 推荐(0)

限制UITextField输入字符个数
摘要:摘自http://yul100887.blog.163.com/blog/static/20033613520124123332476/要控制输入到文本字段中的文本,我们需要使用委托的方式来实现。无论何时,当文本修改的时候,就会调用textField:shouldChangeCharactersInRange:replacementString:委托方法。例如我们可以使用这个方法来限制输入的字符的个数:代码如下: 1 - (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range r 阅读全文

posted @ 2012-09-12 11:37 cokecoffe 阅读(2820) 评论(0) 推荐(0)

遍历NSDictionary
摘要:[dic enumerateKeysAndObjectsUsingBlock:^(id key, id obj, BOOL *stop) 阅读全文

posted @ 2012-09-04 17:09 cokecoffe 阅读(278) 评论(0) 推荐(0)

导航