In the Cocoa Foundation, Nsarray and Nsmutablearray are used for an ordered set of objects, the biggest difference between Nsarray and Nsmutablearray classes is that Nsarray is immutable and Nsmutablearray is mutable. They can only store cocoa
Article Source: http://onevcat.com/2012/04/objective-c-runtime/If reproduced please specify the source, the ultimate original copyrightIn-depth objective-c dynamic characteristicsObjective-c has quite a lot of dynamic characteristics, basic, is also
Main.m1 #import2 #import "TestClass.h"3 4 intMainintargcConst Char*argv[]) {5 @autoreleasepool {6NSString *purposeinfo =@"the information obtained is useful not only in debug, but also in selector.";7 [TestClass testdebugkeyword:purposeinfo];8 }9
Features of OC● On the basis of the C language, a minimal object-oriented syntax is added. fully compatible with C language You can mix C code, even C + + code, in OC code applications that can use OC to develop Mac OS x platform and iOS
SuperIn Objective-c, if we need to invoke a method of the parent class in a method of a class, we usually use Super, as follows:@interface Myviewcontroller:uiviewcontroller @end @implementation Myviewcontroller-(void) viewdidload { [super
The 1.BOOL type is actually a # define Yes 1 #define NO 0 so it's actually an integral type2. The naming conventions for instance variables are underlined, such as _name3. Method of declaring an object in an. h file:-(BOOL) method name 1: (NSString *
Protocol (@protocol): interface equivalent to JavaProtocol methods are not necessarily implemented, you can use @required and @optional to set, the default is @required (ob is weak syntax, even if you do not implement the required method compile run
1. Prefacebelieve that contact with OC is very familiar to NSLog, carefully review the original definition of NSLog, will find that his prototype is as follows:FOUNDATION_EXPORT void NSLog(NSString *format, ...) NS_FORMAT_FUNCTION(1,2);Path in:OS X
Why is memory management needed? Because the memory of the mobile device is extremely limited, so the memory of each app is also limited, when the app consumes more memory, the system will issue a memory warning, you need to reclaim some no longer
If you have used mrr,autorelease this keyword should be too familiar, each time we generate a new object return, we need to send an autorelease message to this object, in order to delay the release of the created object. When is it that the object
Whether an instance object in Objective-c supports a copy operation depends on whether the object implements the Nscopying protocol:@protocol nscopying-(ID) Copywithzone: (Nszone *) zone; @endFor mutablecopy operations, there is a nsmutablecopying
OBJECTIVE-C protocols?1.1 Formal protocols?A formal protocol (like the informal protocol) is a named list of methods and properties.Formal protocol (like informal protocol) is a list of names for a series of methods and properties.However, a formal
------Java Training, Android training, iOS training,. NET training, look forward to communicating with you! -------thinking after a class exercise/* Requirements: Design a class point2d to represent a point in a two-dimensional plane 1> property *
KVC key value pair is later in the development of the project will often use, if it is not clear that is key, that is value, then it will be very disadvantage, I personally is in this area to eat a lot of loss, especially in the Address book. Maybe
First, the attributeThe objective-c property is the syntax defined by the 2.0, which provides a setter for instance variables, a default implementation of Getter methods that simplifies program code to some extent, and enhances access security for
Memory Management policyThe basic model for memory management is defined in the NSObject protocol and standard method naming conventions in the combination method provided in the reference counting environment. The NSObject class also defines a
What is classificationClassification can be used to extend the method of a class without modifying the code of the original class.Let's look at a simple example:We have a class Calculator we have added and subtracted methods for it:#import
Today the main practice nsstring nsmutablestring Nsarray NsmutablearrayNSString ( string)Method 1: [[NSString alloc] initwithformat:@ ""] creates a string object, formats it, and assigns a value to the string object method 2:stringwithformat:@ ""
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