write class files problem

Discussion in 'Mac Programming' started by liptonlover, May 23, 2008.

  1. liptonlover macrumors 6502a

    Joined:
    Mar 13, 2008
    #1
    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?
     
  2. HiRez macrumors 603

    HiRez

    Joined:
    Jan 6, 2004
    Location:
    Western US
    #2
    I always just drag the .h file over from Xcode into the main IB window (having hotcorner Exposé active helps with this).
     
  3. liptonlover thread starter macrumors 6502a

    Joined:
    Mar 13, 2008
    #3
    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?
     
  4. Mac Player macrumors regular

    Joined:
    Jan 19, 2006
    #4
    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
     

Share This Page