4
users = [users arrayByAddingObjectsFromArray:arrayvalue];

users is a NSMutableArray and arrayvalue is also a NSMutableArray, I am adding value of arrayvalue to the users array but I am getting a warning "incompatible pointer types assigning to NSMutableArray from NSArray ".

I hav searched, but was unable to find a solution for this.

1 Answer 1

9

Although arrayvalue is NSMutableArray, the return value of arrayByAddingObjectsFromArray: is NSArray, and that's why you get this warning.

You should call [users addObjectsFromArray:arrayvalue]; which alters the array returnsNSMutableArray.

See the NSMutableArray reference for more details.

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

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.