NSString *city2=[[NSString alloc]init];
city2=[NSString stringWithFormat:@"the city orlando"];
NSString *trimmedString = [city2 stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSLog(@"%@", trimmedString)
trimmedString=[NSString stringWithFormat:@"%@, ",trimmedString];
CGSize constraint4 = CGSizeMake(650, 2000.0f);
CGSize size4 = [city2 sizeWithFont: [UIFont fontWithName:@"Helvetica" size:12] constrainedToSize:constraint4 lineBreakMode:UILineBreakModeWordWrap];
city = (UILabel *)[cell viewWithTag:115];
[city setNumberOfLines:0];
city.frame = CGRectMake(150,codetype.frame.size.height+codetype.frame.origin.y, size4.width, size4.height);
[city setText: [NSString stringWithFormat:@"%@",trimmedString]];
我只得到城市而不是奥兰多城市,这是我项目的一小部分。
实际上我正在将字符串分配给标签。但我没有得到标签中的总字符串。这里 line3 是UILabel
高于城市标签的另一个。