세그먼트 컨트롤러

카테고리 없음 2011. 10. 8. 21:41 Posted by js™

NSArray *segItem = [NSArray arrayWithObjects:@"하나",@"",@"",@"",nil];
UISegmentedControl *sc = [[UISegmentedControl alloc] initWithItems:segItem];
sc.segmentedControlStyle = UISegmentedControlStyleBar;
sc.momentary = NO;
[sc addTarget:self action:@selector(segAction:) forControlEvents:UIControlEventValueChanged];
self.navigationItem.titleView = sc;

네비게이션 타이틀

카테고리 없음 2011. 10. 8. 13:10 Posted by js™

self.title = @"Hello";
self.navigationItem.titleView = [[[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 120.0f, 36.0f)] autorelease];
self.title = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleName"];
self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"실행" style:UIBarButtonItemStylePlain target:self action:@selector(exec:)] autorelease];
self.navigationItem.leftBarButtonItem = [[[UIBarButtonItem alloc] initWithTitle:@"실행" style:UIBarButtonItemStylePlain target:self action:@selector(exec:)] autorelease];

#define BarButton(title,selector) [[[UIBarButtonItem alloc] initWithTitle:title style:UIBarButtonItemStylePlain target:self action:selector] autorelease] 

방향 재설정

카테고리 없음 2011. 10. 8. 12:24 Posted by js™

-(BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation

UIDeviceOrientationUnknown
UIDeviceOrientationPortrait
UIDeviceOrientationPortraitUpsideDown
UIDeviceOrientationLandscapeLeft
UIDeviceOrientationLandscapeRight
UIDeviceOrientationFaceUp
UIDeviceOrientationFaceDown