开发者

Red underline that I cant figure out how to fix

I'm brand new to iPhone programming. I've tried some tutorials and such and now I'm trying to do a simple project to get my feet wet. And of course I have having issues getting it to do what I want. I started it by using a Navigation project. I didn't want the UITableView though I just want normal buttons that lead to the next page. Although when I tried to get rid of the UITableView I think I did it wrong so now it isn't working when I am setting up the next view.

Here is the .h (the red underline is under the MPHViewController in both places) O开发者_如何转开发h and what it wants to do is make both those UIViewController.

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

@interface RootViewController : UIViewController {
    MPHViewController *mphViewController;
}

@property(nonatomic,retain) MPHViewController *mphViewController;
@end

I'm thinking where I mainly messed up was in the .m (I think) I took out all the code that had to do with the UITableView and simply put this in (wasn't sure what else should be placed there).

- (UIViewController *)viewControl:(UIView *)view 
{

}

Sorry for being a pain I just don't know any better way of learning how to do this other then just trial and error.


It might not be able to find the definition for your custom class.

In xcode under the project setting -> build phases, make sure the MPHViewController.m is included in the list of source files to be compiled.


Also, make sure in your MPHViewController.h that your subclassing UIViewController properly:

@interface MPHViewController : UIViewController
{
    // ....
}


Make sure you synthesize it in the .m

@synthesize mphViewController;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