- 博客(7)
- 收藏
- 关注
原创 第十二章:表视图常用UI范例——下拉刷新+无限滚动
1.使用UIRefreshControl实现下拉刷新//声明下拉刷新 self.refreshControl = [[UIRefreshControl alloc] init]; //赋予动作执行 [self.refreshControl addTarget:self action:@selector(refreshedByPullingTable:) forContr
2013-12-30 23:00:32 3609
原创 第十三章:多任务
1.状态恢复系统功能说明:如果用户输入消息时,中途切换到了另外一个应用,当用户再次回到信息输入界面时,之前输入的消息应该仍然存在。步骤:1.在AppDelegate.m 中启动状态保留系统- (BOOL)application:(UIApplication *)applicationshouldSaveApplicationState:(NSCoder *)coder { r
2013-12-28 21:00:54 899
原创 多线程之GCD
@interface ViewController ()@property (nonatomic,readwrite,weak) IBOutlet UILabel *label;@property (nonatomic,readwrite,assign) NSUInteger count;@property (nonatomic,readwrite,strong) dispatch_que
2013-12-28 20:51:43 1451
原创 多线程 之 NSOperation
//创建一个操作类,必须继承NSOperation, 只需要重写main方法即可(Main方法便是我们需要的异步操作)@interface PrintNumber : NSOperation@end@implementation PrintNumber- (void)main{ NSLog(@"1");}@end//调用异步@interface ViewCont
2013-12-28 19:59:49 798
原创 IOS 获取CPU 核心数
#include unsigned int countOfCores(){ unsigned int ncpu; size_t len = sizeof(ncpu); sysctlbyname("hw.ncpu", &ncpu, &len, NULL, 0); return ncpu;}
2013-12-28 19:03:49 3657
转载 property 中的strong 与weak,assign
property 中的strong 与weakstrong关键字与retain关似,用了它,引用计数自动+1,用实例更能说明一切 @property (nonatomic, strong) NSString *string1; @property (nonatomic, strong) NSString *string2; 有这样两个属性, @synt
2013-12-28 17:58:53 2899
原创 第十一章:位置服务
任何IOS设备都没有配备独立的GPS芯片,实际上都是个辅助GPS芯片,需要通过网络数据计算位置信息(wifi,手机基站等) 下面代码为:位置服务,区域监控//// ViewController.m// Location_Demo//// Created by Eric on 13-12-7.// Copyright (c) 2013年 Eric. All rights
2013-12-07 12:08:19 2145 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人