home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / NeXTanswers / OpenStepSpec_rtf / FoundationKit / Classes / NSArray.rtf < prev    next >
Encoding:
Text File  |  1994-07-01  |  8.3 KB  |  116 lines

  1. {\rtf0\ansi\paperw16228 \paperh18648 \margl-907 \margr0 \margt0 \margb0 {\fonttbl\f0\fswiss Helvetica;\f1\froman Times;\f2\fmodern Courier;\f3\ftech Symbol;\f4\froman Palatino;}
  2. {\stylesheet{\s0 \li100 \fi0 \ri1007 \ql   1Head;}
  3. {\s1 \li100 \fi0 \ri1007 \ql   ClassName;}
  4. {\s2 \li2872 \fi-2771 \ri1007 \ql \tx2872   ConformsTo;}
  5. {\s3 \li2872 \fi-2771 \ri1007 \ql   DeclaredIn;}
  6. {\s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030   Description;}
  7. {\s5 \li7030 \fi-5796 \ri1007 \ql   DescriptionPart;}
  8. {\s6 \li0 \fi0 \ri0 \ql \tx-25 \tx8290 \tx9172   Footer;}
  9. {\s7 \li2872 \fi-2771 \ri1007 \ql \tx2872   InheritsFrom;}
  10. {\s8 \li100 \fi0 \ri1007 \ql   Summary;}
  11. }
  12. \li0 \fi0 \ri0 \ql \sb0 \f1 \fs24 
  13. (Preliminary Documentation) Copyright \f3 \'e3\f1 1994 by NeXT Computer, Inc.  All Rights Reserved.\
  14. \
  15. \s0 \li100 \fi0 \ri1007 \ql \f0 \b \fs36 \fs16 \
  16. \
  17. \
  18. \
  19. \
  20. \
  21. \
  22. \fs36 NSArray \
  23. \pard \s7 \li2872 \fi-2771 \ri1007 \ql \tx2872 \f1 \b0 \fs28 \fs16 \
  24. \
  25. \
  26. \fs28 \f0 \b \fs28 Inherits From:    \b0 \fs28 \f1 NSObject \
  27. \fs16 \
  28. \fs28 \s2 \fs16 \fs28 \f0 \b \fs28 Conforms To:    \b0 \fs28 \f1 NSCoding\
  29. \fi0 NSCopying  \
  30. \fi0 NSMutableCopying \
  31. \fi0 NSObject \
  32. \fs16 \
  33. \fs28 \s3 \fi-2771 \fs16 \fs28 \f0 \b \fs28 Declared In:    \b0 \fs28 \f1 foundation/NSArray.h \
  34. \fs16 \
  35. \fs28 \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs28 \fs16 \
  36. \
  37. \fs28 Allocating and Initializing an Array\
  38. \fs16 \
  39. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 + (id)\b allocWithZone:\b0 (NSZone *)\i zone\i0     Creates and returns an uninitialized array object in \i zone\i0 .\
  40. \fi-6552 \fi-6552 \fi-6552 + (id)\b array\b0     Creates and returns an empty array object\
  41. \fi-6552 \fi-6552 \fi-6552 + (id)\b arrayWithObject:\b0 (id)\i anObject\i0     Creates and returns an array object containing the single element \i anObject.\
  42. \fi-6552 \fi-6552 \i0 \fi-6552 + (id)\b arrayWithObjects:\b0 (id)\i firstObj,...\i0     Creates and returns an array object containing the objects in the argument list. The object list is comma-separated and ends with \b nil\b0 .\
  43. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (id)\b initWithArray:\b0 (NSArray *)\i array\i0     Initializes a newly allocated array object by placing in it the objects contained in \i anotherArray.\
  44. \fi-6552 \fi-6552 \i0 \fi-6552 {\f3 -} (id)\b initWithObjects:\b0 (id)\i firstObj,...\i0     Initializes a newly allocated array object by placing in it the objects in the argument list.  The object list is comma-separated and ends with \b nil\b0 .\
  45. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (id)\b initWithObjects:\b0 (id *)\i objects\i0     Initializes a newly allocated array object by placing in \
  46. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \b count:\b0 (unsigned int)\i count\i0         it \i count\i0  objects from the \i objects\i0  array\
  47. \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  48. \
  49. \
  50. \fs28 Querying the Array\
  51. \fs16 \
  52. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (BOOL)\b containsObject:\b0 (id)\i candidate\i0     Returns YES if \i anObject\i0  is present in the array.\
  53. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (unsigned int)\b count\b0     Returns the number of objects currently in the array.\
  54. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (unsigned int)\b indexOfObject:\b0 (id)\i anObject\i0     Returns the index of \i anObject\i0 , if found; otherwise, returns NSNotFound.  This method checks the elements in the array from last to first by sending them an \b isEqual:\b0  message.\
  55. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (unsigned int)\b indexOfObjectIdenticalTo:\b0 (id)\i anObject\i0     \
  56. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796     Returns the index of \i anObject\i0 , if found; otherwise, returns NSNotFound.  This method checks the elements in the array from last to first by comparing their \b id\b0 s.\
  57. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (id)\b lastObject\b0     Returns the last object in the array.\
  58. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (id)\b objectAtIndex:\b0 (unsigned int)\i index\i0     Returns the object located at \i index\i0 .  An array\'27s index starts at 0.  If \i index\i0  is beyond the end of the array, an NSRangeException error is raised.\
  59. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSEnumerator *)\b objectEnumerator\b0     Returns an enumerator object that lets you access each object in the array, starting with the first element.\
  60. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSEnumerator *)\b reverseObjectEnumerator\b0     Returns an enumerator object that lets you access each object in the array, from the last element to the first.\
  61. \fi-6552 \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  62. \
  63. \
  64. \fs28 Sending Messages to Elements\
  65. \fs16 \
  66. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (void)\b makeObjectsPerform:\b0 (SEL)\i aSelector\i0     Sends an \i aSelector\i0  message to each object in the array.\
  67. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (void)\b makeObjectsPerform:\b0 (SEL)\i aSelector\i0     Sends an \i aSelector\i0  message to each object in the \
  68. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \b withObject:\b0 (id)\i anObject\i0         array, with \i anObject\i0  as an argument.\
  69. \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  70. \
  71. \
  72. \fs28 Comparing Arrays\
  73. \fs16 \
  74. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (id)\b firstObjectCommonWithArray:\b0 (NSArray *)\i otherArray\
  75. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Returns the first object from the receiver\'27s array that\'27s equal to an object in \i otherArray\i0 .\
  76. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (BOOL)\b isEqualToArray:\b0 (NSArray *)\i otherArray\i0     Compares the receiving array object to \i otherArray\i0 .\fs28   \
  77. \fi-6552 \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs28 \fs16 \
  78. \
  79. \
  80. \fs28 Deriving New Arrays\
  81. \fs16 \
  82. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (NSArray *)\b sortedArrayUsingFunction:\b0 (int(*)(id \i element1\i0 , id \i element2\i0 , void *\i userData\i0 ))\i comparator\i0     \
  83. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \b context:\b0 (void *)\i context\i0     Returns an array listing the receiver\'27s elements in ascending order as defined by the comparison function \i comparator\i0 .   \i context\i0  is passed to the comparator function as its third argument.\
  84. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSArray *)\b sortedArrayUsingSelector:\b0 (SEL)\i comparator\i0     \
  85. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796     Returns an array listing the receiver\'27s elements in ascending order, as determined by the comparison method specified by the selector \i comparator\i0 .\
  86. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSArray *)\b subarrayWithRange:\b0 (NSRange)\i range\i0     Returns an array containing the receiver\'27s elements that fall within the limits specified by \i range\i0 .\
  87. \fi-6552 \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  88. \
  89. \
  90. \fs28 Joining String Elements\
  91. \fs16 \
  92. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (NSString *)\b componentsJoinedByString:\b0 (NSString *)\i separator\i0     \
  93. \fi-6552 \pard \s5 \li7030 \fi-5796 \ri1007 \ql \tx6652 \tx7030     Returns a string that\'27s the result of interposing \i separator\i0  between the elements of the receiver\'27s array.\
  94. \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  95. \
  96. \
  97. \fs28 Creating a String Description of the Array\
  98. \fs16 \
  99. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (NSString *)\b description\b0     Returns a string object that represents the contents of the receiver.\
  100. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSString *)\b descriptionWithLocale:\b0 (NSDictionary *)\i localeDictionary\
  101. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Returns a string representation of the NSArray object.  Included are the key and values that represent the locale data from \i localeDictionary\i0 .\
  102. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSString *)\b descriptionWithLocale:\b0 (NSDictionary *)\i localeDictionary\
  103. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0 \b indent:\b0 (unsigned int)\i level\i0     Returns a string representation of the NSArray object.  Included are the key and values that represent the locale data from \i localeDictionary\i0 .  Elements of the array are indented from the left margin by \i level\i0  + 1 multiples of four spaces, to make the output more readable.\
  104. \pard \s0 \li100 \fi0 \ri1007 \tx478 \tx856 \tx1234 \fs28 \fs16 \
  105. \
  106. \fs28 \
  107. \fs16 \
  108. \
  109. \fs28 \pard \s0 \
  110. \li100 \fi0 \fs16 \
  111. \
  112. \fs28 \
  113. \fs16 \
  114. \
  115. \fs28 }
  116.