Arrays, Stacks and Objects (oh my!)

lets say I have an array of object instances [Foo] the is filled in a manner similar to this

var temp = myObject(parameters)
foo.append(temp)

then elsewhere I create a stack (yeah I know its just another array)… but this is a FILO message queue to process selected objects in order

myStack.append(foo[3])

Now FOO has pointers to all the active instances of “myObject” and myStack has a pointer to instance #3 (ok #4 as it is zero based)

here is the question, and I think I know the answer, just want to be sure

foo.remove(at:3)

a) does it set myStack[0] to NIL?
b) or does the instance live on due to ARC???

if “b” then would I have to do this instead

foo[3]=nil
foo.remove(at:3)

there is a timer that looks at mystack and an processes the top entry. But if it has been removed from foo, then I need that entry to be nil so I can skip it

Haven’t tested but I think ‘b’ is the way to go and it requires being set to NIL.