HI there. Thank you very much for your nice tutorials. I am using xcode 4.2. So I am having problem with some codes. It is giving error when i put " NSautorelease" and when i want to put " -(int) age{ return age;
In my opinion we should put it outside the main function because main function is usually contain the output not the variable(i believe its call the "good style"). And also the method can be reuse which is helping you when you writing some large program.
@nineyardslong It's called encapsulation and good style. If you can just access it easily and do whatever you want with it, what if you accidentally do something stupid with the member? Technically, it is also bad to use unnecessary getters and setters. If you are writing a game involving people with age, instead of saying "setAge:n", you should use something like "increaseAge" which would then add 1 to its own age. This keeps control, stability, and happiness in third world countries.
@nineyardslong the advantage over the above with methods is the possibilities of more complex methods, say, a method for dog years, which would multiply your age by seven and return that.
@WideAngleDan The first methods we wrote were "setter" methods. This means that they set the value of the age and/or weight variables. A "getter" method will return the value of age and/or weight without changing the value. Bucky doesn't do a great job explaining data encapsulation here, and its sort of an advanced topic for this early on. As you become a more proficient programmer, you will see the need to "get" a variable, and "protect" the ability to "set" it to something else.
@TexasRable Bucky breaks things down to a level where programmers who know other languages can understand him, but a complete noob may be lost at times. Don't worry!
A variable is a piece of information stored in a computer. Like a number. There are different kinds of variables, or data-types. Returning a variable asks the computer to provide the information stored in the variable. For example, lets say we have an integer called X, and it equals 10. Returning X would give you the value 10.
That makes sense. Question? What if you wanted to make 1000 objects. You don't want to type 1000 times. How do you programmatically do make 1000 objects of same class?
@Bilal434 you would probably have to write a program to write out all those objects for you. or create a loop that creates random object names, but those objects would only be temperary, because they would only be created when the program runs. other wise you have to type it out.
@Shazcapade There's no need to release memory from bucky because it is the only object in the program. [pool drain] covers this sufficiently. If you had [bucky release]...
[bucky release]; (drains the memory from the object bucky, which is the only object in the program)
[pool drain]; (drains the memory you just drained)
Now I get it, the print outs for the previous videos are gotten from the implementation section.. While this is the main section.. It doesn't look that much confusing like the previous time I saw this vid lol...
this is my second programming language that i am learning i started in Visual Basic visual basic looks simple with a few confusing things here and there and learning visual basic before learning this makes learning Objective C easy there are very few differences just how to enter the language , methods, classes, constructors(you have not learned them yet i don't think in these) all the same just called slightly differently
I ma new to Objective C , tutor's from 1 to 8 are very helpful to me and I hope the same for other too.....!!!!Eagerly waiting for the next tutors....!! Thank u Bucky
Bucky man, I love all of your video's, they're super awesome.... but just wondering, could you PLEASE do another Java game development tutorial? Been refreshing EVERY day for like months and I'm forgetting what I've learned... :( Thanks!
thx for those.... suppose will have to get a mac now... he he he... but please if you have spare time continue the java tutorials :) thx man you are great
This is Objective C Programming for the Mac / iPhone. Bucky has finally seen sense and moved to the Mac :p so he is kindly sharing his knowledge with us and showing us how to code in xcode. Once we are comfortable with it I'm sure he will move on to the actual building of a Mac / iPhone application.
This has been flagged as spam show
For clarity, we can name the getter method as getAge and getWeight, so people don't confuse it with age and weight member variables.
azam3d 1 week ago
Comment removed
azam3d 1 week ago
here's a note: don't use objective c, it's nothing like the original c. If you want a programming language like C but uses oop, choose C++.
Taking1n1 1 month ago
@Taking1n1 this is for people who want to do iPhone / iPad development, so there's basically no choice. Thanks, Apple!
SuperAndrei82 1 month ago
@SuperAndrei82 really? iphone and ipad only use objective c? damn you apple why not let us use c++/c !?!?!
Taking1n1 1 month ago
@Taking1n1 you can use Dragonfire SDK if you want to use Windows and C++ to create iOS apps.
But it costs moneyz :( and I couldn't find a reliable "free" version.
S7347TH7 1 month ago in playlist Objective C Programming Tutorials
@S7347TH7 oh thx
Taking1n1 1 month ago
You forgot to release "bucky" ;)
ArtKosarev 2 months ago
I dont understand the return command
cuter2002 2 months ago
HI there. Thank you very much for your nice tutorials. I am using xcode 4.2. So I am having problem with some codes. It is giving error when i put " NSautorelease" and when i want to put " -(int) age{ return age;
}
Please check.
ginosbulevar 3 months ago in playlist Objective C Programming Tutorials
thank u
SEB8001 3 months ago in playlist More videos from thenewboston
oder:
Erstellt eine eigene get und set Methode in der set Methode kann man dann zb. Sachen wie eine Speicherverwaltung einbauen
-(void) setAge: (int) value
(
if(value != age)
(
[age release];
age = [value retain];
)
)
MusiumSw 3 months ago
@MusiumSw er kann kein deutsch glaub ich mal
TheWitzigSpritzig 3 months ago
Implementiert das Property in der Klasse @synthesize year; (Implementiert das Property und erstellt get und set Methode)
MusiumSw 3 months ago
OK das erst was ich sagen möchte: deine Tutorials sind echt super, mach weiter so!!!
für alle die sich fragen was es mit dem get & set auf sich hat:
get => schreibt einen Wert in eine Variable (dir. Namen = [PropertyName])
set => holt einen Wert aus einer Variable (idr. Name -0 set[PropertyName])
Und für die, welche es sauber haben wollen:
- Erstellt ein Property im Interface @property int age;
MusiumSw 3 months ago
@MusiumSw der ist englisch
TheWitzigSpritzig 3 months ago
Hey bucky i tried to gave them a name like [amit setAge: 23]; [amit setWeight: 300]; [amit setName: amit]; [amit print]; [amit release];
it return an number ...
xxx9888888888 6 months ago in playlist TheNewBoston - Objective C
@xxx9888888888 2011-08-27 22:11:46.989 tutorial[2443:707] I am 1131856 and my age is 23 years old and weight 300 pounds
2011-08-27 22:11:46.991 tutorial[2443:707] I am 0 and my age is 12 years old and weight 180 pounds
result
xxx9888888888 6 months ago in playlist TheNewBoston - Objective C
instead of creating the method to set age or get the age, can you not simply use the following in the main:
bucky.age=25;
bucky.weight=200;
NSLog(@"Bucky is %i and weighs %i",bucky.age,bucky.weight);
Is there any benefit to using methods over the above?
nineyardslong 6 months ago 3
@nineyardslong
In my opinion we should put it outside the main function because main function is usually contain the output not the variable(i believe its call the "good style"). And also the method can be reuse which is helping you when you writing some large program.
1ZePhiRum1 5 months ago
@nineyardslong It's called encapsulation and good style. If you can just access it easily and do whatever you want with it, what if you accidentally do something stupid with the member? Technically, it is also bad to use unnecessary getters and setters. If you are writing a game involving people with age, instead of saying "setAge:n", you should use something like "increaseAge" which would then add 1 to its own age. This keeps control, stability, and happiness in third world countries.
Mewigi 3 months ago
@nineyardslong the advantage over the above with methods is the possibilities of more complex methods, say, a method for dog years, which would multiply your age by seven and return that.
ImaTechGeek 1 day ago in playlist Objective C Programming Tutorials
so youre typing an age in main, so that it can be set in a method. so that a different method can get that number. and return it to main?
seems like a big circle
jkdorio 6 months ago
okay, i couldn't have been the only one who saw "switching to process 1337"
Mikesean45 6 months ago
I'm getting two errors and I dont know what to do :(
"Expected ] before drain"
and Array subscripts is not an integer. HELP!
revengestor 6 months ago
@revengestor make sure you put semicolons after statements
jpstyle17 6 months ago
@WideAngleDan The first methods we wrote were "setter" methods. This means that they set the value of the age and/or weight variables. A "getter" method will return the value of age and/or weight without changing the value. Bucky doesn't do a great job explaining data encapsulation here, and its sort of an advanced topic for this early on. As you become a more proficient programmer, you will see the need to "get" a variable, and "protect" the ability to "set" it to something else.
Spaeth1208 6 months ago
What about [bucky release]; ?
BoAnderson98 7 months ago
i just don't understand one thing...
what does "return a variable" means??
what is return???
TexasRable 7 months ago
@TexasRable Bucky breaks things down to a level where programmers who know other languages can understand him, but a complete noob may be lost at times. Don't worry!
A variable is a piece of information stored in a computer. Like a number. There are different kinds of variables, or data-types. Returning a variable asks the computer to provide the information stored in the variable. For example, lets say we have an integer called X, and it equals 10. Returning X would give you the value 10.
Spaeth1208 6 months ago
@Spaeth1208 thank you very much!!! and thanks for calling me noob... :D
TexasRable 6 months ago
nice ....Thx...
richardlipp21 7 months ago
@WideAngleDan Yep, aka an accessor method.
techexxpert 8 months ago
IM SO CONFUZZLED!!!!!
b112895 9 months ago 20
Comment removed
stoidipukeaw 2 months ago
Comment removed
stoidipukeaw 2 months ago
How do you spell gidder?
krish98sai 10 months ago
Hi Bucky GREAT JOB I m learning from you. I have a question though how do you put your face on the screen, while you re speaking ?
vivieroli 10 months ago
so basiclly its like pointers so we can give the age and weight to some other variable in the main right?
like
int a = [bucky weithh];
int b = [bucky age];
Tusharchutani 1 year ago
you could save so much time and work if you just set those vars as properties.
xdrdosx 1 year ago
Thanks for the tutorials--it is all starting to make sense for this Visual Basic .Net "hack" programmer! You do a great job!
marvchomer 1 year ago
how does the programme differentiate between accessing variables and looking for that return 0;.
if the variable happened to be 0, would the programme end?
thedeathskittle 1 year ago
That makes sense. Question? What if you wanted to make 1000 objects. You don't want to type 1000 times. How do you programmatically do make 1000 objects of same class?
Thanks for the tutorial.
Bilal434 1 year ago
@Bilal434 you would probably have to write a program to write out all those objects for you. or create a loop that creates random object names, but those objects would only be temperary, because they would only be created when the program runs. other wise you have to type it out.
sumosumo84 1 year ago
@Bilal434 You could make an Array of the Object.
cnsapam 1 year ago
@Bilal434
you need to use loops to run 1000 objects...
mainufo 1 year ago
You know, you people can always install Mac OSX (Hackintosh) On your computers... Thats what i did and its workin a treat :P
souleben 1 year ago
I am lost ... When i will get my mac first i will try it side by side so that i can also implement my knowledge and my classes are not confused :D
xxx9888888888 1 year ago
bucky did you learn all this from books?
TheRCortez 1 year ago
hey bucky i don't have MAC OS...
I've windows vista....
How can I learn this Objective-c
venkateshtambi 1 year ago
Is it ok thats I am totally lost?
MrSportsNerd 1 year ago 2
@MrSportsNerd
ummm ... me too LOL
WarshDev 1 year ago
4658 views :D
TheRCortez 1 year ago
Where did your face go? =(
DoctorCoxx 1 year ago 2
Btw why isnt there [bucky release]???
Shazcapade 1 year ago 2
@Shazcapade There's no need to release memory from bucky because it is the only object in the program. [pool drain] covers this sufficiently. If you had [bucky release]...
[bucky release]; (drains the memory from the object bucky, which is the only object in the program)
[pool drain]; (drains the memory you just drained)
so basically, it's redundant.
Pogert98 10 months ago
Now I get it, the print outs for the previous videos are gotten from the implementation section.. While this is the main section.. It doesn't look that much confusing like the previous time I saw this vid lol...
Shazcapade 1 year ago
Why would you want to do this in an application?
Chase993 1 year ago
this is all new to me... still fairly confusing but your vids are great keep it up
alec11592 1 year ago
Can someone clarify? Why is this different from the previous tutorial that uses the print method?
Shazcapade 1 year ago
oh man an other confusing one but again i got some of it down. I guess ill just rewatch it like ten more times lol...great job.
TheRCortez 1 year ago
this is my second programming language that i am learning i started in Visual Basic visual basic looks simple with a few confusing things here and there and learning visual basic before learning this makes learning Objective C easy there are very few differences just how to enter the language , methods, classes, constructors(you have not learned them yet i don't think in these) all the same just called slightly differently
Buddio28 1 year ago
When you type, stuff appear. How do we do that?
thx
cylurian 1 year ago
how can we switch from one cell to another cell...(1 to 2 to 3 views).In 1st View (displaying great names upto 10).
2nd view (displaying some text like quotation of his writing).
3rd view (displaying the briefly description)
ROHITHKUMARKADARI 1 year ago
I ma new to Objective C , tutor's from 1 to 8 are very helpful to me and I hope the same for other too.....!!!!Eagerly waiting for the next tutors....!! Thank u Bucky
ROHITHKUMARKADARI 1 year ago
Awesome! Can't wait for the next one =D.
linkfan22 1 year ago
i have a queedstion. what language would i need to learn to make flash games?
11wesley11 1 year ago
@11wesley11 actionscript
sacredgeometry 1 year ago
actionscript
TheHackersGambit 1 year ago
I'm with you there man. I want a mac soooo bad so I can start teaching myself Objective C. ANOTHER GREAT TUTORIAL BUCKY!!!
americanstripes3 1 year ago
This has been flagged as spam show
I can't edit vids from Camtasia
with Adobe Premiere Pro and After Effects
Did you know which codecs i should use?
Sorry about my english :p
niktutos 1 year ago
@niktutos You can edit videos in Camtasia.. Lol
But Premire pro is better for video editing, becouse After effect is for effects, like light sabers and stuffs
Fpsdown 1 year ago
i wish i had a mac now!!!!!! :p
cuber188 1 year ago
dude I love all that you're doing! Your tutorials lay down a basic foundation for me! Thanks keep it up!
ZxSkyLineKidxZ 1 year ago
In Obj-C, does @synthesize automate the process of creating the setter/getter methods?
4guns 1 year ago
bucky could you please tell me wich screen recorder you use on windows?
niktutos 1 year ago
@niktutos He is using Camtasia
Fpsdown 1 year ago
@Fpsdown I can't edit vids from Camtasia
with Adobe Premiere Pro and After Effects
Did you know which codecs i should use?
Sorry about my english :p
niktutos 1 year ago
@niktutos He's using CamTasia.
UneX100 1 year ago
camstudio
1deividas1 1 year ago
he uses camtasia i think
cuber188 1 year ago
Bucky man, I love all of your video's, they're super awesome.... but just wondering, could you PLEASE do another Java game development tutorial? Been refreshing EVERY day for like months and I'm forgetting what I've learned... :( Thanks!
Zombiedevice 1 year ago
oc8, xD
sheepkilier 1 year ago
good to see u spending so much of ur time for these tuts.
Good job and thanks
TheHackersGambit 1 year ago
thx for those.... suppose will have to get a mac now... he he he... but please if you have spare time continue the java tutorials :) thx man you are great
specimon 1 year ago
Comment removed
agentEE7 1 year ago
can someone please tell me, what this is? i mean what is this creating?
kingcontyz 1 year ago
This is Objective C Programming for the Mac / iPhone. Bucky has finally seen sense and moved to the Mac :p so he is kindly sharing his knowledge with us and showing us how to code in xcode. Once we are comfortable with it I'm sure he will move on to the actual building of a Mac / iPhone application.
TheTGDJ 1 year ago
would this also work for itouch?
agentEE7 1 year ago
@agentee7- Yes.
Maholain 1 year ago
It's working now bucky I can see it perfectly.
TheTGDJ 1 year ago