You are viewing our Forum Archives. To view or take place in current topics click here.
New to Xcode, what am I doing wrong?
Posted:

New to Xcode, what am I doing wrong?Posted:

Invoker
  • TTG Contender
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 3,449
Reputation Power: 155
Status: Offline
Joined: Aug 19, 201013Year Member
Posts: 3,449
Reputation Power: 155
I am using Xcode and I want to create a simple calculator and I don't understand where I am going wrong with this:
    //Store value of "Sell Price"
    NSInteger *sellPrice = sellField.text;

All help appreciated!
#2. Posted:
XeLifestyle
  • Prospect
Status: Offline
Joined: Aug 29, 201211Year Member
Posts: 652
Reputation Power: 27
Status: Offline
Joined: Aug 29, 201211Year Member
Posts: 652
Reputation Power: 27
i don't know objective-c but it looks like you might be converting an int into a string. Is sellField a string or a textbox?(coming from a .net background) again i dont know objective-c, just trying to help
#3. Posted:
kpempire
  • Challenger
Status: Offline
Joined: Jan 20, 201410Year Member
Posts: 115
Reputation Power: 4
Status: Offline
Joined: Jan 20, 201410Year Member
Posts: 115
Reputation Power: 4
I don't know objective C, but from my .net knowledge I've came up with some sort of solution.


sellField.text = NSInteger * sellPrice
#4. Posted:
XeLifestyle
  • Prospect
Status: Offline
Joined: Aug 29, 201211Year Member
Posts: 652
Reputation Power: 27
Status: Offline
Joined: Aug 29, 201211Year Member
Posts: 652
Reputation Power: 27
kpempire wrote I don't know objective C, but from my .net knowledge I've came up with some sort of solution.


sellField.text = NSInteger * sellPrice

bro NSInteger is objective-c's way of declaring it as an int. and what you did is exactly what OP tried lol

there maybe a conversion process like in .net
[ Register or Signin to view external links. ]
the reason this is not sellField.text is because this is a console app
.....

I looked up how to convert a string to an int on objec-c and found this:
[ Register or Signin to view external links. ]
hope it helps
Jump to:
You are viewing our Forum Archives. To view or take place in current topics click here.