PDA

View Full Version : New to iPhone Programming, Xcode 3.2 issues




HommePomme
Jul 16, 2010, 02:38 PM
To preface this I am brand new to iPhone programming, and unfortunately object-oriented languages as a whole. I'm doing ok getting my bearings and building a couple simple apps, but I am having a huge amount of trouble with tutorials that were written on older Xcode versions, and some stuff isn't translating. My biggest issue is that outlets that I create in the header file don't seem to show up in IB no matter what I do.

As a test, I am basically just trying to read a text file into an NSArray, and then populate a UITableView with said array, but like I said, am running into outlet issues. Can anyone more knowledgeable give me some tips?



PatrickCocoa
Jul 16, 2010, 04:08 PM
To preface this I am brand new to iPhone programming, and unfortunately object-oriented languages as a whole. I'm doing ok getting my bearings and building a couple simple apps, but I am having a huge amount of trouble with tutorials that were written on older Xcode versions, and some stuff isn't translating. My biggest issue is that outlets that I create in the header file don't seem to show up in IB no matter what I do.

As a test, I am basically just trying to read a text file into an NSArray, and then populate a UITableView with said array, but like I said, am running into outlet issues. Can anyone more knowledgeable give me some tips?

Bonjour AppleMan!

I'd suggest either:
1) using newer tutorials that work with the newer Xcode; or
2) installing the older version of Xcode that is used in the tutorials you're interested in.

dejo
Jul 16, 2010, 04:47 PM
Not much has changed with regards to IBOutlets for some time now. Do you have any code you can show us? Also, what tutorials are you trying? The more information you can give us, the better.

Also, since you're new, I'd suggest reading this blog post: Getting Answers (http://www.mikeash.com/getting_answers.html)

HommePomme
Jul 16, 2010, 05:01 PM
Not much has changed with regards to IBOutlets for some time now. Do you have any code you can show us? Also, what tutorials are you trying? The more information you can give us, the better.

Also, since you're new, I'd suggest reading this blog post: Getting Answers (http://www.mikeash.com/getting_answers.html)

Take, for example, this tutorial here:
http://adeem.me/blog/2009/05/19/iphone-programming-tutorial-part-1-uitableview-using-nsarray/

In step 2, after declaring the outlet in the header:

@interface SimpleTableViewController : UIViewController {
IBOutlet UITableView *tblSimpleTable;
}

"tblSimpleTable" doesn't show up under "Outlets" in the Connections Inspector within IB after opening the .xib .

From what I have gathered, some of the Outlets/Actions have moved to the Library pane under "Classes" but the previously declared outlet does not show up there either.

Also, I have run into the same problem in a variety of other tutorial as well, so it could just be an interface element that I am unaware of, a simple fix...

Thanks.

EDIT: Solved some of my problems just by starting with a "Navigation Based Application" which automatically creates the necessary connections, but I'm still unsure how to manually do this for other views.

dejo
Jul 16, 2010, 05:23 PM
Take, for example, this tutorial here:
http://adeem.me/blog/2009/05/19/iphone-programming-tutorial-part-1-uitableview-using-nsarray/

In step 2, after declaring the outlet in the header:

@interface SimpleTableViewController : UIViewController {
IBOutlet UITableView *tblSimpleTable;
}

"tblSimpleTable" doesn't show up under "Outlets" in the Connections Inspector within IB after opening the .xib
The part that the written steps of this tutorial misses is that you need to select the File's Owner before you will see tblSimpleTable in the Connections Inspector. Either watch the video tutorial that goes along with this (maybe it's explained there) or find a better written tutorial. Tutorials should not be leaving out important pieces of information like this because they are often being stepped through by programmers unfamiliar with the required details (hence why they turn to tutorials to learn this stuff in the first place).

HommePomme
Jul 19, 2010, 11:20 AM
The part that the written steps of this tutorial misses is that you need to select the File's Owner before you will see tblSimpleTable in the Connections Inspector. Either watch the video tutorial that goes along with this (maybe it's explained there) or find a better written tutorial. Tutorials should not be leaving out important pieces of information like this because they are often being stepped through by programmers unfamiliar with the required details (hence why they turn to tutorials to learn this stuff in the first place).

Just figued this out as I was messing about. Outlets all show up under file's owner, and linking them works fine. Thanks!