- 博客(35)
- 资源 (5)
- 收藏
- 关注
原创 NSData 转 NSDictionary (网络同步GET)
小项目中发现的问题,纠结了半天;- (void)getJsonForData{ for (NSDictionary *dic in self.dataArray) { NSString *str = [dic objectForKey:@"url"]; NSURL *url = [NSURL URLWithString:str];
2014-07-15 18:20:54
1075
原创 诡异事件之自定义UINavigationController
自定义UINavigationController后,发现在执行pop操作的shi h
2014-07-10 14:26:28
545
原创 常用正则表达式总结
if (_isEmailField){ NSString *emailRegEx = @"(?:[A-Za-z0-9!#$%\\&'*+/=?\\^_`{|}~-]+(?:\\.[A-Za-z0-9!#$%\\&'*+/=?\\^_`{|}" @"~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\
2014-07-07 16:27:54
537
原创 常用定义总结
#import "AppDelegate.h"// 应用程序托管#define AppDelegateInstance ((AppDelegate*)([UIApplication sharedApplication].delegate))// 其它的宏定义#ifdef DEBUG #define
2014-07-07 10:25:19
643
原创 实现购物车动画
//加入购物车 步骤1- (void)addToShopCar:(UIButton *)bt{ NSLog(@"1111"); //得到产品信息 UITableViewCell *cell = (UITableViewCell *)[bt superview]; NSIndexPath *indexPath = [mainTable indexPathForCel
2014-07-05 17:58:57
729
转载 线程管理
线程管理Mac OS X和iOS里面的每个进程都是有一个或多个线程构成,每个线程都代表一个代码的执行路径。每个应用程序启动时候都是一个线程,它执行程序的main函数。应用程序可以生成额外的线程,其中每个线程执行一个特定功能的代码。当应用程序生成一个新的线程的时候,该线程变成应用程序进程空间内的一个实体。每个线程都拥有它自己的执行堆栈,由内核调度独立的运行时间片。一个线程可以和其他线
2014-07-04 17:37:58
687
转载 Application Kit框架的线程安全
Application Kit框架的线程安全以下部分介绍了Application Kit框架的线程安全。 非线程安全类以下这些类和函数通常是非线程安全的。大部分情况下,你可以在任何线程使用这些类,只要你在同一时间只有一个线程使用它们。查看这些类的文档来获得更多的详细信息。NSGraphicsContext。多信息,参见“NSGraphicsContext
2014-07-04 17:33:00
700
转载 基础框架(Fondation Framework)的线程安全
基础框架(Fondation Framework)的线程安全有一种误解,认为基础框架(Foundation framework)是线程安全的,而Application Kit是非线程安全的。不幸的是,这是一个总的概括,从而造成一点误导。每个框架都包含了线程安全部分和非线程安全部分。以下部分介绍Foundation framework里面的线程安全部分。 线程安全的类和函数
2014-07-04 17:32:52
747
原创 判断屏幕大小
#define IPhone5 ([UIScreen instancesRespondToSelector:@selector(currentMode)] ? CGSizeEqualToSize(CGSizeMake(640, 1136), [[UIScreen mainScreen] currentMode].size) : NO)
2014-07-01 16:41:53
599
原创 使用FMDB第三方写简单的demo
FMDB有三个主要的类1.FMDatabase – 表示一个单独的SQLite数据库。 用来执行SQLite的命令。2.FMResultSet – 表示FMDatabase执行查询后结果集3.FMDatabaseQueue – 如果你想在多线程中执行多个查询或更新,你应该使用该类。这是线程安全的。
2014-06-25 08:55:58
721
转载 前端素材集锦
1.Awwwards--The awards for design, creativity and innovation on the internet2.CSS Winner--CSS Award Gallery for Web Design Inspiration3.Best CSS--Best CSS, Website Gallery, CSS Galleries, Best
2014-06-21 11:29:49
733
原创 Why Use Blocks?
Blocks are a powerful C-language feature that is part of Cocoa application development. They are similar to “closures” and “lambdas” you may find in scripting and programming languages such as Ruby,
2014-06-19 15:57:56
520
原创 UITableView删除移动多选其他基本操作总结
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath{ NSLog(@"删除"); if (UITableViewCellEditingSty
2014-06-18 19:19:41
708
原创 Skinnier Controllers Using View Categories
Skinnier Controllers Using View CategoriesBrent Simmons explains in a recent post how not to skip the C in MVC when binding model objects to views like UITableViewCell. While I agree with everythi
2014-06-18 15:39:17
668
转载 整洁的 Table View 代码
Table view 是 iOS 应用程序中非常通用的组件。许多代码和 table view 都有直接或间接的关系,随便举几个例子,比如提供数据、更新 table view,控制它的行为以及响应选择事件。在这篇文章中,我们将会展示保持 table view 相关代码的整洁和良好组织的技术。UITableViewController vs. UIViewControllerApple
2014-06-18 14:51:16
372
原创 字符 是整形常量吗?
char 是 charint 是 int你说char 是 int ?还是char 只是 字符 ?学习是个慢过程,偶尔的发现,我自己便乐呵了。。。一开始一直觉得char 就是 字符 ,整形常量 就是整形常量 这怎么能相同呢?问题的原因可以追溯到 switch 结构来讲讲自己的经历:switch()括号中的参数类型,这
2014-06-16 20:30:49
2725
原创 iOS开发必备网站搜集
国内相关:http://www.oschina.net/(代码和技术分享交流,很多其他领域)http://www.devdiv.com/(代码和技术分享交流,三大手机平台的)http://www.cocoachina.com/(代码和技术分享交流,仅仅是苹果方面的)http://code4app.com/(代码和技术分享交流,仅仅是苹果方面的)http://www.lanren
2014-06-14 08:40:51
651
原创 Target-Action 设计模式
Target-ActionTarget-action is a design pattern in which an object holds the information necessary to send a message to another object when an event occurs. The stored information consists of two i
2014-06-12 08:51:28
726
原创 人机交互手势
常见的几种人机交互模式:轻点,拖拽,滑动,轻扫,双击,双指开合,长按,摇晃在做开发的时候,切记遵循以下几点:(游戏开发者除外)避免为系统默认的手势赋予不同的行为。避免定义新的手势。避免重复创建和标准手势具有相同行为的手势。在ipad开发上,可以考虑使用多手势。
2014-06-10 22:41:11
1718
原创 手势总结
// 手势识别器 // 1.轻拍手势 // 手势需要在定义时绑定一个触发方法(SEL) UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAction:)]; // 轻拍的设置
2014-06-10 20:31:12
747
原创 深拷贝 浅拷贝
at the beginning I thought.if B is a shallow copy of A, then it is like B = [A assign];B and A point to the same memory locationIf B is a deep copy of A, then it is like B = [A copy];B
2014-06-10 20:18:06
436
原创 隐藏键盘总结
1. [view endEditing:YES] 2. [textFiled resignFirstResponder] 3.重写touch事件来实现对键盘的隐藏
2014-06-10 20:14:07
496
target-action设计模式
2014-06-12
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人