请输入您要查询的百科知识:

 

词条 Foundation Kit
释义

  1. Classes

     NSObject  NSString and NSMutableString  NSValue and NSNumber  NSArray and NSMutableArray  NSDictionary and NSMutableDictionary  NSSet and NSMutableSet  NSData and NSMutableData  NSDate, NSTimeZone and NSCalendar 

  2. Major implementations

     macOS  iOS  GNUstep  Cocotron  PureFoundation  SwiftFoundation 

  3. See also

  4. External links

{{Unreferenced|date=December 2009}}

The Foundation Kit, or just Foundation for short, is an Objective-C framework in the OpenStep specification. It provides basic classes such as wrapper classes and data structure classes. This framework uses the prefix NS (for NeXTSTEP, or NeXT/Sun_Microsystems).

Classes

{{Expand list|date=March 2017}}

NSObject

This class is the most common base class for Objective-C hierarchies and provides standard methods for working with objects by managing the memory associated with them and querying them.

NSString and NSMutableString

A class used for string manipulation, representing a Unicode string (most typically using UTF-16 as its internal format). NSString is immutable, and thus can only be initialized but not modified. NSMutableString is a modifiable version.

NSValue and NSNumber

NSValue is a wrapper class for C data types, and NSNumber is a wrapper class for C number data types such as int, double, and float. The data structures in Foundation Kit can only hold objects, not primitive types, so wrappers such as NSValue and NSNumber are used in those data structures.

NSArray and NSMutableArray

A dynamic array of objects, supporting constant-time indexing. NSArray is an immutable version that can only be initialized with objects but not modified. NSMutableArray may be modified by adding and removing objects.

NSDictionary and NSMutableDictionary

An associative data container of key-value pairs with unique keys. Searching and element addition and removal (in the case of NSMutableDictionary) is faster-than-linear. However, the order of the elements within the container is not guaranteed.

NSSet and NSMutableSet

An associative container of unique keys, similar to NSDictionary, with the difference that members do not contain a data object.

NSData and NSMutableData

A wrapper for raw byte data. An object of this type can dynamically allocate and manage its data, or it can refer to data owned by and managed by something else (such as a static numeric array).

NSDate, NSTimeZone and NSCalendar

Classes that store times and dates and represent calendrical information. They offer methods for calculating date and time differences. Together with NSLocale, they provide methods for displaying dates and times in many formats, and for adjusting times and dates based on location in the world.

Major implementations

macOS

The Foundation Kit is part of the Cocoa API. Beginning as the successor to OPENSTEP/Mach, this framework has deviated from OpenStep compliance, and is in some places incompatible.

iOS

The Foundation Kit is in the Cocoa Touch API. This framework is based on the macOS Foundation, not OpenStep.{{Citation needed|date=June 2010}}

GNUstep

The Foundation Kit is implemented in GNUstep's Base Package. This implementation is mostly comparable (4 classes are missing) and aims to be comparable with both the OpenStep API and later macOS additions.

Cocotron

The Foundation Kit is implemented in Cocotron, an open-source implementation of Cocoa.

PureFoundation

[https://code.google.com/p/purefoundation/ PureFoundation] is an open-source implementation of Foundation that implements Foundation by wrapping Core Foundation, just like in Cocoa, rather than create a separate Foundation from scratch like GNUstep and Cocotron.

SwiftFoundation

[https://github.com/apple/swift-corelibs-foundation SwiftFoundation] is Apple's open-source Swift implementation of the Foundation API for platforms where there is no Objective-C runtime.

See also

  • OpenStep
  • Application Kit
  • GNUstep
  • Cocoa (API)
  • Cocoa Touch

External links

  • GNUstep Base
  • [https://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/ObjC_classic/ Mac OS X Foundation Reference]
  • [https://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CocoaFundamentals/WhatIsCocoa/WhatIsCocoa.html#//apple_ref/doc/uid/TP40002974-CH3-SW20 Foundation section in the Cocoa Fundamentals Guide]
  • List of Classes

3 : NeXT|macOS APIs|MacOS programming tools

随便看

 

开放百科全书收录14589846条英语、德语、日语等多语种百科知识,基本涵盖了大多数领域的百科知识,是一部内容自由、开放的电子版国际百科全书。

 

Copyright © 2023 OENC.NET All Rights Reserved
京ICP备2021023879号 更新时间:2024/9/29 17:38:14