• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

[Objective-C]-NSObject

原作者: [db:作者] 来自: [db:来源] 收藏 邀请
  • Data Storage

   NSData provides object-oriented storage for arrays of bytes. 

   NSValue and NSNumber provide object-oriented storage for arrays of simple C data values. 

   NSArrayNSDictionary, and NSSet provide storage for Objective-C objects of any class.

       See Number and Value Programming Topics and Collections Programming Topics for more information.

  • Text and Strings:

        The NSString and NSMutableString classes represent text strings and provide methods for searching, combining, and comparing strings.

        An NSScanner object is used to scan numbers and words from an NSString object. 

    NSCharacterSet represents various groupings of characters that are used by NSString and NSScanner.

        See String Programming Guide for more information.

  • Dates and Times:

        The NSDateNSTimeZone, and NSCalendar classes 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.

        See Date and Time Programming Guide for more information.

  • Sorting and Filtering:

       Collections of Objective-C objects, such as NSArrayNSDictionary, and NSSet, can be filtered by an NSPredicate object, and sorted by one or more NSSortDescriptor objects.

       See Sort Descriptor Programming Topics and Predicate Programming Guide for more information.

  • Application Coordination and Timing

    NSNotificationNSNotificationCenter, and NSNotificationQueue provide systems that an object can use to notify all interested observers of changes that occur.

         You can use an NSTimer object to send a message to another object at specific intervals.

         See Notification Programming Topics for more information.

  • Object Distribution and Persistence:

        The data that an object contains can be represented in an architecture-independent way usingNSPropertyListSerialization and NSJSONSerialization.

        The NSCoder class and its subclasses take this process a step further by allowing class information to be stored along with the data. The resulting representations are used for archiving and for object distribution.

        See Archives and Serializations Programming Guide for more information.

  • Operating-System Services:

       Several classes are designed to insulate you from the idiosyncrasies of various operating systems.

   NSFileManager provides a consistent interface for file operations (creating, renaming, deleting, and so on). 

   NSThread and NSProcessInfo let you create multithreaded applications and query the environment in which an application runs.

       See File System Programming Guide for more information.

  • URL Loading System:

        A set of classes and protocols that allow your app to access content referenced by a URL, as represented by the NSURL class. 

   NSURLRequest and NSURLResponse objects represent requests and responses sent and received by an NSURLSession object. Additional functionality is provided by helper classes,

       including NSURLProtocol for protocol support, NSURLAuthenticationChallenge and NSURLCredentialStoragefor authentication and credentials, 

   NSHTTPCookieStorage for cookie storage, and NSURLCache for cache management.

       See URL Session Programming Guide for more information.

Value Object

1.NSAffineTransform (2015-12-08)

NSAffineTransform class is available in Cocoa framework for the Mac OS X development. And CGAffineTransform class is available in the Cocoa Touch framework for the iOS application development. If you implementing application in iOS Use CGAffineTransform

2.NSCalendar (2015-12-08)

Calendars encapsulate information about systems of reckoning time in which the beginning, length, and divisions of a year are defined. They provide information about the calendar and support for calendrical computations such as determining the range of a given calendrical unit and adding units to a given absolute time.
NSCalendar is “toll-free bridged” with its Core Foundation counterpart, CFCalendarRef. See Toll-Free Bridging for more information on toll-free bridging herf1 herf2

 3.NSCache (2015-12-08)

An NSCache object is a collection-like container, or cache, that stores key-value pairs, similar to the NSDictionary class. Developers often incorporate caches to temporarily store objects with transient data tha-t are expensive to create. Reusing these objects can provide performance benefits, because their values do not have to be recalculated. However, the objects are not critical to the application and can be discard-ed if memory is tight. If discarded, their values will have to be recomputed again when needed.

 4.NSData(2015-12-09)

NSData and its mutable subclass NSMutableData provide data objects, object-oriented wrappers for byte buffers. Data objects let simple allocated buffers (that is, data with no embedded pointers) take on the behavior of Foundation objects.
NSData creates static data objects, and NSMutableData creates dynamic data objects. NSData and NSMutableData are typically used for data storage and are also useful in Distributed Objects applications, where datacontained in data objects can be copied or moved between applications.
The size of the data is subject to a theoretical limit of about 8 ExaBytes (in practice, the limit should not be a factor).
NSData is “toll-free bridged” with its Core Foundation counterpart, CFDataRef. See Toll-Free Bridging for more information on toll-free bridging. herf1 herf2

 5.NSMutableData(2015-12-09)

NSMutableData (and its superclass NSData) provide data objects, object-oriented wrappers for byte buffers. Data objects let simple allocated buffers (that is, data with no embedded pointers) take on the behavior of Foundation objects. They are typically used for data storage and are also useful in Distributed Objects applications, where data contained in data objects can be copied or moved between applications. NSData creates static data objects, and NSMutableData creates dynamic data objects. You can easily convert one type of data object to the other with the initializer that takes an NSData object or an NSMutableData object as an argument.

 6.NSPurgeableData(2015-12-10)

You should use the NSPurgeableData class when you have objects with bytes that can be discarded when no longer needed. Purging these bytes may be advantageous for your system, because doing so frees up memory needed by other applications. The NSPurgeableData class provides a default implementation of the NSDiscardableContent protocol, from which it inherits its interface.

 7.NSDate(2015-12-10)

NSDate objects encapsulate a single point in time, independent of any particular calendrical system or time zone. Date objects are immutable, representing an invariant time interval relative to an absolute reference date (00:00:00 UTC on 1 January 2001).

 


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
使用Uncrustify在Xcode中格式化Objective-C代码发布时间:2022-07-12
下一篇:
Objective-C 中实现 Monkey-Patching发布时间:2022-07-12
热门推荐
热门话题
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap