'Computer Language'에 해당되는 글 12건

  1. 2010.05.21 iPhone 3 프로세스(process) 메모리(memory) 크기(size)
  2. 2010.05.15 iPhone example 01
  3. 2009.03.08 표준화 작업
  4. 2008.11.06 디버깅 훈련
Computer Language2010. 5. 21. 20:53
반응형
 
요약하자면, iPhone 3 App 개발 시 가용한 메모리 양(memory size)은
  • 3GS 기준 총 128MB
  •  process 가용양 : 46MB
 
반응형
Posted by Jay Two
Computer Language2010. 5. 15. 21:27
반응형

(1) window based 어플리케이션 선택 : wizard 에 의하여 생성. 

(2) 헤더 파일 (*.h)
 
#import <UIKit/UIKit.h>

@interface ex20ViewController : UIViewController {
UILabel *labelText; // IB(Interface Builder)에 연결할 컨트롤 추가: Label 컨트롤 
}

@property (nonatomic, retain) IBOutlet UILabel *labelText; // 추가: UILabel 컨트롤
// @property (nonatomic, retain) IBOutlet 는
// IB(InterfaceBuilder)를 사용하는 컨트롤에서 거의 의무적으로 넣어주자... 

-(IBAction) buttonAction:(id)sender; 
// 컨트롤에 연결할 함수 추가: 항상 (IBAction) 정의 필요  

@end

(3) *.m 파일

@implementation ex20ViewController
@synthesize labelText; // 추가; [컨트롤]과 [XIB] 연결 

- (void)viewDidUnload {
// Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil
        self.labelText = nil; // 추가: unload 처리
}

- (void)dealloc {
[labelText release]; // 추가: dealloc 처리  
[super dealloc];
}

// 추가: IB에서 연결하여 사용 
-(IBAction) buttonAction : (id)sender { // sender는 UIButton* 이다. 버튼과 연결함.  
  NSString* title = [sender titleForState:UIControlStateNormal]; // returns the title used for a state. 
  NSString* newText = [[NSString alloc] initWithFormat:@"%@ button pressed.", title];
  labelText.text = newText; // set label text 
  [newText release];
}

@end


반응형
Posted by Jay Two
Computer Language2009. 3. 8. 15:42
반응형
반응형
Posted by Jay Two
Computer Language2008. 11. 6. 00:16
반응형
반응형
Posted by Jay Two