PDA

View Full Version : Cocoa program problem (with picture)




kellah
Apr 8, 2008, 11:24 PM
So I made a Core Data program to keep track of my biking. I am binding an entity to the pop up box and it displays the two things I put in there. However it also displays some garbage....

www.msu.edu/~kellera8/pic.png

How do I get rid of the garbage?

Thanks



lee1210
Apr 8, 2008, 11:33 PM
Given no other information I would blame an off-by-one error iterating over the choices, providing the count of items, maximum index of something, etc.

It might be best to post some code snippets. It looks like you have an array, NSArray, whatever, of strings, and something is going off of the end of it and grabbing some other memory that happens to be... wacky. Is the "Garbage" always the same?

-Lee

kainjow
Apr 9, 2008, 05:45 AM
Sounds like you have the bindings setup incorrectly. See this (http://forums.macrumors.com/showpost.php?p=4837770&postcount=7) post on how to do it.

kellah
Apr 9, 2008, 09:44 AM
The thing is, I haven't written a line of code. Everything I've done has been in Interface Builder. (And I created the data model)

I tried fixing the bindings as kainjow suggested. I can get the pop up button to populate the options correctly. I did this by binding Content and Content Values. However, as soon as I try to bind to my Selected object or value, that's when the garbage shows up. I've tried a slew of different bindings for the selection and I'm not quite sure what's wrong.

If someone would be willing to take a look at my project, perhaps it would be easier: www.msu.edu/~kellera8/RideLog.zip