1230.2--ios Preparation (notes When reading the developer Documentation)
Source: Internet
Author: User
<span id="Label3"></p><p><span style="color: #0000ff;"><span style="color: #0000ff;">1. Process of program Initiation</span></span><br>Click the icon on the desktop to find the appropriate app icon<br>. Main function<br><br><span style="color: #0000ff;"><span style="color: #0000ff;">UIApplication class</span></span><br>Every app has exactly one instance of UIApplication<br>Each application has only one instance object of the UIApplication class<br>The running application is a uiapplication object.<br><br><br><span style="color: #0000ff;"><span style="color: #0000ff;">Uiapplicationmain</span></span><br>Create a singleton object for the Uiappication object (singleton)<br><br>The role of your app ' s application object<br>. Handle the initial routing of incoming user events<br>A loop that handles user behavior<br>. Dispatches action messages forwarded to it by control objects (instances of the Uicontrol Class) to appropriate target OB Jects.<br>Assigning specific behaviors to specific target objects (passing different events to different UI Controls)<br><br><span style="color: #0000ff;"><span style="color: #0000ff;">Tasks</span></span><br>Getting the App Instance: get singleton objects<br>Getting the app Delegate: get application proxy (the State of the capture Program)<br>Getting App windows: Get window<br>Controlling and handling Events: handling event<br>Opening a URL Resource: open external app resource (Safari)<br>Configuring the user Notification Setting: configuring notifications for users<br>Registering for remote notifications: remotely notify (QQ message, update Notification)<br>Registering for local notifications: native notification (alarm)<br>Managing Background Execution: managing the execution of the background<br>Managing Home Screen Quick Actions for 3D Touch: shortcuts<br>Controlling App appearance: The appearance of the hypervisor (status bar, network indication, Direction)<br><br>Nsstringfromclass converts a class into a string form<br>Nsstringfromclass ([appdelegate Class])<br><br><span style="color: #ff0000;"><span style="color: #ff0000;">uiapplicationdelegate</span></span><br>The Uiapplicationdelegate protocol defines methods that is called by the Singleton UIApplication object in response to IM Portant events in the lifetime of your app.<br>Some important events that occur during the execution of the responder program (program startup, entry into the background, activation, memory crunch). )<br><br>The app delegate works alongside the app object to ensure your app interacts properly with the system and with other APPS.<br>Application proxies and apps work together to ensure the interaction between the program and the system or other programs<br><br>The app delegate is effectively the root object of your app. Like the UIApplication object itself, the app delegate are a singleton object and are always present at Runtime.<br>Application proxy is the root object of the program and is always present throughout the Program.<br><br>The methods inside the APP delegate should be implemented<br>The app delegate performs several crucial roles:<br>. It contains your app ' s startup code.<br>Can be set in the agent using code<br>A. The first method that the program loads to invoke (configuration, Register server information, read data, configure Interface)<br>It's not running into memory yet.<br>-(BOOL) application: (uiapplication *) application willfinishlaunchingwithoptions: (nullable nsdictionary *) Launchoptions Ns_available_ios (6_0);<br> <br>Load well, need to configure the displayed interface<br>-(BOOL) application: (uiapplication *) application didfinishlaunchingwithoptions: (nullable nsdictionary *) Launchoptions Ns_available_ios (3_0);<br><br>It responds to key changes in the your app. specifically, it responds to both temporary interruptions and to Chan Ges in the execution state of your apps, such as when your apps transitions from the foreground to the Background.<br>Temporary interruption, State Change<br><br><br>It responds to notifications originating from outside the app, such as remote notifications (also known as push Notificati ons), low-memory warnings, Download completion notifications, and More.<br>External notifications (message push, insufficient memory, background download Complete)<br>Registerforremotenotificationtypes:<br><br>IT determines whether state preservation and restoration should occur and assists in the preservation and restoration proc ESS as Needed.<br>Determine if the state (data) of the program should be saved or restored<br><br>It responds to events that target the app itself and is not specific to your app's views or view Controllers.<br>Events responding to the application itself<br>Application:openURL:options:<br><br>You can use the it to store your App's central data objects or any content this does not has an owning view controller.<br>Save the current core data of the program or other data that is not viewcontroller saved<br><br><span style="color: #ff0000;"><span style="color: #ff0000;">Uiresponder</span></span><br>The Uiresponder class defines a interface for objects, respond to and handle events.<br>Interfaces that define object responses and handle events<br>All UI controls capable of handling events are directly or indirectly inherited from Uiresponder<br><br>Two main Event Behaviors: touch events and motion events<br>There is both general kinds of Events:touch events and motion Events.<br>Uievent<br>touchesbegan:withevent:,<br>touchesmoved:withevent:,<br>touchesended:withevent:,<br>Touchescancelled:withevent:.<br><br>motionbegan:withevent:,<br>motionended:withevent:,<br>Motioncancelled:withevent:.<br>iOS3.0 Canperformaction:withsender:<br>IOS 4.0, Uiresponder added the remotecontrolreceivedwithevent:method for handling Remote-control Events.<br><br><span style="color: #0000ff;"><span style="color: #0000ff;">Responder chain Responder chain</span></span><br>The view has a hierarchical relationship, and the added view overrides the previous view when an event Occurs. The first view will receive this event, and if the view does not respond, then continue to pass the event to the next level until uiwindow, if it does not respond, then the event will be discarded, and in the process, as long as there is a response, then the event stops Passing.</p><p><p></p></p><p><span style="color: #ff6600;"><span style="color: #ff6600;">Why to use a proxy</span></span><br>To simplify the code logic (apple itself designs the look and feel of the system, leaving the manufacturing, materials, and sales agents out to focus on the core modules)<br>Inheritance can accomplish the function of the agent (if the use of inheritance, the equivalent of Apple itself has its own manufacturing subsidiaries, materials subsidiaries, sales subsidiaries, to their own management increased difficulty, and can not focus on core Competitiveness)<br><br>The entire application has only one proxy (the default system gives us the Appdelegate Class)<br><br><br><span style="background-color: #888888; color: #ff0000;"><span style="background-color: #888888; color: #ff0000;">UIWindow</span></span><br>Manages and coordinates the "an" app displays on a device screen<br>Manage and coordinate the view shown above the device screen<br>An application typically has only one window<br><br><span style="color: #0000ff;"><span style="color: #0000ff;">features of the UIWindow</span></span><br>. provide an area for displaying it views<br>Provides an area to display the view<br>. Distribute events to the Views.<br>Distributing events to a view<br>. A UIWindow object must have a main interface set up<br>Setting the Rootviewcontroller property of a window<br>. display window<br>Calling the Makekeyandvisible property<br><br><span style="color: #0000ff;"><span style="color: #0000ff;">UIScreen</span></span><br>A UIScreen object defines the properties associated with a hardware-based display<br>Define some properties with hardware-based display<br><br>How to get the home screen of a device<br>[uiscreen mainscreen]<br><br>How to get the rectangle coordinates of a view<br>Bounds Property<br><br><span style="color: #0000ff;"><span style="color: #0000ff;">sizes for various sets:</span></span><br>4 (320 * 480)<br>5 (320 * 568)<br>6 (375 * 667)<br>6p (414 * 736)<br><br></p><p><p>1230.2--ios Preparation (notes When reading the developer Documentation)</p></p></span>
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service