1. The old project did not use arc, but the introduction of the third party library is the use of arc.2. Arc was used for its new project, but the introduction of Third-party libraries or previously written code did not use arc.
In both cases, the
Tableview+scrollview
Add label to cell
Ways to solve ghosting
Delete element when reusing cell
Nsarray *subviews = cell.subviews;For (UIView *view in subviews) {[View Removefromsuperview];}
In the IF
In C ++, we can implement more inheritance.CodeReuse and EncapsulationProgramMore concise. In objective-C, only single inheritance is allowed, and no multi-inheritance is allowed. In addition to the Protocol protocol, we can implement a method
If two strings are equal, use isequaltostring: instead of just comparing the pointer values of the strings. For example:
Nsstring * thing1 = @ "Hello 5"; nsstring * thing2; thing2 = [nsstring stringwithformat: @ "Hello @ D", 5]; If ([thing1
Http://www.davidhamrick.com/2012/05/28/Adding-Properties-to-an-Objective-C-Category-Revisted.html
In my last post I wrote about adding properties to a categoryIn objective-C. I have ended up using this feature quite a bit recently so I wrote a
# Import Int Main ( Int Argc, Char * Argv []) { If (Argc = 1 ) {Nslog ( @" You need to provide a file name " ); Return 1 ;} File * File = fopen (argv [ 1 ], " R " ); Char Words [ 100 ]; While (Fgets (words, 100 , File) {words
Objective-C contains nsstring, nsmutablestring, nsarray, nsmutablearray, nsdictionary, and nsmutabledictionary.
First, nsstring, nsarray, and nsdictionary are immutable. Once space is allocated, the length is fixed. The other three classes are
Boolean Type
The Boolean bool values in C are true and false, while the bool values in objective-C are yes and no. In fact, the bool of objective-C is actually a definition of the signed character type (singed char) (typedef), which uses an 8-bit
Some time ago, I took some time to touch objective-C and installed the "Black Apple" and Lion system. The version is 10.7.2. I also need to install the xcode development environment. The corresponding version is xocde_4.2_and_ios_5_sdk_for_lion.dmg.
An Introduction to objective-C Meta class
First, let's have a look at the base class nsobject.
@ Interface nsobject {// implement Protocol nsobject
Class ISA; // point to Meta class, all instances of nsobject share the same Meta class.
}
+ (Void)
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