Design and implementation of IOS-developed ipad

Source: Internet
Author: User

  main.m//  6-ipad//#import <Foundation/Foundation.h> #import "Ipad.h" int main (int argc, const char * Argv[]) {ipad        * ipad = [ipad new];    Ipad->_color = Ipadcolorblack;    Ipad->_size = 7.9;    NSLog (@ "%@", ipad);    [ipad Camerawithflashlightsatuts:ipadflashlightstatusopen];        return 0;}
#import <foundation/foundation.h>enum ipadsize{ipadsize9point5,//Screen Size 9.5 ipadsize7point9,//screen Size 7.9};typedef Enum Ipadsize ipadsize;enum ipadcolor{ipadcolorwhite,//used to store ipad color white ipadcolorblack//used to store ipad color black};typedef enum I Padcolor ipadcolor;enum ipadflashlightstatus{ipadflashlightstatusopen,//flash off lights on ipadflashlightstatusclose,//flash off Ip adflashlightstatusauto//Automatic mode};typedef enum Ipadflashlightstatus ipadflashlightstatus;//record the state of movie playback enum ipadfilmplaystatus{ipadfilmplaystatusstart,//Status: Start playback ipadfilmplaystatuspause,//status: Pause playback Ipadfilmplaystatusfastspe ed,//Status: Fast Forward ipadfilmplaystatusslowspeed,//Status: Rewind ipadfilmplaystatuslastfilm,//Status: Previous Ipadfilmplaystatusnextfilm// Status: Next};typedef enum ipadfilmplaystatus ipadfilmplaystatus; @interface ipad:nsobject{@public/** to store the color of the Ipad */I        Padcolor _color;        /** is used to store the size of the ipad */float _size;    /** is used to store the size of the ipad CPU */float _CPU; /** is used to store the size of the internal storage of the ipad Ram */float _ram;} Setter Method-(void) setIpAdsize: (float) size;/** open flash */-(void) openflashlight;/** off flash */-(void) closeflashlight;/** Auto mode */-(void) flaselightauto;/** photo */-(void) Camerawithflashlightsatuts: (ipadflashlightstatus) flashlightstatus;/** watch movie */-(void) Filmwithplaystatus: (ipadfilmplaystatus) ipadfilmplaystatus;/** e-mail */-(void) downloadsoft;-(void) installSoft;-( void) playgame;-(void) listen;-(void) searchinformation;-(void) Editword; @end

#import "Ipad.h" @implementation ipad-(id) init{self = [super init];        if (self!=nil) {_cpu = 1.5;    _ram = 1024; } return self;} /** Open Flash */-(void) openflashlight{//Turn on Flash NSLog (@ "Turn on Flash");} /** Turn off Flash */-(void) closeflashlight{//Turn off Flash NSLog (@ "Turn off Flash");} /** Auto mode */-(void) flaselightauto{//Auto mode NSLog (@ "auto mode");} -(void) sendemail{}//photo-(void) Camerawithflashlightsatuts: (ipadflashlightstatus) flashlightstatus{//self keyword        Who calls refers to the call of the internal method who can implement the class if (Flashlightstatus = = Ipadflashlightstatusopen) {[Self openflashlight];        Open Webcam} else if (flashlightstatus==ipadflashlightstatusclose) {[Self closeflashlight];        Close the camera} else {[self flaselightauto];    Auto mode} NSLog (@ "take photos"); }//Watch Movie-(void) Filmwithplaystatus: (ipadfilmplaystatus) ipadfilmplaystatus{if (Ipadfilmplaystatus = =    Ipadfilmplaystatusstart) {//Start play Movie NSLog (@ "Start movie"); } else if (Ipadfilmplaystatus = = IpadfilmplaYstatuspause) {//Pause playback NSLog (@ "pause playback");    } else if (ipadfilmplaystatus = = ipadfilmplaystatusfastspeed) {//Fast forward NSLog (@ "Fast forward");    } else if (ipadfilmplaystatus = = ipadfilmplaystatusslowspeed) {//Rewind NSLog (@ "Rewind");    } else if (ipadfilmplaystatus==ipadfilmplaystatuslastfilm) {//previous movie NSLog (@ "Play previous movie");    } else if (ipadfilmplaystatus = = ipadfilmplaystatusnextfilm) {//Next movie NSLog (@ "play next movie");    } else {//exit NSLog (@ "exit"); }}//setter Method-(void) Setipadsize: (float) size{_size = 3.5;} -(void) downloadsoft{}-(void) installsoft{}-(void) playgame{}-(void) listen{}-(void) searchinformation{}-(void) editword{}//overriding the Description method//Here is the overriding method to note whether the object method or class method is overridden//used for debugging-(NSString *) description{return [NSString stringwithformat:@ "size =%f CPU =%f ram =%f", _size,_cpu,_ram];} @end


Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.

Design and implementation of IOS-developed ipad

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.