Design and implementation of the micro-blog developed by iOS

Source: Internet
Author: User

  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 * mans = [[person alloc]init];        [Man ShowName];            Microblog * microblog = [[microblog alloc]init];                        return 0;}
#import <Foundation/Foundation.h> @interface person:nsobject{    /** used to record a person's name    * * * NSString * _name;        /** used to record the Age of Man * *    int  _age;        /** used to record the date of birth * *    NSString * _birthday;        /** used to record gender */    char _sex;        /** used to record the location of    * * * NSString * _address;        /** used to record the status of emotions    * * NSString * _emotion;        /** used to record blood type * *    NSString * _BLOODTYPE;} @property NSString * NAME; @property int age  ; @property NSString * birthday; @property char sex; @property NSString * Add Ress, @property NSString * emtion; @property NSString * bloodtype;-(void) showname; @end
#import "Person.h" #import <Foundation/Foundation.h> @implementation person-(void) showname{    NSLog (@ " Printing person's name ");    NSLog (@ "%@", _name);} -(NSString *) description{    return [nsstring stringwithformat:@ "name =%@ age =%d Birth date =%@ sex =%c address =%@ emotional status =%@ blood type =%@", _name , _age,_birthday,_sex,_address,_emotion,_bloodtype];    } @end

#import <Foundation/Foundation.h> #import "BlogMaster.h" #import "Person.h" @interface microblog:nsobject{    /** used to store blogger Information    *///blogmaster * _blogmaster;        /** used to store the registration time * *    NSString * _registertime;        /** Brief Introduction */    NSString * _introductionaboutblog;        /** used to record blog content    * * * NSString * _blogcontent;        /** used to record the content of comments * *    NSString * _commentcontent;        /** used to record the number of comments */    int _commentamount;        /** is used to record the number of likes */    int _praiseamount;        /** used to record the time of Weibo    * * * NSString * _publishtime;        /** used to record the number of forwards */    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:@ "Blog content =%@ comments number =%d likes quantity =%d publish time =%@  Number of forwards =%d ", _blogcontent,_commentamount,_praiseamount,_publishtime,_transpond];} @end

#import "Person.h" @interface blogmaster:person{    }-(void) showname; @end

#import "BlogMaster.h" @implementation blogmaster-(void) showname{    NSLog (@ "Blogger's name");} @end



Design and implementation of the micro-blog developed by iOS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.