Objective-C 基础:Time5 多参
来源:互联网 发布:我只是数据txt下载 编辑:程序博客网 时间:2024/06/05 15:39
.h文件
#import <Foundation/Foundation.h>
@interface Time4 : NSObject
{
int hour;
int minute;
int second;
}
-(void)setHour:(int)_h andMinute:(int)_m andSecond:(int)_s;//多参
-(int)hour;
-(int)minute;
-(int)second;
@end
.m文件
#import "Time4.h"
@implementation Time4
-(void)setHour:(int)_h andMinute:(int)_m andSecond:(int)_s//多参
{
hour= _h;
minute = _m;
second = _s;
}
-(int)hour
{
returnhour;
}
-(int)minute
{
return minute;
}
-(int)second
{
return second;
}
@end
主函数
#import <Foundation/Foundation.h>
#import "Time4.h"
int main(int argc,constchar * argv[])
{
@autoreleasepool {
Time4 *time =[[Time4alloc]init];
[time setHour:10andMinute:20andSecond:30];
NSLog(@"%d:%d:%d",[timehour],[timeminute],[timesecond]);
}
return0;
}
- Objective-C 基础:Time5 多参
- Objective-C 基础:Time5 合成存取器
- Objective-C基础概要
- Objective-C 基础语法
- Objective C - 基础:
- Objective-C 基础语法
- Objective-C Foundation基础
- Objective-C入门基础
- OBJECTIVE-C语言基础
- Objective-C类 基础
- objective c 基础
- objective-c语法基础
- Objective-C 基础
- Objective-C 基础
- Objective-c基础
- Objective-C 基础
- 【Objective-C】OC基础
- objective-c基础
- apache rewrite
- socket.io客户端分析
- 重置root密码
- class对象 的 声明 和 生命周期
- 变量_代码大全笔记(三)
- Objective-C 基础:Time5 多参
- thrift介绍及应用(二)—简单应用
- Android资料汇总
- MySQL ODBC Driver中MSI与ZIP的区别
- 为Eclipse安装Python开发插件
- 使用CocoaPods来做iOS程序的包依赖管理
- android 系统架构
- struts2注解
- 会话(Session)固定