응용 프로그램 대리인으로부터 delegate.allSelectedVerseEnglish라는 NSMutableArray가 있습니다. 일부 값이 있습니다. 배열 수를 얻을 수 있으며이를 UITableView에서 올바르게 표시 할 수 있습니다. 하지만 지금은 textview에 표시하고 싶습니다. 이NSArray를 IOS에서 NSstring으로 변환
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
// Customize the number of rows in the table view.
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return [delegate.allSelectedVerseEnglish count];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
readCell *cell = (readCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"readCell" owner:self options:nil];
cell = [nib objectAtIndex:0];
cell.label.text = [NSString stringWithFormat:@"%d",indexPath.row+1];
cell.textLabel.text = [NSString stringWithFormat:@" %@",[delegate.allSelectedVerseEnglish objectAtIndex:indexPath.row]];
cell.textLabel.font = [UIFont fontWithName:@"Georgia" size:19.0];
}
}
그것은 셀에 올바른 값을 보여줍니다처럼 내 jQuery과 코드가 있지만 난 그냥 textview.text = delegate.allSelectedVerseEnglish;
처럼 텍스트 뷰이 delegate.allSelectedVerseEnglish 배열을 표시해야합니다. 어떻게 할 수 있습니까?
미리 감사드립니다.
덕분에 [delegate.allSelectedVerseEnglish componentsJoinedByString을 : @ "\ n"]; 권리? – stackiphone
예, 그 트릭을해야합니다. –
내가 시도하자 this.entanks – stackiphone