Reference: http://hi.csdn.net/hou_cocoa
Cocoa
It is a native compiling environment on Mac OS X. It contains two frameworks, namely a series of class libraries, foundation and appkit.
On your iPhone and other handheld devices, the app uses a
Send messages to nil
In objective-C, sending messages to nil is completely valid-it does not work at runtime. Several Methods in cocoa have taken advantage of this. The returned values of messages sent to nil can also be valid:• If a method returns
Iskindofclass: returns a Boolean value that indicates whether the caller is an instance of given class or an instance of any class that inherits from that class.Ismemberofclass: returns a Boolean value that indicates whether the specified er is an
Using Arc can help us reduce a lot of memory management burden, especially when we use JavaProgramPersonnel. However, I am not a strong Java Foundation. After two years of development, IOS has become accustomed to manual memory management, and arc
Reprinted: http://hi.baidu.com/delphi9527/blog/item/2f29650d1302f2306159f319.html
In actual workProgramIt is inevitable to use mathematical functions for calculation, such as the transformation from the geographic coordinates of the map
In C ++, class methods include overload, override, and hide (of course, functions can also be overloaded .).
The coverage and hiding of C ++ is a very confusing concept, especially hidden. Learn objective-C, because it is similar to C ++, so pay
I. golden rules for memory management:
The basic rule to Apple is everything thatincreases the reference counter with alloc, [mutable] Copy [withzone:] Or retainis in charge of the corresponding [auto] Release.
If an object uses alloc, [mutable]
In objective-C 2.0, class extensions is added to solve two problems:
An object can have a private interface and can be verified by the compiler.
Supports a public read-only, private writable attribute.
Private Interface)
Before objective-C 2.0,
Objective-C method replacement
(Method replacement for fun and profit)
This article will discuss method replacement and swizzling in objective-C ).
Overriding Methods)
Overriding methods is common in any object-oriented language and is mainly used
It took me one afternoon to finish reading "objective-C development sample code Daquan". This book is suitable for programmers with or without any foundation, from shortest to deep, this article describes the solutions to common problems in MAC and
Blogger: Yi Feifei
Link: http://www.yifeiyang.net/iphone-development-advanced-1-depth-understanding-of-iphone-os-sdk-and-objective-c-2-0/
Reprinted text.Advanced iPhone development (1) --- in-depth understanding of iPhone OS/SDK and objective-C 2.0
The blocks in OC is similar to the function pointer in C ++. It can be seen from the appearance and usage.
INT (* cfunc) (int A); // function pointer in C language. Call intret = (cfunc) (10 );
INT (^ bfunc) (int A); // BlocksCall intret = (bfunc) (
The following are the notes for learning objective-C 2.0. The original book I purchased is the original English version. Due to my limited level of English, there may be omissions in understanding.
Original book purchase address: Amazon
2. Objects,
The following are the notes for learning objective-C 2.0. The original book I purchased is the original English version. Due to my limited level of English, there may be omissions in understanding.
Original book purchase address: Amazon
3.
The following are the notes for learning objective-C 2.0. The original book I purchased is the original English version. Due to my limited level of English, there may be omissions in understanding.
Original book purchase address: Amazon
4.
Polymorphism in C ++ (two types ):
Compile-time matching: function overload. Different function call matching is implemented based on the name, type, and number of member functions;
Runtime matching: virtual functions, specifically by declaring the
1. Chapter 1 Departure
In addition to the objective-C language, this book also introduces Apple's toolkit cocoa (for OS X systems) and cocoa touch (for iOS systems ). They are all written in objective-C language, which contains all the user
I encountered such a problem recently, but I didn't pay attention to it before. I created a project and added a class. The file structure is like this.
Then write such a short program to run
-(Void) viewdidload {[Super viewdidload]; test *
1 ID cattle [3];2 sel say;3 sel skin;
The ID cattle [3] defines an array used to store cattle or bull objects. This line of code is probably quite familiar to everyone, so I will not go into details here. Traditional arrays like this cannot fully
It is not terrible for iPhone objective-C exc_bad_access to write programs with bugs. For most problems, it is not difficult to find the cause through simple log or code analysis. However, when the problem of exc_bad_access is encountered in
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.