- 博客(18)
- 资源 (1)
- 收藏
- 关注
原创 ios GCD
// // MainViewController.m // GCD // // Created by hejin on 13-12-29. // Copyright (c) 2013年 e世雕龙. All rights reserved. // #import "MainViewController.h" @interface MainViewController () @prope
2015-05-29 15:07:19 870
原创 ios 多线程加载图片
NSThread异步加载图片-(void)downloadImage:(NSIndexPath *)indexPath { @autoreleasepool { …… UIImage * image = [UIImage imageWithData:data]; if(image != nil){ [self.imagesCache
2015-05-29 10:09:13 1884
原创 ios 多线程 NSThread Cocoa NSOperation GCD
NSThread: •一个NSThread对象控制一个线程 •当需要把Objective-C中的方法,放到独立的线程中运行时,可以使用此类 •多线程特别适用于,当需要执行一个长时间任务,却不想阻塞执行其余操作时 •两种创建方式 + detachNewThreadSelector:toTarget:withObject: - initWithTarget:selector
2015-05-29 09:15:26 453
原创 ios 手势
iOS手势UIGestureRecognizer UIKit中包含了UIGestureRecognizer类,用于检测发生在设备中的手势。UIGestureRecognizer是一个抽象类,定义了所有手势的基本行为,它有下面一些子类用于处理具体的手势: 1、拍击UITapGestureRecognizer (任意次数的拍击) 2、捏合UIPinchGestureRecogni
2015-05-29 08:54:06 397
原创 沙盒目录
//获取documents目录路径 NSArray *docPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docPath = docPaths[0]; NSLog(@"docPath is %@", docPath);
2015-05-27 17:00:35 397
原创 NSUserDefaults
//userDefaults对应的plist文件放在应用沙盒的library目录下的某一目录下 //路径不展开拿到的library目录路径是:~/library NSArray *librarys = NSSearchPathForDirectoriesInDomains(NSLibraryDirectory, NSUserDomainMask, YES); NSStrin
2015-05-27 15:58:29 743
原创 gdata xml
//获取工程目录的xml文件 NSString *filePath = [[NSBundle mainBundle] pathForResource:@"users" ofType:@"xml"]; NSData *xmlData = [[NSData alloc] initWithContentsOfFile:filePath]; //使用NSD
2015-05-27 14:52:03 472
原创 网络请求 下拉刷新 block传值
// // RootTableViewController.m // NetJSONCountry // // Created by sunlihuo on 15/5/26. // Copyright (c) 2015年 sunlihuo. All rights reserved. // #import "RootTableViewController.h" #import "Count
2015-05-26 14:41:49 590
原创 json解析
NSString *filePath = [[NSBundle mainBundle]pathForResource:@"students" ofType:@"json"]; NSError *error = nil; NSData *data = [NSData dataWithContentsOfFile:filePath options:NSDataReadingMapped
2015-05-26 09:51:30 473
原创 NSURLConnection 异步下载图片
[NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue new] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { if (connectionError) {
2015-05-25 16:33:25 517
原创 打开模态视图 导航
//打开模态视图 [self presentViewController:self.detailVC animated:YES completion:nil]; //关闭模态视图 [self dismissViewControllerAnimated:YES completion:nil];//添加导航 [self.navigationController pushViewControll
2015-05-22 10:20:38 607
原创 UINavigationController API
UINavigationController 简介 iOS中的导航控制器,概念和数据结构里的栈类似,导航控制器使用了导航堆栈。根视图控制器在堆栈最底层,可以将视图控制器推入栈顶。 创建导航控制器 //便利初始化方法,同时设置根视图控制器 - (instancetype)initWithRootViewController:(UIViewController *)rootViewControll
2015-05-18 15:14:00 557
原创 UITabbarController
UITabbarController 简介 iOS中的标签控制器,可以对多个控制器进行切换 标签控制器的特性 //委托 @property(nonatomic, assign) id delegate //与这个控制器相关的标签栏 @property(nonatomic, readonly) UITabBar *tabBar 管理控制器 //标签栏里的控制器,数组 @proper
2015-05-18 15:08:55 525
原创 UIView
UIView 简介 iOS中的视图组件,所有的控件都需要显示在视图上 创建一个视图 //在坐标为(10,10)的位置创建一个宽为100高为100的视图 CGRect viewRect = CGRectMake(10, 10, 100, 100); UIView* myView = [[UIView alloc] initWithFrame:viewRect]; 视图的初始化 //便利初始
2015-05-18 15:06:10 751
原创 UIPickerView
// // ViewController.m // MyPickerView // // Created by sunlihuo on 15/5/18. // Copyright (c) 2015年 sunlihuo. All rights reserved. // #import "ViewController.h" @interface ViewController () @pro
2015-05-18 15:02:28 344
原创 MyAlertViewActionSheet
// // ViewController.m // MyAlertViewActionSheet // // Created by sunlihuo on 15/5/18. // Copyright (c) 2015年 sunlihuo. All rights reserved. // #import "ViewController.h" @interface ViewControll
2015-05-18 10:45:01 356
原创 UIScrollView
// // ViewController.m // MySerallView // // Created by sunlihuo on 15/5/18. // Copyright (c) 2015年 sunlihuo. All rights reserved. // #import "ViewController.h" const CGFloat kWidth = 400; const
2015-05-18 10:23:11 361
原创 UIDatePicker
// // ViewController.m // MyDatePickerByCode // // Created by sunlihuo on 15/5/18. // Copyright (c) 2015年 sunlihuo. All rights reserved. // #import "ViewController.h" @interface ViewController (
2015-05-18 09:59:33 372
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人