Jump to content

Need help with iPhone/iTouch App


1 post in this topic

Recommended Posts

I am quite new to programming all together but have a good grasp on C++, I recently made a Guess My Number game in C++ and I am now trying to create a Guess my Number Game for iPhone and iPod Touch, mainly due to the hard times we are facing financially since my Dad passed away and I want to help my Mum with something that I can be proud of and I know my Dad would be.

 

However I have hit a big problem. I have made a View Based App and have created the look in IB and written the classes over, however the main.m is being a pain and not recognizing any Subclasses I type in even after importing the MyView.h file, this is a problem as what I think may work will not work because it doesn't like me :). Here are the two files codes:

 

Main.m:

 

 

//
//  main.m
//  Guess My Number 1.2
//
//  Created by James Lee on 07/08/2008.
//  Copyright __MyCompanyName__ 2008. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "MyView.h"

int main(int argc, char *argv[]) {


int tries;
tries = 0;
int Thisnumber;
srand((0));
Thisnumber = random() % 100 + 1;





NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}

 

and the MyView.h:

 

 

#import <UIKit/UIKit.h>
#import <Foundation/Foundation.h>

@interface MyView : UIView {
IBOutlet UILabel *answerLabel;
IBOutlet UITextField *guessText;
IBOutlet UILabel *triesLabel;
NSString *GuessTextString;
}

- (IBAction)Guessbutton;

@end

 

Please help

Link to comment
Share on other sites

 Share

×
×
  • Create New...