Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Interface 2, Advanced iOS
Mockup & Code Gen
($9.99)

Make your own iPhone apps
and run them live!
(free)

Pic Frame Dynamo: Photo Editing
($0.99)

Abiliator
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 02-14-2010, 01:31 AM   #2 (permalink)
Oliver Drobnik
Dr. Touch Cocoa Helpdesk
iPhone Dev SDK Supporter
 
Join Date: Sep 2008
Location: Vienna, Austria
Posts: 537
Oliver Drobnik is on a distinguished road
Send a message via AIM to Oliver Drobnik Send a message via MSN to Oliver Drobnik Send a message via Skype™ to Oliver Drobnik
Default

Quote:
Originally Posted by @@rz View Post
I'm trying to sum the integers from five UITextFields and post them to a UILabel.

This is the code I have tried. It works to begin with, then it start to mess up! Sometimes it doesent work at all!! Really weird!

int val = [textfield1.text intValue]
val = val+[textfield2.text intValue];
val = val+[textfield3.text intValue];
val = val+[textfield4.text intValue];
val = val+[textfield5.text intValue];

NSString *labelStr = [[NSString alloc] initWithFormat:@"%i", val];

label.text = labelStr;[/b]

Something wrong with the code?? Alternatives maybe? Greatful for all answers!
No nothing wrong with the code. You have to be more precise in the description of your problem if you want help. "Starts to mess up"? How?
__________________
regards

Oliver Drobnik
Cocoanetics - Our DNA is programmed in Objective-C.

Linguan – makes localizing strings file fun!

Cocoanetics Parts Store – easy to use yet professionally looking components that you can use to spruce up your own apps. Augmented Reality, Calendar Control, Pin Lock or Purchase Button are only some examples. You get full source code, no static library crap, and lifetime support. Check it out today!
Oliver Drobnik is offline   Reply With Quote
 

» Advertisements
» Online Users: 734
17 members and 717 guests
7twenty7, BuzzingDanZei, chiataytuday, drckmchaels, erdinc27, Fahad.bhutta, falco1973, iAppDeveloper, iOS.Lover, MAMN84, MarkC, m_rozzi, QuantumDoja, Sophie100, t14hoangson, teebee74, tim0504
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,474
Threads: 94,040
Posts: 402,625
Top Poster: BrianSlick (7,978)
Welcome to our newest member, m_rozzi
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 03:10 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.