---
title: "initWithObjects:"
framework: foundation
role: symbol
role_heading: Instance Method
path: "foundation/nsarray/initwithobjects:"
---

# initWithObjects:

Initializes a newly allocated array by placing in it the objects in the argument list.

## Declaration

```occ
- (instancetype) initWithObjects:(ObjectType) firstObj;
```

## Parameters

- `firstObj`: The first object for the array.

## Return Value

Return Value An array initialized to include the objects in the argument list. The returned object might be different than the original receiver.

## Discussion

Discussion Pass comma-separated list of trailing variadic arguments as additional objects, ending with nil. After an immutable array has been initialized in this way, it can’t be modified. This method is a designated initializer.

## See Also

### Related Documentation

- [arrayWithObjects:](foundation/nsarray/arraywithobjects:.md)

### Initializing an Array

- [init()](foundation/nsarray/init().md)
- [init(array:)](foundation/nsarray/init(array:)-o72h.md)
- [init(array:copyItems:)](foundation/nsarray/init(array:copyitems:).md)
- [init(contentsOfFile:)](foundation/nsarray/init(contentsoffile:).md)
- [init(objects:count:)](foundation/nsarray/init(objects:count:)-5odxv.md)
