Added: 1 year ago
From: AppleProgramming
Views: 2,473
Sort by time | Sort by thread (beta)

Link to this comment:

Share to:

All Comments (18)

Sign In or Sign Up now to post a comment!
  • good stuff, thanks

  • @findthebug You're welcome

  • So there always is a plain init method with every class. In Java I always had to define a constructor, even if it was empty.

  • @RMH1565 Ya, in Obj-C the init method is just a method used to initialize your instance variables. There are 2 tutorials later on in this series that go into more depth about how the initializers work.

  • Comment removed

  • Hi lucas, i am the guy talked to you on twitter; my question is: how can i send a variable across classes ? i mean: i have 2 classes, when a person touch on a button on classe2, the class1 receives a value ? pls send me a email to jilbapp@gmail.com and i ll send pictures and a better explain about my program. thx w8 for answer !

  • very easy to understand.

  • Comment removed

  • Hi Lucas,

    @Objective-C on the Mac L5 - Methods

    i am just trying to build the program in xcode 4 but the error: receive signal SIGBART is displayed in the main.m when the method is called through [rect setHeight:10]; and also [rect setWidth:5]; the machine says that instance method -setWidth is not found.... any ideas to cope with that??? Thx

  • @eenfach That would usually be because you didn't implement the method in your implementation (.m file). If you need more help feel free to message me via YT or G+.

  • you forgot to release your object...

  • @Deeharok We haven't covered memory management yet, look at 16-18 if you want :D

  • @iBig13 Send me a message on it later and I'll help you

  • i have got a question mate, i have also seen people doing :

    Rectangle *rect = [Rectangle new]

    could you please explain whats that

  • @elthechieftain Certainly, the [new] method is actually the exact same as [[alloc] init] (the new method literally calls [[alloc] init]). The [[alloc] init] mentality is that you allocate space for your object, then you initialize your instance variables (like our height and width) in the init method. You can even create other methods that can do different initializations. In summary, new has pretty much been abandoned, but is easy for beginners. I will be making a tutorial on this soon.

  • Thank You!

Loading...
Alert icon
0 / 00Unsaved Playlist Return to active list
    1. Your queue is empty. Add videos to your queue using this button:
      or sign in to load a different list.
    Loading...Loading...Saving...
    • Clear all videos from this list
    • Learn more