IOS Cocoa Framework

Source: Internet
Author: User

First, Introduction

cocoa is the native object-oriented API that Apple created for Mac OS x, is one of the top five APIs on Mac OS X (the other four are carbon, POSIX, X11, and Java). Apple's object-oriented development framework, which is used to build Mac OS X applications. The main development language is objective-c, a C superset cocoa started in September 1989 NeXTSTEP 1.0, when there is no foundation framework, only the dynamic Runtime library, called Kit, the most important is appkit. 1993 NeXTSTEP 3.1 was ported to Intel, Sparc, HP platforms, Foundation was first added, and Sun and NeXT co-development OpenStep can also run on Windows systems VCV. Cocoa applications are typically written in objective-c with Apple's development tools Xcode (formerly Project Builder) and interface Builder. However, through bridging technologies such as Java Bridge, Pascocoa, PYOBJC, Camelbones, and RubyCocoa, Java, clozure CL, LispWorks, Object Pascal, Python, Perl, Other tools or languages such as Ruby can also be used to develop COCOA applications. There are also some other languages where cocoa implementations do not need bridging, such as Apple's developed Macruby and the Nu language like Lisp. Without Xcode and interface Builder, cocoa applications can also be developed in objective-c language using only text editors, GCC, and GNU make tools. For end-users, applications developed using the Cocoa programming environment are cocoa applications. This type of application has a unique look, because the Cocoa programming environment allows programs to automatically follow Apple's human-machine interface code in many ways.second, memory managementone feature of the cocoa environment is that it can manage dynamically allocated memory。 The base class of most classes in cocoa is nsobject, which implements the memory management model of reference counting. Classes inherited from NSObject can respond to retain and release messages to increase or decrease their reference count, or they can get their reference count by sending a retaincount message. A reference count of 1 for an object created with the addition of new in Alloc, copy, or Objective-c 2.0, and sending a retain message to an object adds 1 to the count, while sending the release message will reduce the count by 1. If the reference count of an object is reduced to 0, it is destroyed. Dealloc messages are similar to destructors in C + + and may be called before an object is destroyed, but the system is not guaranteed to send the message. This model of reference counting is very similar to the IUnknown interface feature in Microsoft's COM, which provides the AddRef and release interfaces, which correspond to retain and release. Starting with Objective-c 2.0, the OBJECTIVE-C runtime implements an optional garbage collector. If the nature of the garbage collection is activated, the runtime will change the reference count related operations, such as "retain" and "release", to No action. The OBJECTIVE-C 2.0 implementation on iOS does not contain a garbage collector. The garbage collector runs in a low-priority background thread and can be paused when the user moves to maintain a good user experience.Iii. the main framework1. Foundation Tool KitFirst appears in the OpenStep. In Mac OS X, it is based on the core Foundation. As a common object-oriented library, Foundation provides strings, numeric management, containers and their enumerations, distributed computing, event loops, and other functions that are not directly related to graphical user interfaces. Where the "NS" prefix for classes and constants comes from the source of the cocoa, NeXTSTEP. It can be used in Mac OS X and iOS.2. Application ToolkitAlso called AppKit (AppLicationKit) is derived directly from NeXTSTEP's AppKit. It contains the code required for the program to interact with the graphical user interface. It is based on the foundation and also uses the "NS" prefix. It can only be used in Mac OS x.3. User Interface ToolkitAlso called Uikit (USerINterfaceKit), which is a graphical user interface Toolkit for iOS. Unlike AppKit, it uses the prefix "UI".

IOS Cocoa Framework

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.