IOS開發之微博的設計與實現

來源:互聯網
上載者:User

IOS開發之微博的設計與實現

////  main.m//  Microblog//#import #import Person.h#import BlogMaster.h#import Microblog.hint 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 @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 @implementation Person-(void)showName{    NSLog(@列印人的名字);    //NSLog(@%@,_name);}-(NSString *)description{    return [NSString stringWithFormat:@名字=%@ 年齡=%d 出生日期=%@性別=%c 住址=%@ 感情狀況=%@ 血型=%@,_name,_age,_birthday,_sex,_address,_emotion,_bloodType];    }@end

#import #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



 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.