- A shallow copy is a pointer copy; a deep copy is a copy of a content.
- About inheritance relationships for controls:
(1) All controls are inherited from UIView.
(2) can listen to events are first inherited from Uicontrol,uicontrol and then inherit from UIView. Like UIButton. (3) The overall sliding is inherited from the Uiscrollview,uiscrollview and then inherit from the UIView. Like UITableView. (4) UIWindow is also inherited from UIView.
Method 1:
Performselector (SEL) withobjects: (ID) Afterdelay: (Nstimeinterval);
Method 2:
Dispatch_after (Dispatch_time (Dispatch_time_now, (int64_t) (Delayinseconds * nsec_per_sec)), Dispatch_get_main_queue (), ^{
Code that requires deferred execution
});
Suppose there is a picture:
UIImage *myimage = [UIImage imagenamed: "pic"];
Method One:
[MyImage stretchableimagewithleftcapwidth: (nsinteger) Topcapheight:
(Nsinteger)];
the two parameters are the distance between the left and the top, which is equivalent to setting Android of the 9-pach the stretch area of his picture. Method two: (Common)
[MyImage resizableimagewithcapinsets: (uiedgeinsets)];
you can pass a parameter Uiedgeinsetsmake (cgfloat top, cgfloat left, CGFloat bottom, cgfloat right) ,
For example, we customize a method:
+ (UIImage *) Resizableimage: (NSString *) name {
UIImage *normal = [UIImage imagenamed:name];
CGFloat w = normal.size.width * 0.5;
CGFloat h = normal.size.height * 0.5;
return [normal resizableimagewithcapinsets: Uiedgeinsetsmake (H, W, H, W)];
}
Method Three:
[MyImage resizableimagewithcapisets: (uiedgeinsets) Resizingmode: (Uiimageresizingmode)];
all of the three methods return a new UIImage .
This method is called when the following two scenarios occur:
(1) a control's Frame the time of the change.
(2) When you are laying out child controls
- Common Properties of UIApplication
1. Set the red reminder number in the upper right corner of the application icon
@property (nonatomic) Nsinteger applicationiconbadgenumber;
2, set the visibility of the network indicator
@property (nonatomic,getter=isnetworkactivityindicatorvisible) BOOL networkactivityindicatorvisible;
- How to manage the status bar:
The first type:
Through Uiviewcontroller management (each uiviewcontroller can have its own different status bar).
The second type:
Managed by UIApplication (the status bar of an application is managed uniformly by it).
(1) style of the status bar
-(Uistatusbarstyle) Preferredstatusbarstyle;
(2) Visibility of the status bar
-(BOOL) Prefersstatusbarhidden;
Using UIApplication to manage the status bar
Use UIApplication to manage the status bar:
If you want to use uiapplication to manage the status bar, you first have to modify the Info.plist settings.
UIWindow
-(void) Makekeywindow;
Make the current UIWindow into Keywindow (main window).
-(void) makekeyandvisible;
Make the current UIWindow into Keywindow and show it.
Get UIWindow
[UIApplication sharedapplication].windows
A list of UIWindow that opens in this app so you can touch any of the UIView objects in your app. (usually input text pop-up keyboard, in a new UIWindow)
[UIApplication Sharedapplication].keywindow
The UIWindow used to receive message events for keyboards and non-touch classes, and only one uiwindow per time in a program is Keywindow. If a text box inside a UIWindow cannot enter text,
Maybe it's because this uiwindow is not keywindow.
View.window
Get the UIWindow where a UIView is located.
- Delegate setting Rootviewcontroller
iOS Knowledge points-concepts