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

1458279

Suspended
Original poster
May 1, 2010
1,601
1,521
California
I have a .h/.m that I #import into another .m file. Everything was working fine, then I made some changes in the .h that is being imported and the changes were not seen.

So I cleaned the project, that didn't work. I removed the .h/.m from the project, created a new set with nothing and still the .m was seeing the old class structure.

Finally, I deleted the files and #import and created an entirely new file name and created the class in there. --- This is the only thing I could get to work.

This seems cumbersome to do, esp as a project grows larger. Is there something I'm missing here, or is this just the way Xcode works?

I'm guessing it has to do with caching of precompiled files or something, but there should be some way to tell Xcode to redo everything.

BTW, I also found you can't drag-n-drop classes from one project to another, that gave me a link error.

Ver 4.5.2
 
Does Swift have these kinds of issues? I wouldn't know - seeing Apple unveil Swift + Unity 5 compiling to WebGL made me decide I don't want to bother with native anymore.
 
BTW, I also found you can't drag-n-drop classes from one project to another, that gave me a link error.

When you say from one project to another, you mean from the project navigator in the sidebar? I have done this countless times and have never had a problem. Just dragging over the.h/.m files...
 
When you say from one project to another, you mean from the project navigator in the sidebar? I have done this countless times and have never had a problem. Just dragging over the.h/.m files...

Yes, that's what I did... grabbed the .h/.m and dropped it into another project and selected 'copy'. It gave me a linker error. So I deleted them, created the same files from new, copy/paste the code in and it worked.

It's interesting that I've done this before without this error.

My guess about the other error is that it's stuck in cache or something.

The other error really sucks, because it's assumed that you'd be making classes and modifying those classes over time. When I did exactly that, the new mods weren't being seen in all the files.

I added new properties to the .h which showed up in the .m but NOT in the other .m where the class was being used.

Deleting the files didn't help, I had to create brand new files with different names. --- Strange.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.