Odd Warning


#1

I’m getting an odd warning when I “build and run” the program as published.

“The ‘view’ outlet of ‘File’s Owner’ is connected to ‘View’ but ‘view’ is no longer defined on CurrentTimeViewController.”

Everything works and it builds and runs fine on my iPad, but (a) the Hypnosis view is offset slightly lower on the screen and
(b) if I disconnect “View” from the file’s owner right-click popup, the time view doesn’t work at all, and the warning remains.

Can someone shed some light on this?


#2

Did you by chance rename your controller object? Check the Custom Class Class of File’s Owner and make sure it is the correct controller object name.


#3

I had accidentally called it CuttentTypeViewController and ended up copying the code to the text editor, deleting all files related to the controller and recreating them as directed in the book.

But I will check that at the first opportunity.


#4

Nope… that wasn’t the problem. In the Inspector, it shows the File Owner field correct.


#5

In CurrentTimeViewController.h, make sure your class is declared as (emphasis on the superclass here):

@interface CurrentTimeViewController : UIViewController

#6

[quote=“JoeConway”]In CurrentTimeViewController.h, make sure your class is declared as (emphasis on the superclass here):

@interface CurrentTimeViewController : UIViewController [/quote]
Hello, Joe

Thanks for the response - I checked that line as well - by copying your line of code directly into my file and verifying the two were identical. They were, and that warning is still present.

Everything runs fine, but it would be nice to try to find the cause of this warning, as a warning usually means a potential problem or crash down the road.


#7

Follow up:

I found the source of the warning. I think it stems from the fact that I had some issues with the creation and maintenance of the XIB files while I was trying to fix the issue of accidentally naming CurrentTimeViewController “CuttentTimeViewController” and subsequently trying to change the names of all the files and references.

As I mentioned earlier, I ended up deleting everything associated with that area of the project and started from scratch, including recreating the XIB file. However, it seems that, when I was messing around, I accidentally left an XIB file in the directory and it got dragged into the references list somehow.

The warning I was getting was what looks like two identical files in two different locations (one was in the project directory, and the other was in the “classes” subdirectory) conflicting. The compiler was compiling both of them and getting confused, causing it to throw a warning.