I have another question for you that I believe I already know WHY it isn't working, but I'm not sure how to fix it...
I have a database array object using MutableNSArray. Let's call it "Database". This is an array of objects of type DatabaseRecord. I also have another DatabaseRecord object called CurrentRecord which is the active object I manipulate from the user interface. When I add a new entry into the database, I call:
[Database addObject: CurrentRecord];
When I'm done making changes, I replace the added record in the database with:
[Database replaceObjectAtIndex: <index> withObject: CurrentRecord];
What I just realizes was that CurrentRecord is a pointer defined as:
DatabaseRecord *CurrentRecord;
I believe that what is happening is that each and every new entry in the database sets itself to the values of CurrentRecord. Likewise, when I change CurrentRecord, all of objects in the NSArray modify themselves accordingly, so I'm left with a database of, say, 100 records that are all identical.
What I want to do is essentially COPY the values of CurrentRecord into the appropriate object in the MutableNSArray.
I'm sure there's an easy fix to this, such as not passing a pointer, but I'm not quite sure how to proceed. I hope I'm being clear in my question...
databaseandcurrentRecordso that they don't seem to be class names.)