Broken Shell (1)

Source: Internet
Author: User

1.

Understanding the main function, UIApplication is the core of the initialization program, which accepts 4 parameters. where argc and argv two parameters from main () accepts two parameters, the other two string parameters represent the main class of the program (Principal class) and the proxy class (delegate class)

int main (int argc, char * argv[]) {

@autoreleasepool {

Return Uiapplicationmain (argc, argv, Nil, Nsstringfromclass ([Appdelegate class]));

}

}



2.

plist XML format files are typically used to store user settings
PCH precompiled file Header
Xib Nterface Builder's graphical interface design documentation
Storyboard is a new feature of iOS 5, designed to replace the historic nib/xib

3.

APPDELEGATE.M magical similar to listening interface
After the application starts, the delegate calls the Applicationdidfinishlaunching method
Application to exit completely, delegate calls the Applicationwillterminate method


4.

Viewcontroller
When creating Viewcontroller, execute Loadview-viewdidload
Memory warning, background, will execute didreceivememorywarning-viewdidunload; If Viewcontroller is currently being displayed (foreground) didreceivememorywarning


5.

Iboutlet is only a token for the compiler, an extra retain once, so release is required.
Iboutlet modified fields can be associated with the corresponding controls in the Interfacebuilder;
The Ibaction modified method can be associated with the corresponding action of the control in the Interfacebuilder.


6. Addsubview is the topmost layer of the view added to all layers

7. Insertsubview can control which layer it adds to the parent view
The Makekeyandvisible function is used to display the main window of the object to the front of the screen.
Hiddenuiview method hides this window

8.

@protocol MyProtocol <NSObject>
-(void) FirstMethod
@end protocol, OC does not inherit much, but can be delegated or called an agent by agreement


9.

@property (nonatomic, retain) engine* Engine; Code generation mechanism, generating different types of getter/setter functions, interface classes using
@synthesize engine, synthesizer, implement class inside use, both indispensable

10.

initWithFrame using the nib file (XIB) to control the view content with code, you need to call initWithFrame to initialize
The view loads the nib file and initializes the instance objects with Initwithcoder when the object instance is loaded from the NIB

11.

Respondstoselector the method asks the object to determine whether it can respond to a particular message
if ([Car respondstoselector @selector (setwheel)] = = = YES])
{
}

12.

Viewdidload: Called after the view has been loaded
Viewwillappear: Called when the view is about to be visible. No action is taken by default
Viewdidappear: Called when the view has completely transitioned to the screen
Viewwilldisappear: The view is dismissed when called, overwritten, or otherwise hidden. No action is taken by default
Viewdiddisappear: The view is dismissed after it is called, overwritten, or otherwise hidden. No action is taken by default


13.

initWithFrame using the nib file (XIB) to control the view content with code, you need to call initWithFrame to initialize
The view loads the nib file and initializes the instance objects with Initwithcoder when the object instance is loaded from the NIB


14.

Respondstoselector the method asks the object to determine whether it can respond to a particular message

[Car respondstoselector @selector (setwheel)] = = YES]


15.

Viewdidload: Called after the view has been loaded
Viewwillappear: Called when the view is about to be visible. No action is taken by default
Viewdidappear: Called when the view has completely transitioned to the screen
Viewwilldisappear: The view is dismissed when called, overwritten, or otherwise hidden. No action is taken by default
Viewdiddisappear: The view is dismissed after it is called, overwritten, or otherwise hidden. No action is taken by default


16.

loadnibnamed Dynamic load View
Nsarray *nibviews=[[nsbundle Mainbundle] loadnibnamed:@ "Empty" owner:self Options:nil];


17.

1) componentsseparatedbystring: intercept the specified string;

2) Pathforresource: Get the program run-time directory
3) Objectatindex: Gets the string of the current index;
4) rangeofstring: Gets the start, end index value of the specified short string in the long string;
5) Stringwithcontentsoffile: Read files by line
6) componentsseparatedbystring:@ "
"]; line break string;
7) Nsenumerator *nse = [lines objectenumerator]; The array is converted to Nsenumerator, and the data can be read forward;
Nextobject Reading the next row of data

