Four main objects:2.UIApplication:1. Introduction1> A symbol of the entire application, an application on a UIApplication object, using a singleton design pattern2> access to this singleton object via [UIApplication sharedapplication]2. Common usage1> set icon in the upper right corner of the red hint numberApp.applicationiconbadgenumber = 10;2> Setting the style
//ZyAppDelegate.hXx//Created by Nimami on 15/7/22.Copyright (c) 2015 LKL. All rights reserved.//#import @interface Zyappdelegate:uiresponder @property (Strong, nonatomic) UIWindow *window;@end//Zyappdelegate.mXx//Created by Nimami on 15/7/22.Copyright (c) 2015 LKL. All rights reserved.//#import "ZyAppDelegate.h"#import "FirstViewController.h"@implementation Zyappdelegate-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions:
state for a while. The time will then go into the suspended state (Suspended). Some programs can be in Backgroud state for a long time after special requestThe Suspended suspend program cannot execute code in the background. The system automatically turns the program into this state and does not give notice. When suspended, the program is still in memory, when the system memory is low, the system will remove the suspended program, to provide more memory for the foreground program.is the program
state for a while. The time will then go into the suspended state (Suspended). Some programs can be in Backgroud state for a long time after special requestThe Suspended suspend program cannot execute code in the background. The system automatically turns the program into this state and does not give notice. When suspended, the program is still in memory, when the system memory is low, the system will remove the suspended program, to provide more memory for the foreground program.is the program
background and can execute code, most programs enter this state will stay in this state for a while. The time will then go into the suspended state (Suspended). Some programs can be in Backgroud state for a long time after special requestThe Suspended suspend program cannot execute code in the background. The system automatically turns the program into this state and does not give notice. When suspended, the program is still in memory, when the system memory is low, the system will remove the s
How to use OpenURLHow to use OpenURL:View Plaincopy to Clipboardprint?
[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:appstring]];
[[UIApplication sharedapplication] Openurl:[nsurl urlwithstring:appstring]];Among the system's appstring are:View Plaincopy to Clipboardprint?
Map Http://maps.google.com/maps?q=Shanghai
Email Mailto://[email protected]
Tel tel://10
We used UILabel to display text, but in UILabel, when the text length exceeds the display area, the scroll bar cannot be displayed. However, we can use UITextView to easily do this, I would like to share with you the following:
The Code is as follows:
HHLAppDelegate. h
#import
@class HHLViewController;@interface HHLAppDelegate : UIResponder
@property (strong, nonatomic) UIWindow *window;@property (strong, nonatomic) HHLViewController *viewController;@end
HHLAppDelegate. m
#im
. The system automatically turns the program into this state and does not give notice. When suspended, the program is still in memory, when the system memory is low, the system will remove the suspended program, to provide more memory for the foreground program.is the program state change diagram:Callback for the agent when each program is running state:-(BOOL) Application: (UIApplication *) application willfinishlaunchingwithoptions: (nsdictionary *)
action.authenticationrequired = yes;//need to unlock talent processing, assuming action.activationmode = Uiusernotificationactivationmodeforeground; the attribute is ignored; action.destructive = YES;2. Create a Category collection of actions (buttons)Uimutableusernotificationcategory *categorys = [[Uimutableusernotificationcategory alloc] init]; Categorys.identifier = @ "alert";//the only indication of this set of actions [Categorys Setactions:@[action,action2] Forcontext: ( Uiuser
interrupt application will release all sockets, including the socket used to connect to the VoIP service. Therefore, when the program runs, it needs to create the socket from scratch.C, in order to prevent disconnection, VoIP programs need to be periodically awakened to check its services. To make this behavior easier, iOS creates a special handle by using the (UIApplication Setkeepalivetimeout:handler:) method. You can create the handle in the Appli
diagram:Callback for the agent when each program is running state:-(BOOL) Application: (UIApplication *) application willfinishlaunchingwithoptions: (nsdictionary *) launchOptionsTells the agent that the process has started but has not yet entered a state save-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (nsdictionary *) launchOptionsTells the agent to start the basic Co
iOS8 send local notifications, you need to register local notifications first.
if ([[uiapplication sharedapplication]currentusernotificationsettings]. Types= =Uiusernotificationtypenone) currently applied local notification type, uiusernotificationtypenone not registered local notification registration is System level, Not related to the program, when the program is removed after the reinstallation is still authorized, the ID is bound. Each time
We send a message to the object to initiate a specific action. When the object sends some changes, it notifies us through the callback function. When a specific event occurs, the object calls the corresponding callback function to trigger the business logic.
The callback function is implemented through the so-called delegation.
Delegate ------- benefits:
It separates the logic processing of the program from the uiapplication more concisely.
It avoi
IOS programming Delegation and Text Input, iosdelegation
IOS programming Delegation and Text Input
1.1 Text Fields
CGRect textFieldRect = CGRectMake (40, 70,240, 30 );UITextField * textField = [[UITextField alloc] initWithFrame: textFieldRect];
// Setting the border style on the text field will allow us to see it more easily textField. borderStyle = UITextBorderStyleRoundedRect;[BackgroundView addSubview: textField];
Tap on the text field, and the keyboard will slide up from the bottom of the
UIApplicationMain for relevant processing. The parameter contains information about when an application starts from the system. These parameters are parsed by the UIKit infrastructure, otherwise they are negligible.
PrincipalClassName: this parameter identifies the name of the application class (this class must inherit from the UIApplication class ). This is the class responsible for running the application. We recommend that you use nil for this par
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.