Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

Jonathan Scheel
Jonathan Scheel
5,531 Points

Completely Lost

I'm trying to get a handle on XCode and Objective C, but i'm completely lost and I'm already into the lesson on creating the animations on the Crystal Ball app. To be honest, I've had to look up every single answer on the code challenges in order to move on, so I haven't really learned anything about why we're typing what we're typing to move on. Is there some other lesson or deep dive I should have started with first other than "Build a Simple iPhone App"?

Keep in mind I already know web design and can program in javascript and PHP with ease... yet I still took the courses here too just to see if I could learn anything new. Passed those with flying colors, but Objective C is just beyond me as to when and why the syntax is used and what methods, objects, and everything else is.

10 Answers

Jonathan Scheel
Jonathan Scheel
5,531 Points

Sorry to say I wound up starting the courses on another site for Objective-C fundamentals and have already advanced more there than I did with the lessons here. I think that's because it hasn't started right in with iPhone programming. It started with learning Objective-C as a language. I think that's what Treehouse needs to do with their curriculum. Much like there is an intro to programming... before you jump into javascript...before you get to jQuery.

The iOS Learning Adventure should have the "Intro to Programming" course by Jim, then an "Objective-C Fundamentals" course by Amit, then followed by the "Build a Simple iPhone App" course that exists already. I think that would alleviate much of the confusion regarding syntax and the way objects and methods work in Objective-C.

What I notice is missing from Treehouse are things like why NS is used in front of some of the variable types (heritage from NextStep) and why there is an asterisk in front of the variable name of an NSString (it's a pointer). It also explained more about the variable types like why NSString is different from other core variable types like int and char (because it isn't part of the original C programming language).

As you said Amit Bijlani, figuring out the syntax of the language is the hardest part... and that's where Treehouse needs to expands it's curriculum in order to get people over that hump.

After going about halfway through this other course, I feel like I could actually understand the lessons here quite a bit more. So I'm going to complete that course, then return here for the lessons here on iPhone App building. I really like the way Treehouse has the code challenges and quizzes between videos to get you thinking and using the code, something that is lacking on the other site. I look forward to seeing the future curriculum created here.

I am in exactly the same boat as you. I am a web developer, program in PHP and JavaScript, a whiz in Drupal. As far as I can tell, other than intro to programming, there is no other intro to Objective C. There's a large gap between the intro to programming video with Jim and the iPhone App videos. What about applying the basics to Objective C first?

Coming from a web dev background instead of a dekstop programming environment can be tricky for Objective-C. I came form a Java/C/C++ background which I think makes things easier. A really nice resource that I think covers the basics really well is http://cocoadevcentral.com/d/learn_objectivec/ . It's just text - no videos - but it covers the basics like calling methods, building objects, etc.

Hope this helps!

Jerome Garot
Jerome Garot
2,886 Points

I can definitely see where you guys are coming from, there is indeed quite a gap if you haven't studied anything prior to this.

I did Stanford Programming Methodology (Java) and read Introduction to Objective-C to get myself started on iOS coding. I coded most of my life in Visual Basic (I know, embarrasing right?) and wanted to make the jump.

I really did not have any problem with the video tutorials and thought they were perfect for me.

Is there any particular term, concept or word you're really hung up on earlier in the course? I find in my studies that my inability to grasp the content of my learning material comes right after I pass by a term I didn't quite understand.

Jonathan Scheel
Jonathan Scheel
5,531 Points

Honestly, I became confused right after creating a string. LOL Pretty sad huh? Amit doesn't explain the default syntax that we receive when we created the project from the template.

To put it into a web context, It was like starting with an already setup CSS code, jQuery plug-ins, and complete HTML5 code and then trying to explain how to edit the jQuery to someone who didn't understand why there was HTML, HEAD, or BODY tags already on the page. So i'm lost understanding where to even put things within a document.

Secondly, the concept of object and method seems foreign compared to a function in javascript, though I know it's not suppose to be.

I've decided to check out lynda.com as Solona Armstrong had suggested in another post. It appears to be far more in depth that what Treehouse offers.

That's a great analogy.

I have been a member of lynda.com for a couple years and thought maybe because Treehouse is more specialized, it would be a better place to upgrade coding skills. So far, it's not.

Good luck!

Amit Bijlani
STAFF
Amit Bijlani
Treehouse Guest Teacher

I addressed these concerns in the other thread posted by Solona, so I'm going to try to answer some questions regarding Objective-C syntax. Apple has a great Objective-C Primer.

Let me try to draw some parallels between javascript and Objective-C.

