Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

spaz926

macrumors newbie
Original poster
May 2, 2010
9
0
Hello, I'm new to Objective-C programming, and I'm looking for a way to code equations, fast and easy. If somebody could explain how to do this, that would be great.
This is what I need help on:

User inputs integers, and program takes the integers and does an equation out of it. Formulas, geometric and algebraic.

Thank you in advance.
 
Look up the math.h functions. There are many (hyperbolic cotangent, etc.), all in C. If you want Objective C wrappers for these, you may have to write your own.

And user input from the UI is usually in the form of NSStrings. You'll have to use one of several methods (string utility, scanner, etc.), depending on your needs (unicode input, error checking, international currency/date formats, etc.), to convert the input into an integers.
 
If you want a "fast and easy" way to do equations, why even bother with Objective-C? Use a scripting language like TCL/Tk or Python.

TCL and Python don't seem to be allowed, according to the iPhone developer agreement.

You can, however, send the entire calculation, in string form, to be computed using Javascript (wrapped in a UIWebView) on an iPhone, legally.
 
TCL and Python don't seem to be allowed, according to the iPhone developer agreement.

You can, however, send the entire calculation, in string form, to be computed using Javascript (wrapped in a UIWebView) on an iPhone, legally.

The OP doesn't mention anything about an iP* app. Unless they are planning to make an app, this should be in Mac Programming anyways. If they are planning to make an app, there is no "fast and easy" way to achieve what they want.
 
...except for posting their question in the iPhone/iPad Programming forum.

People post in the wrong forum all the time. In fact, I believe this was originally in the Mac Programming forum to begin with before it got moved.

Edit: Furthermore, how do you plan on getting this on an iPhone/iPad in a usable format without an interface and everything else you'd need to get it working? If it's just equations they want there are numerous apps that already do this.

The OP would do well to make some major clarifications on what exactly he/she is envisioning.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.