본문 바로가기
iOS

Objective C

by _dreamgirl 2020. 2. 22.
반응형

Variable

@propert (nonatomic/atomic, strong/weak/assign) Class Type *VariableName;

 

Method

-(Return Type) methodName: (param Type) param Name{

body

}

 

Object

-UILabel, UIImageView 

-UINavigationController

-UITableViewController

-MKMapView

 

Rule

기본적으로 한 라인이 끝나면 세미콜론(;)으로 마친다.

생성은 alloc 키워드로 사용한다.

기본 생성자

- (id)init{

    self = [super init];

    

    if(self){

        

    }

    return self;

}

소멸자 - ARC 안쓰고 MRC 사용하는 경우

- (void)dealloc{

    [super dealloc];

}

 

화면 전환

 [self presentViewController:vc animated:true completion:nil];

  [self dismissViewControllerAnimated:true completion:nil];

 

이벤드 등록

 [btn addTarget:self action:@selector(touchBack:) forControlEvents:UIControlEventTouchUpInside];

 

로그 표시

NSLog(@"%@", 객체명);

 

개념

Block 

String, Weak, 순환참조

NSOperationQueue, GCD

팩토리 메소드

ARC, MRC

Alloc, retain, release, copy

Shallow copy, Deep copy

반응형

댓글