objective-c 에서는 다른 객체를 참조 하는 변수를 outlet 이라고 부른다. 
outlet 은 GUI 구성을 하는 Interface Builder 에서 변수로 다른 객체를 연결 할때 사용함. 

IBOutlet UIView *view2;


위와 같은 형태로 주로 사용되는데 
IBOutlet 에서 IB는 Interface Builder의 줄인말인듯. 

참조를 하기 위해서는 아래와 같이 선언하고 .m 에서 접근 하면 된다. 

@property (nonatomic, retain) IBOutlet UIView *view2;

'iOS' 카테고리의 다른 글

JSONKit for iOS  (0) 2011.06.28
UIView Flip 효과 - iPhone  (0) 2010.06.29
Protocols - Objective-C  (0) 2010.06.27
Protocol : 메소드 선언의 집합

java의 interface라는 개념이 Protocol을 도입한 개념임. 

서로 다른 객체가 같은 메소드의 집합을 가지는 경우, 상속 관계는 아님. 

프로토콜은 메소드의 명칭들을 정해 놓으면 그 프로토콜을 따를 때 메소드의 명칭들이 같아지므로 사용성이 좋아지는 것을 목적으로 한다. 



'iOS' 카테고리의 다른 글

UIView Flip 효과 - iPhone  (0) 2010.06.29
서버에서 다운 받기 - Objective-c  (0) 2010.03.11
xcode 에서 회사 이름 바꾸기  (0) 2010.01.01
erica 예제 c3-06-Synchronous Downloads


NSURL *url = [NSURL URLWithString: [urlArray objectAtIndex:[which intValue]]];
NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:url];
NSURLResponse *response;
NSError *error;

NSData* result = [NSURLConnection sendSynchronousRequest:
theRequest
theRequest returningResponse:&response error:&error];



덤으로 무비 플레이어

- (void) startPlayback : (id) sender
{
MPMoviePlayerController* theMovie=[[MPMoviePlayerController alloc] initWithContentURL:[NSURL fileURLWithPath:self.savePath]];
    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(myMovieFinishedCallback:) name:MPMoviePlayerPlaybackDidFinishNotification object:theMovie];
[theMovie play];
}

'iOS' 카테고리의 다른 글

Protocols - Objective-C  (0) 2010.06.27
xcode 에서 회사 이름 바꾸기  (0) 2010.01.01
아이폰 강좌  (0) 2009.12.24

+ Recent posts