I am having trouble with compatibility between NSArray and NSMutableArray?
–> Incompatible Objective-C types assigning “struct NSArray *”, expected “struct NSMutableArray”
NSMutableArray *nsmarrRow;
NSString *nsstrFilePath = [[NSBundle mainBundle] pathForResource: nsstrFilename ofType: nsstrExtension];
NSString *nsstrFileContents = [NSString stringWithContentsOfFile: nsstrFilePath encoding:NSUTF8StringEncoding error: NULL];
//break up file into rows
nsmarrRow = [nsstrFileContents componentsSeparatedByString: nsstrRowParse];//<--Incompatible Objective-C types assigning "struct NSArray *", expected "struct NSMutableArray"
I have tried making the “NSString declaration” to “NSMutableString”… made more problems.
thanks
You can’t get a mutable array by doing
You will need to,
Changing
NSStringtoNSMutableStringwon’t give you anNSMutableArrayobject. You will get anNSArrayobject just as in case ofNSString. You will have to use that to get anNSMutableArrayusing the above method.