Great tut, got everything working but have a question if anyone can answer..
What's the relevance of the *newLabelText? I just set labelsText.text = titleOfButton and it seems to work fine? Why is the second string object needed?
ummmm bucky I realize this is old but when you make a property that's retained, doing self.labelsText = nil; automatically releases it. You dont have to do it again.
Here's what happens when you do self.labelsText = nil;
- (void)setLabelsText:(UILabel *)text // text is going to be nil, since you set it to nil if (labelsText != text) { // make sure it isnt the same thing [labelsText release]; // release old one labelsText = [text retain]; // retain new one }
When you are viewing only the source, it is hard to see what you are doing clicking off of the screen. i.e. what happens at 7:40 . You click a button and the sources change... I assume you are switching between the .h and the .m files, but it would be helpful if we could see this action, or at least you say what you are doing.
if you forget to "release" an object, after the app is quit, is that section of memory still held or does it automatically get cleared by iOS? Or would the computer be left with a section of memory that hasnt been cleared, told to hold on to so it will never go until reboot?
@bowersbros you find a "vmware mac" 10.52gb file on thepiratebay and you follow the instructions, OH and you have to have intel virtualization (and a capable processor)
This comment has received too many negative votes show
I PUT FIRST DISLIKE!! IM SO COOL
bobbysprogramming 2 months ago
@bobbysprogramming little kiddy
INeedAName101 2 months ago
@bobbysprogramming ...the only dislike, which makes you an idiot, a really idioticly idiotic idiot.
oscarsimpson70 1 month ago in playlist iPhone Development Tutorials 5
@oscarsimpson70 That guy is an Android dev.
ciphotzo 1 month ago
it is sometimes hard to follow with new version of xcode e.g. with arc there is no need to release memory. and also I cannot find viewDidUnload.
robertlam18 2 months ago
1 line of code instead of 4?
kristyan11 6 months ago
Could have just done labelsText.text = [sende titleFor........] why the 2 extra string variables?
kristyan11 6 months ago
@kristyan11 When introduced to programming, People doesn't tend to use OOP, because it might be too much for the learners. :-)
Ghostplusplusify 5 months ago
Buh'uhn
JJDinomiteLives 6 months ago
Great tut, got everything working but have a question if anyone can answer..
What's the relevance of the *newLabelText? I just set labelsText.text = titleOfButton and it seems to work fine? Why is the second string object needed?
Thanks
bretto17 6 months ago
Hey Bucky.. great tutorial.. I am a beginner and want to know this.. The method "titleforstate" is a method of which class??? UIButton???
Thx
richardlipp21 6 months ago
ummmm bucky I realize this is old but when you make a property that's retained, doing self.labelsText = nil; automatically releases it. You dont have to do it again.
Here's what happens when you do self.labelsText = nil;
- (void)setLabelsText:(UILabel *)text // text is going to be nil, since you set it to nil if (labelsText != text) { // make sure it isnt the same thing [labelsText release]; // release old one labelsText = [text retain]; // retain new one }
}
mrmittens12 6 months ago
Hi.. I have been watching some other tutorial and he uses a label from NStextfield ?? is this the same asUIiLabel? He is using xcode 4 if that helps?
Thx...also can you explain more on what UIKit is?? and UIV controller ??
richardlipp21 6 months ago
Hi.. I have been watching some other tutorial and he uses a label from NStextfield ?? is this the same asUIiLabel? He is using xcode 4 if that helps?
Thx...
richardlipp21 6 months ago
Top quality video n tutoring. Thanx mate.
Mrbradpitt 7 months ago
while creating NSString * titleOfButton why do you not have to alloc and init it?
iJatrat 7 months ago
@iJatrat he doesn't allocate it because this new NSString * titleOfButton indicate allocated value from sender.
ArcikBtW 7 months ago in playlist iphone developing
SOOO CONFUZING
paularu542 8 months ago in playlist iPhone Development Tutorials
you should be nice human being.. fantastic channel yours..
jbragadeesh 8 months ago
GREAT VID!
~~~Only issue with comprehension:
When you are viewing only the source, it is hard to see what you are doing clicking off of the screen. i.e. what happens at 7:40 . You click a button and the sources change... I assume you are switching between the .h and the .m files, but it would be helpful if we could see this action, or at least you say what you are doing.
~~~THANKS
xAphenx 9 months ago
just wondering y didn't u declare an UIButton in the interface builder???
dreaminging 10 months ago
OMG you wrote a code of more than 20 lines to show "blue" in a text label. In action script I would write this:
mybutton.onPress = function () {
myTextLabel = "Blue"
}
omg!!!
geekionizado 11 months ago
@geekionizado
herp-dee-derp
his script shows on screen whatever the name of the button is.
using your method, your button could be named "abc" and it would still print out "blue"
Sit down pls.
DividesByZer00 10 months ago
@DividesByZer00 in this case, my script would be:
mybutton.onPress = function () {
myTextLabel = mybutton.textfiel.text;
}
geekionizado 10 months ago
@geekionizado
correct, however, try to pay attention to detail.
it says "tutorial"
this is for beginners.
DividesByZer00 10 months ago
Thanks! I fully understand!
ScienceTutorials 11 months ago
question:
if you forget to "release" an object, after the app is quit, is that section of memory still held or does it automatically get cleared by iOS? Or would the computer be left with a section of memory that hasnt been cleared, told to hold on to so it will never go until reboot?
MrSkinnyBill 1 year ago
@MrSkinnyBill same thing dunno, go to his forum in the link
PieEatinSuicideGrunt 1 year ago
@MrSkinnyBill No. All of the memory used by an application is deallocated when an app quits.
rhillner 1 year ago
man, there is so much new syntax to memorise!
DomDozed 1 year ago
@hobolikespie11 wow I got like 2 and i recreated a new project 3 times. I'm so confused.
alanmjoseph 1 year ago
Hey bucky you could just do :
[labelsText setText: @"RED"];
and have two IBActions and do the other for blue and you are all set little bit easier!!
kingofmagic1 1 year ago
you rock
ddhankhar 1 year ago
@hobolikespie11 i got 4
brucegxyz 1 year ago
Comment removed
ZcoCorporation 1 year ago
I'm confused...
Do you think I'm confused because I didn't watch Other 30 Objective Tutorials?
Or not???
Please Answer!!!
ScienceTutorials 1 year ago
@ScienceTutorials Yup your meant to watch the other tuts before these ones.
ktayor1 1 year ago
@ScienceTutorials yeah that is the reason
Tusharchutani 1 year ago
Check you have alloc in lower case, as Bucky said. (Great tuts Bucky)
davejohnduke 1 year ago
This has been flagged as spam show
and check this out: pornos.
Cryostasix 1 year ago
Great stuff! Why don't you have to alloc and init titleOfButton? Thanks!
AnimalRobot 1 year ago
Comment removed
marvoloeRised 1 year ago
This has been flagged as spam show
@AnimalRobot yeah I would like to know that too.
marvoloeRised 1 year ago
oh great. You didn't use alloc and init for NSString in your objective c tutorials but now you're using them.
Shazcapade 1 year ago
i need a mac!!!
Dak552 1 year ago
@Dak552 or vmware :)
phildep893 1 year ago
@phildep893 how do i do it via vmware? :)
bowersbros 1 year ago
@bowersbros you find a "vmware mac" 10.52gb file on thepiratebay and you follow the instructions, OH and you have to have intel virtualization (and a capable processor)
phildep893 1 year ago
@phildep893 got a mac!
Dak552 1 year ago
what does (id) mean?
Techn0Junki3 1 year ago
@Techn0Junki3 watch his obj c tuts
TheHackersGambit 1 year ago
Bucky~~You are so cool!! Man
joec221006 1 year ago 3
You're a good teacher Bucky. Thnx again!
sylviatuur 1 year ago
Yep!
expertprogrammer 1 year ago
Nice tut
ySomic 1 year ago 2