1. How to set the color of the font in Uitabbaritem and Navigationitem, respectively
(1)
1Uibarbuttonitem *barbuttencolor=[Uibarbuttonitem appearance];2 3Nsmutabledictionary *barbutteonforcolordiction=[Nsmutabledictionary dictionary];4 5 //and Shadow properties for the title under the text attributes dictionary, using the keys found in nsattributedstring.h6 7barbutteonforcolordiction[nsbackgroundcolorattributename]=[Uicolor Orangecolor];8 9Barbutteonforcolordiction[nsfontattributename]=[uifont systemfontofsize: -];Ten //This setting all Barbutton color style, Tabbaritem in the Barbutton ibid. One[Barbuttencolor settitletextattributes:barbutteonforcolordiction Forstate:uicontrolstatenormal];
2. When managing all classes of the project (into blue file)
When moving files, note that you want to leave MAIN.M and info.plist files in the root directory, or you will not be reported to find a file problem.
3.Load methods and Initialize methods
(1). Common features of load and initialize
Load and initialize have a lot in common, so here's a simple list:
- The system will call at most once without considering the developer's active use
- If both the parent and child classes are called, the invocation of the parent class must precede the child class
- To create the right run environment in advance of the application run
- Do not rely heavily on these two methods when you use them, unless you really need to
(2). Load method Related points
Nonsense not much to say, directly on the Essentials list:
- The calling time is early and the operating environment is uncertain. Specifically, it is usually loaded on iOS when the app is launched, but when the load is called, there is no guarantee that all classes will be loaded and available, and that you are responsible for auto release when necessary.
- To add the above point, for the two libraries that have dependencies, the load of the dependent classes is called first. But within a library, the order of calls is indeterminate.
- For a class, no implementation of the Load method is called, and inheritance of NSObject is not considered.
- The load method of a class does not specify [super Load], the parent class receives the call, and precedes the subclass.
- The category load will also receive calls, but in order after the main class's load call.
- Initialize calls are not triggered directly.
3. Key points of the Initialize method
Similarly, the main points of direct finishing:
- The natural invocation of initialize is the first time that the current class is actively used.
- When the Initialize method receives the call, the operating environment is basically sound.
- Initialize is guaranteed to be thread-safe during operation.
- Unlike load, even if a subclass does not implement the Initialize method, it inherits the implementation of the parent class and invokes it again. Note that before this, the method of the parent class has been executed once, and no super call is required.
Due to these characteristics of initialize, the application is slightly more extensive than load. Can be used to do some initialization work, or a singleton mode of implementation of the scheme.
4. Supplement to iOS overall architecture
Usually our original viewcontroller inherit Uitabbarcontroller add each Viewcontroller in the load run time will be added to go up, when the switch is not this viewcontroller removed, in order to high performance, Some methods that involve the view must be banned in this class because there are some effects (such as the method that needs to be rendered after the navigation bar is loaded, and the colleague accidentally loads the view of each controller)
5.
1 // The NSLog method in the unused phase prevents the console from printing after the shelves 2 #ifdef DEBUG 3 #define Wxrlog (...) NSLog (__va_args__)4#else5#define wxrlog (...) 6 #endif
Beginner iOS Project summary (ii)