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
、city ラベルの上にある別のものです。