“Unknown class in Interface Builder file” error at runtime

Despite the “Unknown class MyClass in Interface Builder file.” error printed at runtime, this issue has nothing to do with Interface Builder, but rather with the linker, which is not linking a class because no code uses it directly. When the .nib data (compiled from the .xib) is loaded at runtime, MyClass is referenced using … Read more

Could not insert new outlet connection: Could not find any information for the class named

Here are some things that can fix this (in increasing order of difficulty): Clean the project (Product > Clean) Manually paste in @IBOutlet weak var viewName: UIView! // or @IBAction func viewTapped(_ sender: Any) { } and control drag to it. (Change type as needed.) Also see this. Completely close Xcode and restart your project. … Read more

How to use Auto Layout to move other views when a view is hidden?

It is possible, but you’ll have to do a little extra work. There are a couple conceptual things to get out of the way first: Hidden views, even though they don’t draw, still participate in Auto Layout and usually retain their frames, leaving other related views in their places. When removing a view from its … Read more

Should IBOutlets be strong or weak under ARC?

WARNING, OUTDATED ANSWER: this answer is not up to date as per WWDC 2015, for the correct answer refer to the accepted answer (Daniel Hall) above. This answer will stay for record. Summarized from the developer library: From a practical perspective, in iOS and OS X outlets should be defined as declared properties. Outlets should … Read more

UIScrollView Scrollable Content Size Ambiguity

Updated Nowadays, Apple realized the problem we solved many years ago (lol_face) and provides Content Layout Guide and Frame Layout Guide as part of the UIScrollView. Therefore you need to go through the following steps: Same as original response below; For this contentView, set top, bottom, left, and right margins to 0 pinning them to … Read more

Xcode – How to fix ‘NSUnknownKeyException’, reason: … this class is not key value coding-compliant for the key X” error?

You may have a bad connection in your xib. I’ve had this error many times. While TechZen’s answer is absolutely right in this case, another common cause is when you change the name of a IBOutlet property in your .h/.m which you’ve already connected up to File’s Owner in the nib. From your nib: Select … Read more

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