0

i used following method to rmove all objects from an NSMutableArray

[myData removeAllObjects];

but it gives an runtime error

here is the error

OrgProject(3934,0xa0719500) malloc: * error for object 0x5f5ca30: double free * set a breakpoint in malloc_error_break to debug Program received signal: “SIGABRT”

please help...

2 Answers 2

4

It sounds like you have released some of object of the array before removing it from this array

Sign up to request clarification or add additional context in comments.

Comments

2

It looks like on of the objects was released to often. This often happens when you release an autoreleased object without explicitly retaining it, for example. As the array retains its objects, this bug hides very well until this point.

It should be easy to find out which object is the problem here, and then look how it is created and what retain/release/autorelease messages you send to it.

Comments

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.