Tips and Considerations for iOS development

Source: Internet
Author: User

Common knowledge and tips for future development:

Third-party frameworks that need to be mastered:

Network Request class: Afnetworking(Must), ASIHTTPRequest(and may use, try to master)

Image loading class: SD webimage(required)

Database:FMDB

Waterfall Flow: Third party and system comes with. PS: The system comes with a waterfall stream that supports only iOS6 or above systems

Drawer effect: There are several such as: Mmdrawercontroller

Drop-down refresh: Third party and system comes with, PS: The system comes with Uirefreshcontrol only supports iOS6 or above system

UIWebView is mainly the interaction of JS

Arc is a feature introduced after IOS5:

If your project is using MRC, add-fobjc-arc to the ARC mode code file .

If your project uses arc, then add -fno-objc-arc to the MRC mode code file

Share to third-party apps:Sharesdk or Friends Alliance, third party open platform registration

Map: Baidu Map API, German map API

Network judgment: reachability

Data statistics: TalkingData (understand, know that there is such a thing, later use when the query)

How to make a version iteration of a program

1,the use of Dlog, Dlog in the debug mode will output information, including the method name, the number of rows and what you want to output. defined as follows (including Elog):

#ifdef DEBUG

#ifndef DLog

# define DLOG (FMT, ...) {NSLog (@ "%s [line%d]" FMT), __pretty_function__, __line__, # #__VA_ARGS__);}

#endif

#ifndef ELog

# define ELOG (Err) {if (err) DLog (@ "%@", Err)}

#endif

#else

#ifndef DLog

# define DLOG (...)

#endif

#ifndef ELog

# define ELOG (ERR)

#endif

#endif

2, 3.5-inch and 4.0-inch screens are used to make the 3.5 and 4.0-inch screens adaptable, IPhone5 and iphone5s are 4.0-inch screens

#define IPHONE5 ([UIScreen instancesrespondtoselector: @selector (currentmode)]? Cgsizeequaltosize (Cgsizemake (640, 1136), [[UIScreen Mainscreen] currentmode].size): NO)

3, depending on the version, set different text alignment format, after iOS6.0 and iOS6 to set the text alignment before the statement is different.

Minimum version supported by the current system

__iphone_os_version_min_required

Maximum version indicated by the current system

__iphone_os_version_max_allowed

#if __iphone_os_version_min_required >= 60000

#define Lolabelalignmentcenter Nstextalignmentcenter

#else

#define Lolabelalignmentcenter Uitextalignmentcenter

#endif

The current system version can be obtained from the following statement

[[[Uidevice Currentdevice] systemversion] floatvalue] >= 7.0 (judging whether the current system is greater than 7.0, can be used to do iOS6 and iOS7 of the matching)

4, to an RGB value to get the corresponding Uicolor

#define UICOLORFROMRGB (rgbvalue) [Uicolor colorwithred: ((float) ((Rgbvalue & 0xFF0000) >>))/255.0 Green: (( float) ((Rgbvalue & 0xff00) >> 8)/255.0 Blue: ((float) (Rgbvalue & 0xFF))/255.0 alpha:1.0]

5, iOS7 navigation bar and status bar customization

Http://www.cocoachina.com/applenews/devnews/2013/1104/7287.html

Adaptation of IOS7 and IOS6

http://blog.csdn.net/liulushi_1988/article/details/14105187

6, IOS verb nspredicate, know how to match the mailbox, URL

http://blog.csdn.net/long11995563/article/details/9399891

7, code protection, for example, when taking elements from an array, first determine the number of elements of the array, and then take elements from the array, and also the data returned from the server, such as a dictionary, before use, the first to determine whether the data is null (because on the server side, If the database does not give the default value, it may be empty, using isequal: [NSNull null] to judge )

Tips and Considerations for iOS development

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.