Prototype Cells in a nib instead of a storyboard

iOS 5 includes a new method on UITableView: registerNib:forCellReuseIdentifier: To use it, put a UITableViewCell in a nib. It has to be the only root object in the nib. You can register the nib after loading your tableView, then when you call dequeueReusableCellWithIdentifier: with the cell identifier, it will pull it from the nib, just … Read more

Perform Segue on ViewDidLoad

I answered a similar question where the developer wanted to show a login screen at the start. I put together some sample code for him that can be downloaded here. The key to solving this problem is calling things at the right time if you want to display this new view controller, you will see … Read more

iOS 7: Misplaced View Frame for “Label – Label” will be different at run time

The accepted answer will fix the problem, but that’s not a good solution because it’ll remove all your constraints. If you have spent hours on the constraints then don’t do that. If you click the triangle next to the warning you can get the explanation of what is misplaced. Then you can just move the … Read more

Prepare for Segue in Swift

This seems to be due to a problem in the UITableViewController subclass template. It comes with a version of the prepareForSegue method that would require you to unwrap the segue. Replace your current prepareForSegue function with: override func prepareForSegue(segue: UIStoryboardSegue!, sender: AnyObject!) { if (segue.identifier == “Load View”) { // pass data to next view … Read more

Uppercase characters in UItextfield

Set your textfield type autocapitalizationType to UITextAutocapitalizationTypeAllCharacters on the UITextField self.yourTexField.autocapitalizationType = UITextAutocapitalizationTypeAllCharacters; After call delegate // delegate method – (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string { NSRange lowercaseCharRange = [string rangeOfCharacterFromSet:[NSCharacterSet lowercaseLetterCharacterSet]]; if (lowercaseCharRange.location != NSNotFound) { textField.text = [textField.text stringByReplacingCharactersInRange:range withString:[string uppercaseString]]; return NO; } return YES; } Swift 5.4.2 self.yourTextField.autocapitalizationType = .allCharacters

A launch storyboard or xib must be provided unless the app requires full screen

Starting from iOS9 and Xcode 7 you are required to provide a LaunchScreen.storyboard for your launch screen in order to support the new multitasking feature on iPad. To opt out of being eligible to participate in Slide Over and Split View, add the UIRequiresFullScreen key to your Xcode project’s Info.plist file and apply the Boolean … Read more

How to call a View Controller programmatically?

To create a view controller: UIViewController * vc = [[UIViewController alloc] init]; To call a view controller (must be called from within another viewcontroller): [self presentViewController:vc animated:YES completion:nil]; For one, use nil rather than null. Loading a view controller from the storyboard: NSString * storyboardName = @”MainStoryboard”; UIStoryboard *storyboard = [UIStoryboard storyboardWithName:storyboardName bundle: nil]; UIViewController … Read more

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