I have UserDetails class:
@interface UserDetails: NSObject{
NSString* resourceName;
NSNumber* resourceId;
}
I have an object(“user”) of this class in class B which I am passing in another Class C. Now I need to store the resourceNames of different users in an array and display it in another class C(TableviewController). I am using the following statements in class C:
NSMutableArray *arr (declaration)
Implementation:
arr=[[NSMutableArray array] retain];
arr=user1.resourceName; (user1 is an object of UserDetails data class).
Error : Incompatible pointer types assigning to “NSMutableArray” from “NSString”.
Can you help me with this?
You are directly assigning stringValue “resourceName” to “arr”,which will give u error.If u wanna store the resourceName in array ..try this