2011-10-12 2 views
0

나는 tableView 있습니다. 나는 다음과 같은 문자를 표시 할 각 셀에서TableView에 항목 표시 - 초보자

A, B, C

A에 사용자가 클릭 난 다음 텍스트를 인쇄 다른있는 tableView를 보여줍니다 다른보기로 이동 페이지가 필요

America , Australia.

사용자가 B 클릭, 뷰가 다른 페이지로 이동하지만, 문자 B로 진술에는 국가 없기 때문에 그것이 빈 테이블을 보여줍니다 (이 부분은 완료되었습니다).

사용자가 C 클릭하면 CanadaChina 국가가 표시됩니다.

내가 원하는 것은 사용자가 B을 클릭했을 때 어떤 국가도 없기 때문에 페이지가 다시 리디렉션되도록하지 않기 위해서입니다. 빈 테이블을 보여주는 또 다른 페이지.

어떻게 해결해야합니까? * * 모든 나라 이름

** 다음과 같이 내가 코드를 추가 한 SQLite는

에서로드, 그래서 이것은 내 모든 화면이 다른보기로 이동 얻을 이유 (그리고 B된다 빈 tableView 보여주기)

+0

Illep, u는 해결했다 너의 문제 ? – Prajan

+0

아니요. 해결책이있는 경우 – Illep

답변

0

부모보기 컨트롤러가 레코드 수를 검색 할 수 있도록하기 위해 국가 클래스의 메소드를 만듭니다. 개수가 0이면보기를 푸시하지 마십시오.

P. CountriesViewController와 같은 것은 국가보다 덜 혼란 스럽다고 생각합니다.

0
- (void)viewDidLoad 

    Array=[[NSMutableArray alloc]init]; 
    [Array1 addObject:@"A",@"B",@"C",nil]; 

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath 
Static NSString *[email protected]"cell"; 
    cell=[tbView dequeueReusableCellWithIdentifier:cellIdentifier]; 
    if(cell==nil) 
    { 
     cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier]; 
    } 

    if(tableView==self.tbView) 
    { 
     cell.textLabel.text=[Array objectAtIndex:indexPath.row]; 
    } 
    cell.textLabel.font=[UIFont boldSystemFontOfSize:14]; 
    return cell; 
} 
-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section 
if(tableView==self.tbView) 
    { 
     return [Array count]; 
    } 
//when select the tableview cell want you want set codes here 
-(void) tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 

    { 
} 
+0

'사용자가 B를 클릭하고 어떤 국가도 없기 때문에 페이지가 다시 표시되기를 원하지 않습니다. 빈 테이블을 보여주는 다른 페이지 ' - 아직도 설명이 안된다. – Illep

0

- (공극)를 tableView (jQuery과 *)를 tableView didSelectRowAtIndexPath (NSIndexPath *) indexPath

{ 
여기

// 코드 는}