// defining a string in javascript
var myString = "Hello World";

// defining a string in objective-c 
NSString *myString = @"Hello World";

// defining an array of strings in javascript
var myArray = new Array("one","two","three");
or 
var myArray = ["one","two","three"];


// defining an array of strings in Objective-c
NSArray *myArray = [[NSSArray alloc] initWithObjects:@"one",@"two",@"three"];
or 
NSArray *myArray = [@"one",@"two",@"three"];

As you can see there is a pattern here. Javascript may not the best example because it's a dynamic and weakly typed language. However, it allows you to see the basic structure of defining a variable. The "Blog Reader" course goes deeper into the fundamentals of objects, methods and properties.

It is important to understand that everything in Objective-C is an object since it is an object oriented language. For example, UIView is a class which defines the attributes (properties) of a view and how you can interact (methods) with that view.

Some of the properties of UIView are:

  • backgroundColor,
  • alpha
  • frame

Some methods of UIView are:

  • drawRect
  • addGestureRecognizer

That's how most of the classes are structured. Once you get past the basic syntax of calling a method and creating an instance then it gets easier.

:thumbsup: Amit Bijlani!

A lot of people get frustrated when they cannot understand a new language, but it is exactly that. A new language. Keep doing the code challenges... not until you get them right, but until you can't get them wrong!

Keep coding!

Jonathan Scheel
Jonathan Scheel
5,531 Points

This is an old thread, but I thought I would provide some updated feedback given the major overhaul the iOS course track has had. I haven't been on Treehouse since my difficulties with the iOS course (which was my main reason for signing up to Treehouse in the first place). Now that the track been upgraded with new fundamentals courses, I thought I'd try it again. Unfortunately, it seems to still have a ways to go... or I'm just an idiot when it comes to iOS and should quit.

I'm posting to list some observations from a complete outsider taking this course... one who has had no experience with C or Objective-C but some with PHP and Javascript, though not on the class/object side of those languages. It's been months since I tried the original course here on Treehouse for iOS and have forgotten nearly everything that was in that course... so it truly is like i'm starting fresh with this.

That said, I'm through the first 3 stages of the initial Deep Dive of the iOS track and feel i'm still missing some very basic information that was not discussed, but was used in the lessons and required in quizzes/challenges.

  1. Alloc and Init are never discussed. What are they? Why are they there? What do they do?

  2. I see "nonatomic" being typed but no explanation is given as to why it is there. Same goes for "strong" and/or "weak". Douglas does mention the syntax is different as he types it and that he'll go over it later, but never does.

  3. The Objective-C videos seem to cover too much between the quizzes/challenges. By the time I got to the end code challenge, I'd forgotten almost everything from the 6 videos prior and had no clue what to type or which video to re-watch to figure out what I was missing.

  4. What is cocoa touch? Why is that the selection choice when building objects? Just a simple description here like "Select Cocoa Touch, which is Apple's framework that drives all iOS applications". (Not sure that is correct or not?)

I'm not looking for these questions to be answered here... but rather to give constructive criticism regarding what's being covered and what's being left out of the lessons for novices like myself. The first 3 stages in the Objective-C deep dive (specifically on C itself and pointers and memory) were extremely easy to follow, especially with nicely spaced quizzes and challenges to make sure we retain what was just learned. I felt the course had been vastly improved in getting someone started. But then I hit Objective-C and fell out of the Treehouse again.

Hi all,

I know this is an old thread, but I too felt totally lost in in the iOS "track".

They have a lot more Swift tutorials right now, but Objective-C is still a requirement for getting through the iOS track: http://teamtreehouse.com/tracks/ios-development-with-objectivec

That said, I think all the objections noted in this thread are still valid.

I (at least) have had over 20 years experience dealing with other computer languages.

Consider those poor souls who started with the iOS track as their first track.

Yikes!!!

I'd much rather recommend the Treehouse "Web Design" or "Front End Web Development" tracks as the way to "ease in" to coding, for those with no programming background, rather than starting out with anything to do with Objective-C

..........

That being said I pretty much completed all the other tracks before starting the iOS track (on purpose).

Why?

--because I don't have/own a Mac or a mobile iOS device (i.e. iPhone).

So for me this course is being done "virtually", relying on just the videos and the zipped code project files.

So, particularly for me (in my case), the "disconnect" between the code in the videos and zipped project files and

what is being asked in the fill-in-the-blank-quizzes or objectives is very very discernible (glaring).

For Amit Bijlani , I don't remember you providing that Objective-C Primer link you cited above anywhere in the "Objective-C Basics" course: http://teamtreehouse.com/library/objectivec-basics

