Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Littleodie914

macrumors 68000
Original poster
Jun 9, 2004
1,813
8
Rochester, NY
Hey guys, back again, with more property woes. (Or at least that's what I assume is the problem! :p)

I've got a tableview, like the "name" field in a single contact view. When you click on it, it slides a new view over from the right, and lets you edit "first" and "last" separately, in a sense.

The problem is, when I create this new edit view, I pass it a pointer to the current object we're editing. When the user changes something and hits save, the value is *correctly* saved to the object being pointed to. I checked this. But then, when the previous view is re-displayed, and it attempts to retrieve the value for the cell to display "John Smith," for example, getting that property from that pointer breaks. Here's what I'm seeing in my debugger, and all my properties are assigned.

The first picture is the code in the edit view, that changes the object, the goes back to the previous view. In that code, the "Attempting to set..." and "New title..." both print the same value. So the title is being set, and properly, but it's then being lost somewhere when the view changes.

The second picture is the code to change the cell's values in the previous view, and the value of the subject object that was being edited. (Notice the title is now a CABasicAnimation! Even though when I print that *same* pointer property value in the edit view, it's a string, and prints fine.)

Edit: I've come to the conclusion that in order to fix a problem, I just have to ask the question. The problem was, the "newText" pointer wasn't being retained. So while it was getting the subject.title fine in the first piece of code, when the view was changed, the NSString was released, and pointer pointed somewhere else. :eek:
 

Attachments

  • Picture 2.png
    Picture 2.png
    14.8 KB · Views: 94
  • Picture 3.png
    Picture 3.png
    146.8 KB · Views: 75
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.