IOS开发之微博的设计与实现
来源:互联网 发布:剑网三青妆人软件设置 编辑:程序博客网 时间:2024/05/17 04:04
//// main.m// Microblog//#import <Foundation/Foundation.h>#import "Person.h"#import "BlogMaster.h"#import "Microblog.h"int main(int argc, const char * argv[]){ Person * person = [[Person alloc]init]; [person showName]; NSLog(@"%@",person); Person * man = [[Person alloc]init]; [man showName]; //Microblog * microblog = [[Microblog alloc]init]; return 0;}
#import <Foundation/Foundation.h>@interface Person : NSObject{ /**用来记录人的名字*/ NSString * _name; /**用来记录人的年龄*/ int _age; /**用来记录出生年月*/ NSString * _birthday; /**用来记录性别*/ char _sex; /**用来记录所在地*/ NSString * _address; /**用来记录感情状况*/ NSString * _emotion; /**用来记录血型*/ NSString * _bloodType;}@property NSString * name;@property int age;@property NSString * birthday;@property char sex;@property NSString * address;@property NSString * emtion;@property NSString * bloodType;-(void)showName;@end
#import "Person.h"#import <Foundation/Foundation.h>@implementation Person-(void)showName{ NSLog(@"打印人的名字"); //NSLog(@"%@",_name);}-(NSString *)description{ return [NSString stringWithFormat:@"名字=%@ 年龄=%d 出生日期=%@性别=%c 住址=%@ 感情状况=%@ 血型=%@",_name,_age,_birthday,_sex,_address,_emotion,_bloodType]; }@end
#import <Foundation/Foundation.h>#import "BlogMaster.h"#import "Person.h"@interface Microblog : NSObject{ /**用来存储博主信息*/ //BlogMaster * _blogMaster; /**用来存储注册时间*/ NSString * _registerTime; /**简介*/ NSString * _introductionAboutBlog; /**用来记录博客内容*/ NSString * _blogContent; /**用来记录评论内容*/ NSString * _commentContent; /**用来记录评论数量*/ int _commentAmount; /**用来记录点赞数量*/ int _praiseAmount; /**用来记录微博发表时间*/ NSString * _publishTime; /**用来记录转发数量*/ int _transpond;}@property NSString * registerTime;@property NSString * introductionAboutBlog;@property NSString * blogContent;@property NSString * commentContent;@property NSString * publishTime;@property int commentAmount;@property int praiseAmount;@property int transpond;//-(void)printBlogMasterName:(Person *)person;@end
#import "Microblog.h"@implementation Microblog//-(void)printBlogMasterName:(Person *)person//{// if([Person isKindOfClass:[BlogMaster class]])// {// BlogMaster * master = (BlogMaster *)person;// }// [master showName];//}-(NSString *)description{ return [NSString stringWithFormat:@" 博客内容=%@ 评论数量=%d 点赞数量=%d 发表时间=%@ 转发数量=%d",_blogContent,_commentAmount,_praiseAmount,_publishTime,_transpond];}@end
#import "Person.h"@interface BlogMaster : Person{ }-(void)showName;@end
#import "BlogMaster.h"@implementation BlogMaster-(void)showName{ NSLog(@"博主的名字");}@end
1 0
- IOS开发之微博的设计与实现
- iOS 开发之IPad的设计与实现
- ios开发之公交卡系统的设计与实现
- ios开发之电子优惠券的设计与实现
- ios开发之自动售货机的设计与实现
- [IOS开发教程] ios开发之公交卡系统的设计与实现
- ios开发-电话本的设计与实现
- iOS开发笔记之十五——管理类的设计与实现
- IOS开发之电子菜单的设计与实现(继承、封装、多态)
- iOS开发zhiATM机的设计与实现
- IOS手游开发设计与实现
- iOS开发之瀑布流的实现(UICollectionView与UIScrollView)
- IOS开发之瀑布流的实现(UICollectionView与UIScrollView)
- iOS开发之断点续传原理与实现
- iOS SDK的设计与实现
- iOS开发之 MVVM的架构设计与团队协作的重要性
- 移动开发之iOS基础开发(五)iOS开发中的MVC设计实现
- iOS开发之浅谈MVVM的架构设计与团队协作
- 欢迎使用CSDN-markdown编辑器
- NSMutableArray中各种自定义排序方法
- 分享俩个在desktop上跑android app的软件
- 天才的大三暑假修行之旅.初学Shader
- 分享资源:双车道元胞自动机交通流Matlab仿真
- IOS开发之微博的设计与实现
- Maven系列(一)Maven的简介与使用
- PXC(Percona XtraDB Cluster)集群安装
- sap上线前的十大思考
- 暑假学习随笔
- iOS 开发之IPad的设计与实现
- 解决VM虚拟机连不上网络的问题
- sap打油诗
- java并发编程第五章(1) 创建Fork/Join线程池