viewWillAppear가 실행되지 않는다면~!
2011-03-01 14:45:52

[self.navigationController pushViewController:childViewController animated:[BOOL]];

[childViewController viewWillAppear:YES];

▼ more
iPhone Table.h
2011-03-01 12:51:48

//

// TweetViewController.h

// TwitterBiKE

//

// Created by Kyungmin Lee on 1/30/11.

// Copyright 2011 __MyCompanyName__. All rights reserved.

//

#import <UIKit/UIKit.h>

@interface TweetViewController : UITableViewController <UITableViewDelegate,UITableViewDataSource>{

NSArray *listData;

}

@property (nonatomic, retain) NSArray *listData;

@end

▼ more
Iphone Table.m
2011-03-01 12:50:33

//

// TweetViewController.m

// TwitterBiKE

//

// Created by Kyungmin Lee on 1/30/11.

// Copyright 2011 BiKE. All rights reserved.

//

//메모리 해제는 '- (void)viewDidUnload'와 '- (void)dealloc' 에서 모두 신경써야 한다.

#import "TweetViewController.h"

#define kScreenNameValueTag 1

#define kCreatingAtValueTag 2

#define kTweetTextValueTag 3

@implementation TweetViewController

@synthesize listData;

#pragma mark -

#pragma mark View lifecycle

- (void)viewDidLoad {

NSString * str1 = @"asdf";

NSString * str2 = @"fdsasl;dfijhasldfijafasdfasfsadfasdfasfsadf";

NSArray *array = [[NSArray alloc] initWithObjects:str1,str2,str2,str2,str2,nil];

self.listData = array;

[str1 release];

[str2 release];

[array release];

}

#pragma mark -

#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

// Return the number of sections.

return 1;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {

// Return the number of rows in the section.

return [self.listData count];

}

// Customize the appearance of table view cells.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

//셀의 식별자를 설정한다.이유는 잘 모름 아직은;

static NSString *tweetTableIdentifier =@"TweetTableIdentifier";

//셀 객체를 얻어온다.

UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:tweetTableIdentifier];

//셀의 모양(appearance)을 결정하는 부분.

if(cell ==nil){//셀이 비었다면 새로운 셀을 만든다.

cell = [[[UITableViewCell alloc]

initWithStyle:UITableViewCellStyleDefault

reuseIdentifier:tweetTableIdentifier] autorelease];

//UILabel을 이용하여 글 상자를 만든다.

// ScreenName LabelRect

CGRect screenNameValueRect = CGRectMake(0,0,70,8);

UILabel *screenNameValue = [[UILabel alloc] initWithFrame:screenNameValueRect];

screenNameValue.font = [UIFont systemFontOfSize:8];

screenNameValue.tag = kScreenNameValueTag;

[cell.contentView addSubview: screenNameValue];

[screenNameValue release];

}

NSUInteger row = [indexPath row];

//NSLog(@"Now %d",row);

//row 에 따라서 다른 그림이 보이도록한다.

UIImage *image = [UIImage imageNamed:@"tweetTAB.png"];

cell.imageView.image = image;

// UILabel을 이용하여 글 상자에 글을 넣는다.

//Screen Name

NSString *rowData = [self.listData objectAtIndex:row];

UILabel *screenName = (UILabel *)[cell.contentView viewWithTag:kScreenNameValueTag];

screenName.text = rowData;

return cell;

}

#pragma mark -

#pragma mark Table view delegates

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {

// Navigation logic may go here. Create and push another view controller.

/*

<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];

// ...

// Pass the selected object to the new view controller.

[self.navigationController pushViewController:detailViewController animated:YES];

[detailViewController release];

*/

}

#pragma mark -

#pragma mark Memory management

- (void)didReceiveMemoryWarning {

// Releases the view if it doesn't have a superview.

[super didReceiveMemoryWarning];

// Relinquish ownership any cached data, images, etc. that aren't in use.

}

- (void)viewDidUnload {

//\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0 Relinquish ownership of anything that can be recreated in viewDidLoad or on demand.

// For example: self.myOutlet = nil;

self.listData = nil;

[super viewDidUnload];

}

- (void)dealloc {

[listData release];

[super dealloc];

}

@end

▼ more
가장 지키기 쉽고
2011-03-01 07:54:52

바라보기 어려운

시간계획은

지금 생활의 시간표 이다.

▼ more