iOS section other knowledge

Source: Internet
Author: User

1. Interface Switching value(1) Use button to switch interface

When the page jumps, the system automatically calls, Segue connection

-(void) Prepareforsegue: (Uistoryboardsegue *) Segue Sender: (ID) Sender {}

Segue.sourceviewcontroller Existing interface

Segue.destinationviewcontroller Arrival Interface

Segue.identifier Connection Identifier

Top view of the Nav.topviewcontroller stack (get the properties of the next interface)

The story version of Show mode depends on the previous interface property if Uinavigationcontroller is the stack outbound method, or the modal view if other

(2) The code jumps to the other controller and switches the interface according to the identifier.

[Self performseguewithidentifier:@ "navgition" sender:sender];

2. Custom Tabbar

-(void) Tabbar: (Tabbar *) Tabbar Selectedatindex: (dockitemtype) Type {

Self.selectedindex = type;

}

3, UIApplication

Single-instance mode gets the Application object

uiapplication * application = [uiapplication sharedapplication];

Get Appdelegate Object

Appdelegate * appdelegate = Application.delegate; (methods that can be called in appdelegate)

Setting the display and hiding of indicators for network connections

application.networkactivityindicatorvisible = YES;

Create a notification

uiusernotificationsettings * Notifi = [Uiusernotificationsettings Settingsfortypes:uiusernotificationtypebadge Categories:nil];

Registering Notifications for Apps

[Application Registerusernotificationsettings:notifi];

Set the icon corner mark (the red circle on the top right of the software)

Application.applicationiconbadgenumber = 10;

Http:ftp:https://safiri

SMS://Send SMS

Tel://Call

mailto://e-Mail

Be sure to test the real machine

Nsurl * url = [Nsurl urlwithstring:@ "Mailto://[email protected]"];

[[UIApplication sharedapplication] openurl:url];

Previous methods of IOS7

When using it, set the info.plist so that the view controller-based status bar appearance to No

[[UIApplication sharedapplication] setstatusbarhidden:no];

[[UIApplication sharedapplication] setstatusbarstyle:uistatusbarstylelightcontent];

IOS7 set the status bar after the hidden set in the VC settings

-(BOOL) Prefersstatusbarhidden {

return NO;

}

-(Uistatusbarstyle) Preferredstatusbarstyle {

return uistatusbarstylelightcontent;

}

4, UIWindow

Three ways to get UIWindow

UIWindow * Window1 = Appdelegate.window;

UIWindow * Window2 = [[UIApplication sharedapplication] Keywindow];

UIWindow * window3 = Self.view.window;

Switch interface (try not to use it)

Window3.rootviewcontroller = [[Secondviewcontroller alloc] init];

iOS section other knowledge

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.