2011-05-11 6 views
0

내 응용 프로그램에서 UITable View를 사용해야하고 가로 및 세로 방향 모두를 지원해야합니다. 내가 직접 그 인터페이스 빌더에서 jQuery과 드래그하면프로그래밍 방식으로 테이블보기를 만드는 방법은 무엇입니까?

내가 어떻게 다음 날 프로그램 동일한 기능을 수행하는 것이 좋습니다 정확히

그렇지 않은 경우를 제어 할 수 있습니다.

감사 Rizwan

+0

시도 이전 anwers을 받아 들일 수 – Aravindhan

답변

0
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { 
     return 1;//Returns the no of sections in the tableview 
    } 

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { 
     return 5;//Returns the no of rows in the tableview 
    } 

//This method is called everytime when a row is created. 
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { 

     static NSString *CellIdentifier = @"Cell"; 

     UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 

     if (cell == nil) { 

      cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 

     } 

     // Configure the cell... 
     cell.textLabel.text [email protected]"tableview"; 

     return cell; 

    } 
관련 문제