Я попытался нагрузки массив из веб-службы и отображения на столе view.This мой tableview.But существует mistake.Branchnames являютсяГде моя ошибка в моем коде для отображения на табло?
МЕХМЕТ FUDAYLÖZCAN,
Селахаттин Koçak,
Мехмет Suner Eken Petrol
Hasan Katkıcı Бензин
и т.д.
и т.д.
но вид таблицы показывают мне нравится, что
Как это исправить?
Th табличные коды:
-(void)parser:(NSXMLParser *)parser didStartElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName attributes: (NSDictionary *)attributeDict
{
if ([elementName isEqualToString:@"Branchname"])
{
teveRetorno = YES;
}
else if ([elementName isEqualToString:@"GetBranchNameResult"])
{
myArray = [[NSMutableArray alloc] init];
}
}
- (void)parser:(NSXMLParser *)parser foundCharacters:(NSString *)string{
if (teveRetorno) {
//[retornoSOAP appendString:string];
[myArray addObject:string];
}
}
- (void)parser:(NSXMLParser *)parser didEndElement:(NSString *)elementName namespaceURI:(NSString *)namespaceURI qualifiedName:(NSString *)qName{
if ([elementName isEqualToString:@"Branchname"]) {
NSLog(@"My Array %@",myArray);
[[self tableView]reloadData];
//retornoSOAP = nil;
teveRetorno = NO;
}
}
Таблица кодов
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
#warning Incomplete method implementation.
// Return the number of rows in the section.
return [self.myArray count];
}
- (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];
}
cell.textLabel.text =[myArray objectAtIndex:indexPath.row];
return cell;
}
В таком случае вы хотите знать, почему текст усечен? Попробуйте установить 'cell.textLabel.adjustsFontSizeToFitWidth = YES'. –
@jeffamaphone Да, я хочу этого. И я хочу показывать в одной строке. Я добавил ваш код, и результат здесь. Http://picpaste.com/ekranson-6HXwMH0I.png – Mhmt
Так решена ваша проблема? –