0

This is my code :

SHARED_MGR.aryToDoList.removeAllObjects()

It is an MutableArray with data model objects . Somehow I am getting crash as :

Swift._SwiftDeferredNSArray removeAllObjects]: unrecognized selector sent to instance 0x618000231720

I have type checked if the array is of type NSArray but it returns false as a result, doing the same with NSMutableArray return true.

2

1 Answer 1

1

You can use below line of code for this

SHARED_MGR.aryToDoList = []
Sign up to request clarification or add additional context in comments.

4 Comments

I am getting the same error while replacing objects in the same error through replaceObject(at: index, with : obj) method, do you have any workaround for it?
Your array is not having that length may be and you are trying to replace on that index
If the above answer helped you for previous question please accept this
Had to wait 8 mins for it :D

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.