@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.
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 !
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+.
@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.
good stuff, thanks
findthebug 13 hours ago
@findthebug You're welcome
AppleProgramming 13 hours ago
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 1 week ago
@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.
AppleProgramming 1 week ago
Comment removed
RMH1565 1 week ago
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 !
jilbapp 1 month ago
very easy to understand.
vinodkalpaka 1 month ago
This has been flagged as spam show
Thanks for the nice tutorial, keey making some other sweet videos ;)
hichamnaruto10 5 months ago
Comment removed
hichamnaruto10 5 months ago
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 6 months ago
@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+.
AppleProgramming 6 months ago
you forgot to release your object...
Deeharok 6 months ago
@Deeharok We haven't covered memory management yet, look at 16-18 if you want :D
AppleProgramming 6 months ago
@iBig13 Send me a message on it later and I'll help you
AppleProgramming 10 months ago
i have got a question mate, i have also seen people doing :
Rectangle *rect = [Rectangle new]
could you please explain whats that
elthechieftain 1 year ago
@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.
AppleProgramming 1 year ago
Thank You!
TechPopCorn 1 year ago