18.
-(BOOL) Iskindofclass:classobj to determine if this class or subclass of this class is an instance of
-(BOOL) ismemberofclass:classobj to determine if it is an instance of this class

19.
There are five ways of creating a Uiimageview object
Uiimageview *imageview1 = [[Uiimageviewalloc] init];
Uiimageview *imageview2 = [[Uiimageviewalloc] initWithFrame: (CGRect)];
Uiimageview *imageview3 = [[Uiimageview alloc] Initwithimage: (UIImage *)];
Uiimageview *imageview4 = [[Uiimageview alloc] Initwithimage: (UIImage *) Highlightedimage: (UIImage *)];
Uiimageview *imageview5 = [[Uiimageview alloc] Initwithcoder: (Nscoder *)];
the most common is the front three.

20.

UIScreen can get the size of the device screen
The UIView object defines a rectangular area on the screen that handles drawing and touch events for that area, and a UIView instance can contain and manage several sub-uiview
The UIWindow object is the root of all uiview, managing and coordinating the application
The Uiviewcontroller object is responsible for managing all UIView hierarchies and responding to device orientation changes

21.
@class when a class needs to reference another class
demo.h @class Rectangle;
DEMO.M Import Rectangle

22.
uiswitch Switch,
UIButton button,
Uisegmentedcontrol The segmented control,
UISlider Sliders,
Uitextfield Text field controls,
Uipagecontrol Pagination Control

23.
Uicontroleventtouchdown
Single Touch Press event: The user touches the screen, or when a new finger falls.
uicontroleventtouchdownrepeat
Multi-Touch press event, touch count greater than 1: when the user presses the second to third or fourth finger.
Uicontroleventtouchdraginside
When a touch is dragged within the control window.
Uicontroleventtouchdragoutside
When a touch is dragged outside the control window.
Uicontroleventtouchdragenter
When a touch is dragged from outside the control window to the inside.
Uicontroleventtouchdragexit
When a touch is dragged from inside the control window to the outside.
Uicontroleventtoucupinside
all touch lift events within the control.
Uicontroleventtouchupoutside
all touch lift events outside the control (the touch must start with the inside of the control to send a notification).
Uicontroleventtouchcancel
all touch cancellation events, that is, a touch is canceled because too many fingers were placed, or locked or phone da ' duauicontroleventtouchchanged

sends a notification when the value of the control has changed. Used for sliders, segmented controls, and other controls that take values. You can configure when a slider control sends notifications when the slider is dropped, or when it is dragged.
Uicontroleventeditingdidbegin
sends a notification when the text control starts editing.
Uicontroleventeditingdidend
sends a notification when the edit ends in a text control.
uicontroleventeditingchanged
a notification is sent when the text in the text control is changed.
Uicontroleventeditingdidonexit
sends a notification when the edit is finished by pressing the ENTER key (or equivalent behavior) within the text control.
uicontroleventalltouchevents
notifies all touch events.
uicontroleventalleditingevents
notifies all events about text editing
uicontroleventallevents
notifies all events.

24.
Suserdefaults is used to store data with small amounts of data, such as User Configuration. Not all things can be put in, only support: Nsstring,nsnumber, NSDate, Nsarray, nsdictionary.

25.
nsuserdefaults *userdefaults = [Nsuserdefaults standarduserdefaults];
[Defaults Objectforkey:key]; extract
[Defaults Setobject:item forkey:key]; set
[Defaults removeobjectforkey:key]; remove

26.
Resignfirstresponder trigger Keyboard Hide

27.
Uitabbarcontroller is usually used as the rootviewcontroller of the entire program, and the common creation place is in application delegate applicationdidfinishlaunching : Method

Broken Shell (1)

Related Article

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.