Label Alignment in iOS 6 – UITextAlignment deprecated

Label Alignment in iOS 6 – UITextAlignment deprecated

trafficLB.textAlignment = NSTextAlignmentCenter;

#ifdef NSTextAlignmentCenter // iOS6 and later
#   define kLabelAlignmentCenter    NSTextAlignmentCenter
#   define kLabelAlignmentLeft      NSTextAlignmentLeft
#   define kLabelAlignmentRight     NSTextAlignmentRight
#   define kLabelTruncationTail     NSLineBreakByTruncatingTail
#   define kLabelTruncationMiddle   NSLineBreakByTruncatingMiddle
#else // older versions
#   define kLabelAlignmentCenter    UITextAlignmentCenter
#   define kLabelAlignmentLeft      UITextAlignmentLeft
#   define kLabelAlignmentRight     UITextAlignmentRight
#   define kLabelTruncationTail     UILineBreakModeTailTruncation
#   define kLabelTruncationMiddle   UILineBreakModeMiddleTruncation
#endif

Hide tab bar item TabBarController in ios

If you want to get the items of the tabBar rearranged you have to remove the controller from the controllers list, not hide it. You can use this code to achieve this:

NSMutableArray *controllers = [NSMutableArray arrayWithArray:self.tabBarController.viewControllers];
[controllers removeObjectAtIndex:3];
[self.tabBarController setViewControllers:controllers animated:YES];