Cannot set QuestionField


#1

I recently just purchases iOS Programming - The Big Nerd Ranch Guide 3rd edition. When the book came I was very eager to start learning how to code iOS applications. I was flying through everything until I came to the point where I had to set pointers. I am following everything the book tells me to do with writing the code and where to put the objects in the .xib file.

I am currently running Mac OS X 10.8.3 while running Xcode 4.6.1 (4H512). I know that this book doesn’t use 4.6.1 but I would assume they are very similar.

This is from my QuizViewController.h

[code]#import <UIKit/UIKit.h>

@interface QuizViewController : UIViewController
{
int currentQuestionIndex;

// The model objects
NSMutableArray *questions;
NSMutableArray *answers;

// The view objects - don't worry about IBOutlet -
// we'll talk about it shortly
IBOutlet UILabel *questionField;
IBOutlet UILabel *answerField;

}

  • (IBAction)showQuestion:(id)sender;
  • (IBAction)showAnswer:(id)sender;

@end
[/code]

Here is what it shows me when I go to set the pointers.

The picture in the book where it shows you how to set the questionField is different from what mine shows.

Any help will be greatly appreciated. Thank you


#2

It could be that I don’t understand the issue you’re having but it appears you have right-clicked on a UILabel in the “Objects” group instead of File’s Owner in the “Placeholders” group.


#3

If I click on file owners than right click on it, it automatically goes to that


#4

Huh. That’s messed up.
I’m also on OSX 10.8.3 and XCode 4.6.1
I tried to recreate the problem by redoing the Quiz app (with and without storyboards) but no luck.
In my limited experience, the “interface builder” portion of XCode has gotten messed up and confused, I have resorted to quitting and reopening XCode on occasion also, I’ve started a number of the apps over from scratch.


#5

Huh. That’s messed up.
I’m also on OSX 10.8.3 and XCode 4.6.1
I tried to recreate the problem by redoing the Quiz app (with and without storyboards) but no luck.
In my limited experience, the “interface builder” portion of XCode has gotten messed up and confused, I have resorted to quitting and reopening XCode on occasion also, I’ve started a number of the apps over from scratch.[/quote]

I have rewrote the code plenty of times and I have also restarted the whole application and reading it word for word and it still doesn’t work. Getting severely aggravated with this.


#6

Show the Utilities, and then click on the “File’s Owner” in placeholders. After that, click on the “show connection inspector” (far right). That should provide you a similar view. Right click File Owner after you’ve selected it.

If the header of the file isn’t “File’s Owner”, somehow something else is getting selected.


#7

[quote=“Tiberius”]Show the Utilities, and then click on the “File’s Owner” in placeholders. After that, click on the “show connection inspector” (far right). That should provide you a similar view. Right click File Owner after you’ve selected it.

If the header of the file isn’t “File’s Owner”, somehow something else is getting selected.[/quote]

I LOVE YOU! Thank you. It works now and I finished the quiz application!


#8

I was having this same problem, thanks for the tips that sent me in the right direction.

I was unable to see the objects I had created in the header file:

Then I poked around and found this little nugget in the Identity Inspector (left) which I changed from the default to my custom view controller class (right)

I’m guessing that because I had to manually create the .xib file in Xcode5 there was no relationship created between the custom view controller and the File’s Owner? Anyway, after I changed it to the instance of my view controller class I now had the necessary objects available when I right-clicked on File’s Owner: