iOS development of a variety of small knowledge

Source: Internet
Author: User

1. The transparency property of the parent view is passed to the child View 2.iPad program that can run the iphone iphone cannot run the ipad program 3. Decide whether it's an ipad or an iphone
if (ui_user_interface_idiom () = = Uiuserinterfaceidiompad) {
NSLog (@ "IPad");
} else {
NSLog (@ "IPhone");
}

4.//Determine the version number of the system
if ([[Uidevice currentdevice].systemversion Floatvalue] > 7.0) {
NSLog (@ "%@", [Uidevice currentdevice].systemname); }5 Self in the + method the object of the class name in the-method middle finger

1.isEqual don't know why it's not possible to tell if an object is a class

For Example

if ([[[[array1 objectatindex:0] class] isequalto: [nsstring Class]])

{

NSLog(@ " is nsstring type ");

}

This method is wrong ? ;

2. Problems found during the registration of a demo login

Why use the Get () function in the program to obtain character production, you can not use the NSLog function to print it. ????????????????????

That's because you don't use pointers to arrays when defining strings.

For example char *str; ?

Char str[100] ?

3.???????????????????

Note that to add elements to a variable group, you must initialize the variable element, or it will not increase .

For example nsmutablearray *array = [nsmutablearray arraywithcapacity:0];?

Nsmutablearray *array = nil ?

4. When the database uses parameter SQL statements

You cannot call the exec function using the step function to remember 3???????????????????

5. Modify Barbuttonitem's Outlook This method sets all changes to global settings at once

Uibarbuttonitem *appearancebarbutton = [uibarbuttonitem appearance];

nsmutabledictionary *dict = [nsmutabledictionary dictionary];

dict[nsforegroundcolorattributename] = [uicolor redcolor];

[Appearancebarbutton settitletextattributes:d ICT forstate:uicontrolstatenormal];

6// when using class for the first time call

+ (void) Initialize

{

if (self = = [Self class]) {

}

}

7// Set the secondary view of the keyboard

Uitextfield *textfield = [[uitextfield alloc] init];

TextField. Inputaccessoryview = [[UIView alloc] init];

8// picture stretching

UIImage *newimage = [Image resizableimagewithcapinsets:uiedgeinsetsmake( , (a );

9 btn. adjustsimagewhenhighlighted = no;// indicates that the picture does not change color when the button is highlighted

10.NSClassFromString (< #NSString *aclassname#>)// convert String to class name

Tableviewcontroller seems to be able to achieve automatic refresh function is not very sure yet to be confirmed

iOS development of a variety of small 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.