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

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
So I'm in the learning process and I have a nice simple application. I'm adding onto it, and the class file gets changed via interface builder. But when I write class files and choose replace it empties out all of the actions I had put in there, so I have to rewrite all of it! And when I tried merge, I couldn't get it to do the merging. How do I add to a class file with IB without erasing old stuff?
 

HiRez

macrumors 603
Jan 6, 2004
6,265
2,630
Western US
So I'm in the learning process and I have a nice simple application. I'm adding onto it, and the class file gets changed via interface builder. But when I write class files and choose replace it empties out all of the actions I had put in there, so I have to rewrite all of it! And when I tried merge, I couldn't get it to do the merging. How do I add to a class file with IB without erasing old stuff?
I always just drag the .h file over from Xcode into the main IB window (having hotcorner Exposé active helps with this).
 

liptonlover

macrumors 6502a
Original poster
Mar 13, 2008
989
0
noooo... the problem is the other way around. Let's try this.

1. I have an interface in IB. It has a class called foo to handle object communications with each other.

2. I save the class .m and .h files to my xcode project via write class files in IB.

3. I put something, more accurately a setintvalue function into one of the actions in the class.

4. I run the program and it works nice.

5. Then I go back to IB and add another action to the class foo.

6. When I do write class files, it replaces the previous one. So any lines I wrote in those actions like setintvalue for example, are gone. It's an empty shell waiting to be filled again.

My only workaround currently is to save the updated class files with a new name, then copy the new parts to the old one. But surely there is a better way than that?
 

Mac Player

macrumors regular
Jan 19, 2006
225
0
Thats just they way it is, there is no way around. Write class files will always create new files.

After the files are n place the best way is to create the new methods by hand and synchronize with IB
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.