It should be in the Teachers Notes for "Brief Intro to C" or at the start of "Functional Programming in C".

These links (you provided the Solona thread) would also be helpful to include somewhere in Teachers Notes for the Objective-C courses:

https://developer.apple.com/library/ios/navigation/index.html?section=Resource+Types&topic=Getting+Started#section=Resource%20Types&topic=Sample%20Code

https://developer.apple.com/library/ios/navigation/index.html?section=Resource+Types&topic=Getting+Started#section=Resource%20Types&topic=Guides

In the Solona thread I really think your reply failed to address Jonathan Scheel concern:

"..and feel like I haven't learned anything but how to mimic what Amit is doing... and most of the time not even that. I don't understand the reasons why we are doing what we are doing and what it all means.

..that was also a concern of Solona Armstrong: "As you say, I'm mimicking Amit"

It's what I call the "magic code syndrome": Don't really explain what the code is doing or why this code (versus some other alternative code) is needed, just copy and paste and be happy.

Except for me it makes me "not happy".

What about if I/we have to do are own iOS app out in the professional world?

That's the reason I (and I assume other Treehouse students) am/are trying to sharpen/update our skillsets via the treehouse courses --to get a better job.

When I get out in the "real world" will I (or the other Treehouse students) be able to come up with code on my own?

Maybe..maybe not.

That's my concern and I don't know how many people work with you (Amit) to develop the courses you have videos for, but far far more emphasis on the fundamentals is definitely necessary as a pre-requisite before going for a "sink-or-swim" approach right into the heart of Objective-C (and iOS/iPhone development).

My suggestions to improve things: A course that was a "let's spend a bit of time walking through getting comfortable with the XCode IDE" would have been nice/appropriate.

Then (somehow) working in some of the history of Apple programming would have been helpful also to answer another of Jonathan Scheel's voiced concerns:

"What I notice is missing from Treehouse are things like why NS is used in front of some of the variable types (heritage from NextStep) and why there is an asterisk in front of the variable name of an NSString (it's a pointer)."

In fact, Treehouse could do a whole course on just the intricacies and subtle "gotchas" of pointers (both in Objective-C as well as C/C++ in general).

I got confused when *something turned into _something (versus using "something" in quotes for an NSString...or even a pointer to a String, maybe).

Oh and regarding your javascript comparison, while it may look a lot like Objective-C to the uninitiated, is a very different programming language used in a very different way, so all discussions of "pattern" aside I agree with you when you say:

"Javascript may not the best example because it's a dynamic and weakly typed language."

There's also the question of compiled versus interpreted languages.

C/C++ and all their variants (like Objective-C) are, at least to me, much more "hard core" programming languages than languages like Java and Visual Basic.

I learned VB using Visual Basic 6 (before VB.Net) and generally both languages run in "interpreted mode" so crash far less often then languages which are "unmanaged" (use direct memory manipulation/management like pointers and using "alloc").

As just one example: The Treehouse course "Alloc and Init": http://teamtreehouse.com/library/objectivec-basics/beyond-the-basics/alloc-and-init

..had absolutely no mention of MRR versus ARC!

I later found this page which not only mentioned both, but had a helpful diagram: http://www.tutorialspoint.com/objective_c/objective_c_memory_management.htm

Anyway, I could go on but you get the drift.

Covering less material (and explain things x10 more) is much more valuable than trying to squeeze it a bunch of social media tie-in functionality just because social media is what's "hot" or "cool" at this point in history.

I know many of the people at Treehouse who have a lot of programming experience like typing text (even though it makes for some very boring video content),

but for non-programmers graphics are a lot more fun (increase the fun "quotient") than just/mainly text (or have the app being something that just has text input and text output).

What about just a simple fun graphics app/game..maybe a card game or a whack-a-mole game.

Both types of tutorial are general available in Android format as well.

Including more people who are non-programmers in your survey/testing groups for content could give you a lot of insights that might help with design of future courses (especially beginner level ones).

Amit Bijlani
Amit Bijlani
Treehouse Guest Teacher

Thanks for the detailed feedback. We are aware of the issues in the Objective-C Basics course and it's due for a re-write. However, we have a completely separate Swift based track which does not require Objective-C and is very up-to-date: http://teamtreehouse.com/tracks/ios-development-with-swift

/cc Pasan Premaratne

Pasan Premaratne
Pasan Premaratne
Treehouse Teacher

jameswhite7

Thanks for the detailed feedback! I'm working on a rewrite of the Objective C primer courses and will take all this into account.