saman01
saman01

Reputation: 1004

How can a NSMutableArray object be cleared from all elements

This is very basic but I don't know how to do it. How can a NSMutableArray object be cleared from all elements. I want to set the array to the state when it was created:

NSMutableArray  *myArray = [[NSMutableArray   alloc] init];

Thanks

Upvotes: 0

Views: 996

Answers (1)

DBD
DBD

Reputation: 23233

[myArray removeAllObjects];

Docs can be found here

Upvotes: 6

Related Questions