How can I make text in a UILabel shrink font size

descriptionLabel.adjustsFontSizeToFitWidth = YES; descriptionLabel.minimumFontSize = 10.0; //adjust to preference obviously The following example is tested and verified on iPhone Simulator 3.1.2: UILabel *descriptionLabel = [[UILabel alloc] initWithFrame:CGRectMake(90, 0, 200, 30)]; descriptionLabel.font = [UIFont systemFontOfSize:14.0]; descriptionLabel.minimumFontSize = 10.0; descriptionLabel.adjustsFontSizeToFitWidth = YES; descriptionLabel.numberOfLines = 1; descriptionLabel.text = @”supercalifragilisticexpialidocious even thought he sound of it is something quite … Read more

iPhone remove substring from string

NSString *str=@”1,2,3,4″; [str stringByReplacingOccurrencesOfString:@”3,” withString:@””]; That will remove ALL occurrences of @”3,” in str. If you want to remove only the first occurrence of @”3,”: NSString* str = @”1,2,3,4″; NSRange replaceRange = [str rangeOfString:@”3,”]; if (replaceRange.location != NSNotFound){ NSString* result = [str stringByReplacingCharactersInRange:replaceRange withString:@””]; } Hope this helps.

UITabBar(Controller) – Get index of tapped?

The answer depends on whether or not the UITabBar is managed by a UITabBarController or not. Case 1 – UITabBar is already handled by a UITabBarController Implement the UITabBarControllerDelegate protocol. Specifically the tabBarContoller:didSelectViewController: method. Set an instance of your class that implements the protocol as the delegate of the UITabBarController. – (void)tabBarController:(UITabBarController *)theTabBarController didSelectViewController:(UIViewController *)viewController … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)