- 博客(17)
- 资源 (24)
- 收藏
- 关注
转载 iOS 百度地图的坑
百度地图api点击BMKAnnotationView,不响应didSelectAnnotationView事件。大家都知道,百度地图api封装的比较完整,但有时候,会给我们造成一定的麻烦。 今天在使用百度地图的过程中,发现点击BMKAnnotationView,代理函数: -(void)mapView:(BMKMapView *)mapView didSelectAnn
2014-06-11 10:01:20
1279
转载 About [NSArray containsObject:]
he documentation for [NSArray containsObject:] says:This method determines whether anObject is present in the receiver by sending an isEqual: message to each of the receiver’s objects (and passing
2013-02-28 21:01:35
1705
原创 Block的循环引用
在Block编程的过程中很容易循环引用如图一 图一需要用弱引用或手动打破循环引用如图二 图二弱引用的几种写法__weak __typeof(&*self)weakSelf = self;__weak __typeof(self) w
2013-01-26 18:50:13
1757
转载 本地推送UILocalNotification
1、增加一个本地推送//设置20秒之后 NSDate *date = [NSDatedateWithTimeIntervalSinceNow:20]; //chuagjian一个本地推送 UILocalNotification *noti = [[[UILocalNotificationalloc]init]autorelease]; if (n
2012-12-18 16:34:49
551
原创 关于获取documents路径
第一种 //Returns the path to the application's Documents directory. // 方法1 iOS4.0版本以上的可以使用该方法获取url - (NSURL *)applicationDocumentsDirectory_New { //Availability: iOS 4.0 a
2012-12-17 15:22:56
3553
原创 关于Xcode的项目文件夹
当我们在打开的项目中,对某个文件夹 Show in Finder的时候,发现对代码的分类文件夹没有全在一堆,在项目中明明对代码分了类,为什么在Finder中没有文件夹??这是因为,Xcode项目中的文件路径都是虚拟的,在APP中实际不存在,即在APP中,几乎所有的文件都可以从mainBundle根目录下直接访问,当然,例外总是存在的在将文件/文件夹加入到项目时,有这样两个选项“ Creat
2012-12-15 17:25:30
8431
原创 三种动态加载方法
第一种[[NSBundle mainBundle] loadNibNamed:@"Empty" owner:self options:nil];取返回的NSArray中 第一个第二种 Nib *nib = [UINib nibWithNibName:@"Empty" bundle:[NSBundle mainBundle]];[[nib instantiateWithOwne
2012-12-11 16:42:09
846
转载 performSelectorOnMainThread: vs dispatch_async on main queue
By default, -performSelectorOnMainThread:withObject:waitUntilDone: only schedules the selector to run in the default run loop mode. If the run loop is in another mode (e.g. the tracking mode), it won'
2012-12-09 14:43:37
1644
转载 C 中常用宏定义
在将一个C源程序转换为可执行程序的过程中, 编译预处理是最初的步骤. 这一步骤是由预处理器(preprocessor)来完成的. 在源流程序被编译器处理之前, 预处理器首先对源程序中的"宏(macro)"进行处理.C初学者可能对预处理器没什么概念, 这是情有可原的: 一般的C编译器都将预处理, 汇编, 编译, 连接过程集成到一起了. 编译预处理往往在后台运行. 在有的C编译器中, 这些
2012-11-30 15:31:58
2171
转载 IOS触摸事件监听和操作
在IOS开发中会遇到各种操作事件,通过程序可以对这些事件做出响应。首先,当发生事件响应时,必须知道由谁来响应事件。在IOS中,由响应者链来对事件进行响应,所有事件响应的类都是UIResponder的子类,响应者链是一个由不同对象组成的层次结构,其中的每个对象将依次获得响应事件消息的机会。当发生事件时,事件首先被发送给第一响应者,第一响应者往往是事件发生的视图,也就是用户触摸屏幕的地方。事件将沿
2012-11-27 10:42:36
11198
原创 隐藏键盘的三种方法
第一种通过设置UITextFiledDelegate的方法- (BOOL)textFieldShouldReturn:(UITextField *)textField{ [textField resignFirstResponder]; return YES;}取消键盘作为第一响应隐藏键盘第二种通过设置view继承自UIControl - (IBAction)bac
2012-11-26 17:40:12
1140
转载 使用 UIWebView 来播放视频
MPMoviePlayerController 并不是继承自 UIViewController SDK 中的例子使用的是 addSubviews 的方式来添加 MPMoviePlayerController.view 在 UIWebView 中响应事件,然后调用 [MPMoviePlayerController play] 是什么也看不到的。 最方便播放视频的方法是使用 U
2012-11-23 15:23:42
1750
原创 XCode Build Settings中几种Search Paths
来源于:http://stackoverflow.com/questions/8342982/ios-clarify-different-search-pathsup vote6 down vote accepted Framework search path: where to search frameworks (.framework bundles) in add
2012-11-20 19:12:43
17080
原创 IOS项目为什么加入静态数据库需要加入-ObjC and -all-load in Other Linker Flag
答案在此 http://stackoverflow.com/questions/8179869/should-i-include-objc-and-all-load-in-other-linker-flag-to-all-my-ios-projec
2012-11-20 17:46:14
2992
原创 创建单实例的两种方法
+ (MyClass *)sharedInstance{ static MyClass *sharedInstance = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ sharedInstance = [[MyClass alloc] init]; //Do
2012-11-05 15:27:27
580
转载 初始化一个只读属性
Either assign to the instance variable directly (don't forget to add a retain orcopy if you need it) or redeclare the property in a private class extension. Like this:In your .h file:@property (
2012-11-05 15:11:12
1061
原创 使用Core Data
通过观看斯坦福2011年冬的公开课程视频 Core Data总结Opening a UIManagedDocument- (id)init{ if (self = [super init]) { NSURL *documentUrl = [[[NSFileManager defaultManager]URLsForDirectory:NSDoc
2012-11-05 15:02:35
610
Programming in Objective-C.pdf (第四版)
2012-06-11
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人