How to make xib compatible with both iphone 5 and iphone 4 devices

You add new category for UIviewController and add this code in .h file – (id)initWithNibNameforIphone4:(NSString *)nibNameOrNil4 NibNameforIphone5:(NSString *)nibNameOrNil5 NibNameforIpad:(NSString *)nibNameOrNilpad bundle:(NSBundle *)nibBundleOrNil; Add this code in your .m file – (id)initWithNibNameforIphone4:(NSString *)nibNameOrNil4 NibNameforIphone5:(NSString *)nibNameOrNil5 NibNameforIpad:(NSString *)nibNameOrNilpad bundle:(NSBundle *)nibBundleOrNil { if (self = [super init]) { self = [self initWithNibName:[self CheckDeviceIphone4:nibNameOrNil4 Iphone5:nibNameOrNil5 Ipad:nibNameOrNilpad] bundle:nibBundleOrNil]; } return … Read more

White space before separator line into my TableView

The leading whitespace is provided by default in iOS 7, even for custom cells. Checkout this property separatorInset of UITableviewCell to remove/add white spacing at either ends of cell’s line separator. // Remove white space cell.separatorInset = UIEdgeInsetsZero; Alternatively, at UITableView level, you can use this property – if ([tableView respondsToSelector:@selector(setSeparatorInset:)]) { // Safety check … Read more

iOS – UIBarButtonItem Identifier – option to create “settings” cogwheel button

Unicode has several notable examples you can simply copy and paste into a string declaration in Xcode, or use the standard Unicode String Escape (\uxxxx) and iOS is actually quite fluent when it comes to Unicode (I know some of the char’s are fairly ugly, but that’s Unicode for ya’): Unicode Character ‘GEAR WITHOUT HUB’ … Read more

IBOutletCollection set ordering in Interface Builder

EDIT: Several commenters have claimed that more recent versions of Xcode return IBOutletCollections in the order the connections are made. Others have claimed that this approach didn’t work for them in storyboards. I haven’t tested this myself, but if you’re willing to rely on undocumented behavior, then you may find that the explicit sorting I’ve … Read more

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