IOS 基础
来源:互联网 发布:巨库微信群发软件 编辑:程序博客网 时间:2024/05/17 01:40
定时器 NSTimer
步骤
生成NSTimer
id timer;
timer = [NSTimer scheduledTimerWithTimeInterval:0.5 target:self selector:@selector(handleTimer:) userInfo:nil repeats:YES];
定时器函数:
- (void) handleTimer:(id)atimer
{
}
销毁定时器
[atimer invalidate];
taimer = nil;
接口编程之@protocol
1、接口声明。
文件A.h
@protocol ProcessDataDelegate<NSObject>
@required
-(void) processSuccessful:(BOOL)success;
@end
@interface A:NSObject
{
id<ProcessDataDelegate>delegate;
}
@property (retain) id delegate;
@end;
2、接口回调
文件A.m
@implementation A
@synthesize delegate;
- (void) processComplete
{
[[self delegate] processSuccessful:YES];
}
3、接口实现
- ios基础
- ios基础
- iOS基础
- IOS 基础
- ios基础
- ios 基础
- IOS基础
- ios基础
- ios基础
- ios基础
- ios基础
- iOS 基础
- iOS基础
- IOS基础
- iOS基础
- 基础iOS
- ios基础
- ios基础
- 在myeclipse上部署没有java源文件的程序
- Android和ios哪个前景更好
- Ubuntu 安装配置 RabbitVCS
- ubuntu如何切换中文语言及中文输入法
- 17-4 奇数因子
- IOS 基础
- 大数据、云及解析
- Unity 角色模型优化要点
- xml学习之 XmlReader
- linux下的vi编辑器
- vncserver
- Handler
- MyISAM 和 InnoDB 讲解
- 关于字符集