method returning wrong variable

Posted by cocoanewbie on Stack Overflow See other posts from Stack Overflow or by cocoanewbie
Published on 2010-04-09T17:27:09Z Indexed on 2010/04/09 17:33 UTC
Read the original article Hit count: 219

Filed under:
|

This class I'm working with has three instance variables I'm interested in, NSmutablearrays xArray yArray and zArray, there are also other NSmutablearrays, a, bArray and c. I just added accessors

- (NSMutableArray *) xArray {
   return xArray;
}

ditto for y and z. However, it's returning yArray, zArray and bArray for some reason. Why is that happening?


Okay, I just changed the names of the methods to GetXArray and everything seems to be returning the right variables. Now I'm really confused. How the heck did this happen and how do I prevent this from happening in the future?

© Stack Overflow or respective owner

Related posts about cocoa

Related posts about objective-c