1. Variable type do not misuse the ID, if it is not carefully easy to throw an error in the execution of the program, because in the compilation phase the compiler simply detects that the variable object belongs to the type, especially when the type is ID, which means that any type can pass the check, but does not detect the variable object call method, so that when the object belongs to the , the compilation passes, but the error occurs when the program runs.
2. A brief introduction of the frame's own collection, font, etc.
3. By using nsattributedstring, you can make the screen display more font style, set various styles and so on, see the Attachment demo Demo:http://files.cnblogs.com/ Colinhou/attributor.zip
4. For Apple's currently recommended storyboard storyboard, it introduces its life cycle and introduces some caveats.
(1) Viewdidload, in this process, the storyboard will do the initialization operation, we set the various output (Iboutlet) has been initialized, for the entire app needs and only need to do an initialization operation, should be executed here, Because Viewdidload is performed only once at the beginning of the program, throughout the life cycle. However, it is important to note that the view is not displayed on the screen, that is, the size of the view information is still uncertain, so it is not suitable to do and set the size of the view to change the operation.
(2) Viewwillappear, in this process, the geometry information of the view has been determined, ready to display, if you need to change the size, animation, etc., can also be executed here. At the same time, some initialization operations should also be performed here, for example, every time you switch back to update the data and so on, such as use, each time you re-switch from another place, the top will have a circle in turn, need to get the latest data.
(3) Viewwilldisappear, that the view is going to disappear from the screen immediately, you need to stop the animation and other operations, to avoid the use of resources, and if you need to save data or status, so the next time you switch back (viewwillappear), Facilitates the continuation of previous operations or status.
(4) Viewdidappear, viewdiddisappear triggered when the view has appeared or disappeared,
Didreceivememorywarning triggered when the system is low on memory,
The viewwill/didlayoutsubviews is used for screen rotation to make the appropriate settings, followed by detailed description.
5. Broadcasting mechanism Nsnotificationcenter, if you listen to an event, when a certain condition is met, you can respond, trigger the specified action, a bit similar to the flex message mechanism, listen to or cancel listening for a message.
Addobserver means listening to the object, the Observer, who listens to the event, selector represents the response method, name is the broadcast name, indicates the event being listened to, object indicates whose broadcast, whose event, and if nil means whoever it is, as long as this broadcast, The event happens, will listen to, and make the appropriate action.
At the same time stop listening to the radio, be sure to cancel the listen, this is because nsnotificationcenter used the unsafe reference pointer "unsafe retained pointer", if not canceled, when the listener object does not exist, Notifies Nsnotificationcenter to cause a program to crash when sending a notification, where a pointer of type weak should be used, so that the pointer will automatically become nil, but for compatibility with iOS5 (weak type pointer iOS6 to start using), it is currently used " Unsafe retained pointer ".
In addition, it is recommended to use specific information when cancelling a listener to avoid the inability to use other broadcasts.
6. Describes how to manage multiple views using Uinavigationcontroller, as detailed in the attached demo:http://files.cnblogs.com/colinhou/Attributor.zip
In addition, if you want to skip other view, directly to the specific view of the simple functional test verification, you can in interface Builder to move the start arrow to the target view, in the code to write a test method, start debugging can be directly into the target view verification function.
Demo Effect: