Objective-C 基础:Time时间类
来源:互联网 发布:amd显卡驱动linux黑屏 编辑:程序博客网 时间:2024/05/03 14:57
.h文件
#import <Foundation/Foundation.h>
@interface Time2 : NSObject
{
int hour;
int minute;
int second;
}
-(void)setHour:(int)_h;
-(int)hour;
-(void)setMinute:(int)_m;
-(int)minute;
-(void)setSecond:(int)_s;
-(int)second;
@end
.m文件
#import <Foundation/Foundation.h>
@interface Time2 : NSObject
{
int hour;
int minute;
int second;
}
-(void)setHour:(int)_h;
-(int)hour;
-(void)setMinute:(int)_m;
-(int)minute;
-(void)setSecond:(int)_s;
-(int)second;
@end
主函数
#import <Foundation/Foundation.h>
#import "Time2.h"
int main(int argc,constchar * argv[])
{
@autoreleasepool {
Time2 *time=[[Time2alloc]init];//申请一个time对象的内存空间
[timesetHour:10];
[timesetMinute:20];
[timesetSecond:30];
NSLog(@"%d:%d:%d",time.hour,time.minute,time.second);
}
return0;
}
- Objective-C 基础:Time时间类
- Objective-C 基础类:Time3 时间(类方法)
- Objective-C类 基础
- Objective-c Run Time
- Objective-C 基础集合类
- Objective-C 类基础(二)
- Objective-C 类基础(三)
- 【Objective-C基础】集合类
- C/C++中时间类time.h
- objective-c的常用基础类
- objective C 基础 类的组成
- Objective-C 类的基础程序
- Objective-C基础—类,对象,方法
- Objective-C 面向对象基础-类
- Objective C基础(三)---常用工具类
- 黑马程序员-----------Objective-C基础-----------类方法
- Objective-C基础-类方法的学习
- Objective-C基础概要
- 【C++】自绘控件基础
- 【Android UI设计与开发】第12期:顶部标题栏(三)ActionBar实现层级导航的返回效果
- Linux下配置免安装版Tomcat .
- Spring 3.x企业应用开发实战(13)----Spring JDBC访问数据库
- 自制即时通信系统:socket网络编程(1)
- Objective-C 基础:Time时间类
- 使用Java开发工具IntelliJ IDEA如何将应用打包到App Store
- 数据库范式
- 重写与重载
- 基于Django的Disqus如何支持每月80亿PV
- redis-sentinel使用总结
- SQLite学习手册
- LeetCode: Remove Nth Node From End of List
- Fatal error: Call to a member function getSource() on a non-object in G:\wamp\www\ChinaMagicCube\ap