1, first come to a few commonly used:
is the HD screen
#define Isretina ([UIScreen instancesrespondtoselector: @selector (currentmode)]? Cgsizeequaltosize (Cgsizemake (640, 960), [[UIScreen Mainscreen] currentmode].size): NO)
//whether
#import int main (int argc, const char * argv[]) {@autoreleasepool {//Dictionary /* Dictionary Nsdictionnary//nsmutabledictionary 1. Concept: A dictionary is a set of keywords: ' key ' and its defined values ' value ', and it is a collection of key-
Nsarray is an immutable group in the Foundation framework, let's implement these methods:
#import int main (int argc, const char * argv[]) {@autoreleasepool {//oc array can be Storing objects of different types; the array of OC can only store
We know that in C, using sizeof () to calculate the number of bytes occupied in the memory, after referencing string.h, use strlen () to calculate the length of the string (not including).
In Object-c, the "Length" method can return the length of a
(1) arraynsarray* array = [[Nsarray alloc] initwithobjects:@ "Hello" @ "World", nil]; Only object types can be stored, and the underlying type, such as int, may be converted to a string type and then passed in(NSString) [Array objectatindex:1];
The two most commonly used containers for storing data in OC are arrays and dictionaries, and as most commonly used, you should understand all the features and usages.an array in OC is a capacity, an orderly management of a series of elements, and
Continue learning Pointers:Here's a pointer to the pointerAs the name implies pointers to the pointer is a pointer to the address of a needle is also called a two-level pointer, nonsense say we see the code definition and effect#include intMain ()
The purpose of the class and extension is to extend a class.Category (category) in the Objective-cI. Definition and role of class purposeCategory is also called classification, the English category, in the absence of the original class. m file based
Dictionaries are equivalent to maps in C + + STLDictionary Nsdictionary1 #import2 #import "AppDelegate.h"3 4 intMainintargcChar*argv[]) {5 //creating a dictionary from the @ symbol is actually a key-value pair container6Nsdictionary *dict =
0. Determine if there are any characters in the stringif ([Roadtitlelab.text rangeofstring:@ "Qingjoin"].location!=nsnotfound)//Determine if Roadtitlelab.text contains Qingjoin} else {NSLog (@ "no");? }1. Intercepting stringsnsstring*string [email
One, retain, copy, assign differenceConcept:Assign: Simple assignment, without changing the index count (reference counting).Copy: Create an object with an index count of 1 and then release the old objectRetain: Frees the old object, assigns the
The protocol in OC (PROTOCOL) is similar to the interface in. NET (Interface), which is simply a list of a series of methods that can be implemented by any class. The difference is that in. NET, if a class implements an interface, it must implement
The API for optional parameters in Objective-c is also table-like:-(Instancetype) Initwithformat: (NSString *) format, ... Ns_format_function, -(instancetype) Initwithtitle: (NSString *) title message :(NSString *) message delegate: (ID/**/)
. h declaration File1 //Integer.h2 //02-MRC3 //4 //Created by Ma C on 15/8/13.5 //Copyright (c) 2015 BJSXT. All rights reserved.6 //7 8 #import9 Ten @interfaceInteger:nsobject One @property (nonatomic,assign) Nsinteger i; A-(ID) Initwithi:
Abstract Factory modeUnderstand the factory method pattern, in fact, there are many similarities between abstract factory and factory method pattern. Abstract factories are also the separation of client object creation and logic code, but abstract
Reprint Address: http://www.cnblogs.com/mjios/archive/2013/03/28/2983753.htmlDirectory of this document
Objective
First, Introduction
Second, Syntax preview
Description: This objective-c topic is a prelude to learning iOS
IOS operators are similar to other programming languages. All have arithmetic operators, assignment operators, comparison operators, logical operators, bitwise operators, and so on.1. Arithmetic operatorsAddition: +Subtraction:-Multiplication:
% @ Object % d, % I integer % u unsigned integer % F floating point/double character % x, % x binary integer % O octal integer % zu size_t % P pointer % E floating point/double character (Scientific Computing) % G floating point/double character % s
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