NSArray(Utilities)

@interface NSArray (Utilities)

Additional array utilities used by TensorIO.

  • Returns the first n elements, or if the length of the array is less than n, the contents of array.

    Declaration

    Objective-C

    - (nonnull NSArray *)firstN:(NSUInteger)n;

    Swift

    func firstN(_ n: UInt) -> [Any]
  • Returns all objects in the array reversed, by way of the reverseObjectEnumerator.

    Declaration

    Objective-C

    - (nonnull NSArray *)reversed;

    Swift

    func reversed() -> [Any]
  • Returns the numeric product of the array’s entries. The entries must be of type NSNumber.

    Declaration

    Objective-C

    - (NSInteger)product;

    Swift

    func product() -> Int