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 > iPhone SDK Development Forums > iPhone SDK Tutorials > Tutorial Requests

Reply
 
LinkBack Thread Tools Display Modes
Old 02-08-2011, 12:11 PM   #1 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 26
tobban2 is on a distinguished road
Default Simple BMI calculator?

Hello! Guess it's simple for some of you, but I would appreciate a simple BMI calculator. Just a view with an info-button and two fields, one for length and one for weight. Then a label that will be updated when a button is pressed. Simple for those who know how to do it. Hard for everyone else!
tobban2 is offline   Reply With Quote
Old 02-08-2011, 12:16 PM   #2 (permalink)
Beast Mode
 
Join Date: Dec 2008
Age: 21
Posts: 1,971
Bertrand21 is on a distinguished road
Default

Quote:
Originally Posted by tobban2 View Post
Hello! Guess it's simple for some of you, but I would appreciate a simple BMI calculator. Just a view with an info-button and two fields, one for length and one for weight. Then a label that will be updated when a button is pressed. Simple for those who know how to do it. Hard for everyone else!
Dude, you can make this using other tutorials. Just piece them all together. Or just learn iOS development instead of using "tutorials" to put out crap apps.
__________________
Haters gonna Hate
Likers gonna Like
Bertrand21 is offline   Reply With Quote
Old 02-08-2011, 12:22 PM   #3 (permalink)
Registered Member
 
Join Date: Apr 2010
Posts: 651
kapps11 is on a distinguished road
Default

this sounds a lot like another "can you write my app for free?" type post to me. Like bertrand said, you can learn everything you would need for this app in other, very basic tutorials
kapps11 is offline   Reply With Quote
Old 02-08-2011, 12:23 PM   #4 (permalink)
Registered Member
 
Join Date: Aug 2010
Posts: 26
tobban2 is on a distinguished road
Default

Quote:
Originally Posted by Bertrand21 View Post
Dude, you can make this using other tutorials. Just piece them all together. Or just learn iOS development instead of using "tutorials" to put out crap apps.
The thing is that I've got my BMI calculator up and running. But I won't learn if i'm doing it right if I can't check somehow how it should be done. And it's not for AppStore

edit: Hang on and I'll come with my source code soon

fifth try now:

Code:
MainViewController.h
IBOutlet UILabel *bmiLabel;
IBOutlet UITextField *length;
IBOutlet UITextField *weight;
-(IBAction)countBMI;
Code:
MainViewController.m
int bmiInt = 0;

-(IBAction)countBMI{
double weightInt = [weight.text doubleValue];
double lengthInt = [length.text doubleValue];
bmiInt = weightInt/(lengthInt*lengthInt);
NSString *bmi = [NSString stringWithFormat:@"%d", bmiInt];
bmiLabel.text = bmi;
}
edit: how to use double? if I set bmiInt to a double I got wrong data to bmiLabel. (just change %d to %f, right?) - What if i want to round it to .5? like 3.2 = 3.0, 3.3 = 3.5? Trying some with @"%f", (round)bmiInt];

Last edited by tobban2; 02-08-2011 at 04:27 PM.
tobban2 is offline   Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



» Advertisements
» Online Users: 438
18 members and 420 guests
baja_yu, cgokey, dcool, Droverson, iAppDeveloper, ipodphone, karatebasker, laureix68, LunarMoon, PapaSmurf, patapple, Paul Slocum, peterwilli, pipposanta, Rudy, SLIC, Sloshmonster, SuperDietGenius
Most users ever online was 1,387, 04-10-2012 at 04:21 AM.
» Stats
Members: 175,696
Threads: 94,139
Posts: 402,961
Top Poster: BrianSlick (7,990)
Welcome to our newest member, jasper_muc
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 02:09 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0