Design and Implementation of Weibo in IOS development

Source: Internet
Author: User

Design and Implementation of Weibo in IOS development

////  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 {/** used to record the Person's name */NSString * _ name;/** used to record the Person's age */int _ age; /** used to record the date of birth */NSString * _ birthday;/** used to record Gender */char _ sex;/** used to record location */NSString * _ address; /** used to record emotional conditions */NSString * _ emotion;/** used to record blood type */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 (@ name of the publisher); // NSLog (@ % @, _ name);}-(NSString *) description {return [NSString stringWithFormat: @ name =%@ age = % d Date of Birth =%@ gender = % c address =%@ emotional condition =%@ blood type =% @, _ name, _ age, _ birthday, _ sex, _ address, _ emotion, _ bloodType];} @ end
 

# Import
 
  
# Import BlogMaster. h # import Person. h @ interface Microblog: NSObject {/** is used to store the master information * // BlogMaster * _ blogMaster;/** is used to store the registration time */NSString * _ registerTime; /** Introduction */NSString * _ introductionAboutBlog;/** used to record Blog content */NSString * _ blogContent;/** used to record comment content */NSString * _ commentContent; /** used to record the number of comments */int _ commentAmount;/** used to record the number of likes */int _ praiseAmount; /** used to record the microblog posting time */NSString * _ publishTime;/** used to record the number of forwards */int _ transhortd;} @ property NSString * registerTime; @ property NSString * introductionAboutBlog; @ property NSString * blogContent; @ property NSString * commentContent; @ property NSString * publishTime; @ property int commentAmount; @ property int praiseAmount; @ property int transtmd; //-(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 = % @ comment COUNT = % d likes = % d posting time = % @ forward COUNT = % d, _ blogContent, _ commentAmount, _ praiseAmount, _ publishTime, _ tranmongod];} @ end

#import Person.h@interface BlogMaster : Person{    }-(void)showName;@end

# Import BlogMaster. h @ implementation BlogMaster-(void) showName {NSLog (@ blogger name);} @ end



 

Related Article

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.