SubViewTwoController undeclared (first use in this function) (obj-c)
Posted
by benny
on Stack Overflow
See other posts from Stack Overflow
or by benny
Published on 2009-09-04T18:44:59Z
Indexed on
2010/04/22
21:53 UTC
Read the original article
Hit count: 368
Ahoy hoy everyone :)
Here is a list of links. You will need it when reading the post.
I am a newbie to Objective-C and try to learn it for iPhone-App-Development. I used the tutorial linked in the link list to create a standard app with a simple basic Navigation. This app contains a "RootView" that is displayed at startup. The startup screen itself contains three elements wich all link to SubViewOne. I have got it to work this far. So what i want to change is to make the second element link to SubViewTwo.
When i "Build and Go" it, i get the following errors:
RootViewController.m:
SubViewTwoController *subViewTwoController = [[SubViewTwoController alloc] init];
// SubViewTwoController undeclared (first use in this function)
and in SubViewTwoController.m
[super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview
no superclass declared in @interface for ´SubViewTwoController´
and the same thing after
- (void)dealloc {
[super dealloc];
I think you will also need the header files, so here they are!
RootViewController.h
#import <UIKit/UIKit.h>
@interface RootViewController : UITableViewController {
IBOutlet NSMutableArray *views;
}
@property (nonatomic, retain) IBOutlet NSMutableArray *views;
@end
SubViewOneController.h
#import <UIKit/UIKit.h>
@interface SubViewOneController : UIViewController {
IBOutlet UILabel *label;
IBOutlet UIButton *button;
}
@property (retain,nonatomic) IBOutlet UILabel *label;
@property (retain,nonatomic) IBOutlet UIButton *button;
- (IBAction) OnButtonClick:(id) sender;
@end
and SubViewTwoController.h
#import <UIKit/UIKit.h>
@interface SubViewTwo : UIViewController {
IBOutlet NSMutableArray *views;
}
@end
I would be really great if you would leave your ideas with a short explanation. Thanks a lot in advance!
benny
© Stack Overflow or respective owner