ERROR COLLECTION - IOSSat, Feb 7, 2015
Errors that I collected day by day, when developing iOS apps.
Specifying an invalid frame size (i.e. 0 width or 0 height), can make UIView’s such as UISlider unresponsive to user interaction.
Always wrap multiple statements following a
switch case:in a curly brace, where we can even put a variable declaration in it.
Should NOT assgin one instance of
UIImageView, by defaults, is NOT userInteractionEnabled, hence sub views under them may not receive touch events.
When creating outlets for UILabel views, DO NOT name the property “title”, cause the super class of your view controller
UIViewControlleritself has a property ‘title’, it will incur exception at runtime time.
Remember to clean dead connnection recorded by storyboards for controls & views in interface builder window.
Dragging an element with
key pressed, will copy it’s attributes as well as it’s connections and other info set in the interface builder and uitility panes.
When presenting a view controller from a content view controller embeded in a navigation view controller, it is the navigation view controller, rather than the embeded content view controller, which is presenting the view controller, while the replaced view controller is called the source view controller.
When customizing table view cells, DOT NOT use
UIButtonto cover the cell for triggering the segue, which would bring a function redundant and thus complicates things.
DO NOT auto-layout a subview within a auto-layout’ed
UIScrollViewwhen you plan to perform zooming operation in it.
After getting a reused cell, make sure all its’ states get reset to the current value or the default value, otherwise the remained states set by last usage would mess your up.
clipsToBoundsto true will clips layer shadow off.