I’m fairly new to iOS programming, but have a basic understanding of it. I have been doing fine programming with Xcode 3, but now that Xcode 4.2 is out, things are much more difficult (with the changes in templates and all).
Now for my problem:
I am using single page application
In my ViewController.h I have this:
@interface ViewController : UIViewController
@property (weak, nonatomic) IBOutlet UITextField *Num1;
@property (weak, nonatomic) IBOutlet UITextField *Num2;
@property (weak, nonatomic) IBOutlet UILabel *answer;
- (IBAction)addNums:(id)sender;
In my ViewController.m I have this:
- (IBAction)addNums:(id)sender
{
int x = ([Num1.text floatValue]);
int y = ([Num2.text floatValue]);
int ans = x + y;
answer.text = @"%i", ans;
}
I have connected everything to files owner properly, but I keep getting this message saying, “Expression Result Unused.”
Again, I’m very sorry for my idiotic question, its just that i can’t find any tutorials for Xcode 4.2 online, and I can’t find any books on it.
Instead of your:
Do: