Why do we need connections in XIB file?


Can anyone please tell me why we need to manually create the connections in the interface builder? Why doesn’t Xcode just create the connections automatically? When we write the following in QuizViewController.h, we are already saying that we want questionField to point to an instance of UILabel:

IBOutlet UILabel *questionField;

Why do we still have to go to the XIB file and create the connection manually?


You may have many UILabel’s on the view, so how will the compiler know which one you are referring to?


Good point.

Also I think manual is better - you can keep track of what’s happening in your application.