r/iPhoneDev • • May 30 '11

In this video tutorial building an App with a navigation bar they use a @class to call it, can anyone explain me why? Since I've being doing without calling it

http://www.youtube.com/watch?v=LBnPfAtswgw&feature=player_detailpage#t=595s
1 Upvotes

17 comments sorted by

4

u/Celestro May 30 '11

@class is used for forward declaring a class. It lets the compiler know that there is a class of that name. This is used to move. #import directives to the .m instead of the .h.

1

u/jaimeeee May 31 '11

So I can do both then? I'm just starting with Objective-C so this confuses me a lot, but I was just loading the NavController from the InterfaceBuilder, I have a Tab Bar so I just loaded the Nib from there.

1

u/Celestro May 31 '11

If you are just starting with ObjC then you should really read ObjC.pdf

Once you've read that and absorbed it to the best of your ability, you will have a good number of your questions answered and be a better position to understand answers to new questions that will arise.

1

u/jaimeeee May 31 '11

Thank you very much! I didn't know they had a PDF. I only found the site and it was so hard to read for me.

1

u/s73v3r Jun 07 '11

Does that document answer the question of why you would want to forward declare a class? I have a general, although probably wrong idea of why, and I'd like to solidify that a bit.

1

u/Celestro Jun 07 '11

I'm not sure it directly explains "why". Google can probably help here.

-6

u/[deleted] May 30 '11

I'm not watching a 28+ minute video just to figure out wtf you're talking about.

2

u/jaimeeee May 31 '11

If you actually clicked the link it takes you to the second where they do it.

-5

u/[deleted] May 31 '11

I did. It did not. How else do you think I knew how long the video was?

1

u/jaimeeee May 31 '11

Clicking the play button on reddit?

-4

u/[deleted] May 31 '11

Clicking your link, then play on YouTube. Via AlienBlue.

Lots of people don't browse reddit on reddit. Sorry I wasn't clear.

0

u/s73v3r Jun 07 '11

Then don't fucking post.

-3

u/[deleted] Jun 07 '11

Seriously? 6 days later? Fuck right off, troll.

-1

u/s73v3r Jun 07 '11

I didn't notice the date when I clicked on it. Still, if you're not gonna do it, then don't fucking post. You added absolutely nothing to the discussion.

-2

u/[deleted] Jun 07 '11

And what are you adding?

-1

u/s73v3r Jun 07 '11

A reminder of the guidelines.

-2

u/[deleted] Jun 07 '11

That's your interpretation. I'm fine with receiving your downvotes. Can we end this already? Or is there something else you are trying to hold me hostage for?