I have 2 classes, an NSObject and an NSView. No AppDelegate.
I was getting a hard error “method definition not in @implementation context” even though the methods were between @implementation and @end. Moving a #import ahead of @implementation eliminated that but then variables from the other file were not known. To get rid of it, I wound up // commenting out all the code lines in both .h and .m files. There’s no code left except @interfaces, @implementations, and @ends.
I still get a warning “@end must appear in implementation context.” One of them appears immediately after the @end!
I have not attempted to use IB in this program.
Other programs compile correctly, and I think the code is correct in his one and it should work.
Is there some way the compiler gets stuck? OSX 10.6.8, Xcode 3.2.6.
I gave up on that project, created a new project, and copied and pasted the text from the bad one. The new project works fine with the same old text.
Then I ran memtest repeatedly and Applejack to clean up. The hardware is ok.
Probably the compiler is flaky; I’ve had to do this a couple times this year. Last time an error message said that the compiler had a partition problem; Google links said to upgrade and maybe the new version would fix the problem. So I installed Xcode 3.2.6, which produced the same error, unfortunately. Copy and paste to a new project was necessary, again.