1. Basic concepts of category
Encapsulation is an object-oriented feature, and OC is no exception. However, sometimes we encounter a situation where we encapsulate a class and don't want to change it any more, however, we need to add a method to
The protocol in OC is similar to the excuse of Java
The Protocol is special.ProgramDesign Patterns are used to declare methods implemented by other classes. Protocols are useful in the following scenarios:
1. There must be other class
AboutKVC (Key-value-coding)Key-value Encoding
1. Key-value encoding is a mechanism used to indirectly Access Object Attributes. Using this mechanism, you do not need to call the setter, Getter methods, or variable instances to access object
Nsarray and nsset actually implement similar basic functions. This is very different from other languages such as Java. nsarray's data storage method is continuous, the latter data is stored in the memory followed by the previous data, while the
[STR hasprefix: @ "12"]; // return value bool starting with 12[STR hassuffix: @ "TXT"]; // whether to return bool at the end of txt
// Search for strings[STR rangeofstring: @ "345"]; // returns the return location of the nsange parameter. If the
Whether the two methods are the same in OC, regardless of the parameter type and return value. The sum of the methods is related to the method name.
For example, in the same fatigue in OC, this function form is incorrect.
-(Void) theage :( INT)
Objective-C language is an advanced object-oriented programming language. Therefore, it has some characteristics of object-oriented programming, namely encapsulation, inheritance and polymorphism.
Today we will introduce polymorphism in objective-C.
This article introduces the new properties of objective-C language, where category allows you to add your own methods to existing classes, the Protocol is a special Inheritance Method in objective-C language, similar to interfaces in Java. Next, I
1. NSAID utoreleasepool is actually an automatic processor of object reference count. The NSAID utoreleasepool can have multiple nodes at the same time, and its organization is a stack. There is always a stack top pool, that is, the current pool.
How can I convert an XIB file to an object-C source code?
You can use nib2objc to download the source code of this tool from https://github.com/akosma/nib2objc.
The downloaded project code is compiled with xcode to generate a command line program
Gnustep Windows Installer provides a simulated development environment of objective-C on the Windows platform. There are four software packages in total,
WhereGnustep SystemAndGnustepCoreIs mandatory,Gnustep develAndCairoBackendIs optional.
Render
Build an objective-C development environment in Ubuntu 10.04
1. Introduction to objective-CIn the early 1980 s, Brad indeed invented objective-C in stepstone. Objective-C is a programming language based on the C language that adds object-oriented
For IOS applications, the system strictly monitors the reference count of objects to ensure memory usage efficiency. When the reference count is 0, the objects are immediately released. Generally, it is enough to use release: alloc/copy/new or
To use the prompt function of xcode, you only need to remember the class name and common functions. Other functions can be viewed as prompted. Press ESC to view functions of this class.
Foundtion framework
The cocoa program mainly uses two
Now it's still a dish. If there's any mistake, I hope to correct it!
If reprint, please indicate Source Address: http://blog.csdn.net/shinilaobababa/article/details/8453434
First, let's take a look at the golden rule of Memory Management in OC.
If
The dictionary in foundation is a data set composed of key-value pairs. For example, in Java, the key value must be unique in the dictionary object, in addition, the keys and values in the dictionary object cannot be nil ., If you want to indicate a
The Demo code is as follows:There are four methods to sort Arrays:1. Basic sorting method:Use the compare method provided in nsstring for sorting. For details, see arraysort1 of the demo.2. Custom compareCustomize the comparestudent method in the
Common nsobject methods:All OC objects have these methods. See the Demo code.
Reflection:Class reflectionInstantiate an object using a string of the Class NameClass class = nsclassfromstring (@ "student ");Student * Stu = [[class alloc] init];
Class
FW: http://blog.csdn.net/dboylx/archive/2009/02/15/3893770.aspx
After reading the previous memory management document, I have a preliminary understanding of the objective-C memory management mechanism. However, it is far from enough to just renew
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.