본문 바로가기

IT/objc

Objective-C data types, class

반응형

* 문자

char

NSString

 

* 숫자

int

float

doule

 

* 그외

bool

date

array

 

* 상수

const

 

* OOP - 메소드 종류

+(int) myClassMethod

-(int) myInstanceMethod;

 

* 수정가능한 스트링 클래스

NSMutableString

예제)

NSMutableString *myString = [NSMutableString stringWithString:@"Au Contraire"];
NSLog(@"%@", myString);

[myString setString:@"Au Contraire, Mon Frere"];
NSLog(@"%@", myString);

* 클래스의 선언과 사용

//선언

@interface ViewController : UIViewController

 

-(IBAction)showALert;

 

@end

 

//사용

#import "ViewController.h"

@implementation ViewController

 

-(IBAction)showAlert

{

    //구현!

}

 

@end

 

 

반응형