Could somebody please help!!?!?!?!?!
I posted in another thread and made the revisions accordingly (see below).
This is really starting to frustrate me. I implemented what they told me but nothing is actually showing up when I run it on the Simulator. Could you please tell me what exactly I need to add (and how) to Interface Builder so it will display the equation. I've tried label but when I Control-Drag from File's Owner to the label to connect the code to the label, nothing happens when I run it. I must be missing something.
Below is my .h file:
Code:
#import <UIKit/UIKit.h>
@interface AddTapViewController : UIViewController {
NSString *mathQuestion;
NSString *randomA;
NSString *randomB;
IBOutlet UILabel *label;
}
@property (nonatomic, retain) NSString *mathQuestion;
@property (nonatomic, retain) NSString *randomA;
@property (nonatomic, retain) NSString *randomB;
@property (nonatomic, retain) UILabel *label;
- (void)randomEquation;
@end
Below is my .m file:
Code:
#import "AddTapViewController.h"
@implementation AddTapViewController
@synthesize mathQuestion;
@synthesize randomA;
@synthesize randomB;
@synthesize label;
- (void)randomEquation
{
randomA = arc4random() % 6;
randomB = arc4random() % 6;
mathQuestion = [NSString stringWithFormat: @"%d + %d", randomA, randomB];
}
// Override to allow orientations other than the default portrait orientation.
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
// Return YES for supported orientations
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
// Release anything that's not essential, such as cached data
}
- (void)dealloc {
[super dealloc];
[mathQuestion release];
}
@end
I could really use some help. Thank you to everybody that has helped so far.