No visible @interface for 'UIViewController' 这个错误是什么原因

nandy007
   2013-11-07 16:46:33发布  2016-12-16 15:52:01更新 0收藏, 9587浏览
ExMobi原生扩展
已关闭
0

/Users/nandy007/Desktop/iosapp/MyApp/MyApp/ViewController.m:29:12: No visible @interface for 'UIViewController' declares the selector 'didReceivMemoryWarning'

代码如下:


#import "ViewController.h"
//#import "HomeViewController.h"

@interface ViewController ()

@end

@implementation ViewController

@synthesize usernameTextField;
@synthesize passwordTextField;

- (void)viewDidLoad
{
    [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
}

- (void)didReceiveMemoryWarning
{
    [super didReceivMemoryWarning];
    // Dispose of any resources that can be recreated.
}


- (void) doLogin:(id)sender
{
    //NSLog(@"start login");
    [usernameTextField resignFirstResponder];
    [passwordTextField resignFirstResponder];
    
    if (usernameTextField.text.length==0||passwordTextField.text.length==0) {
        UIAlertView* dialog=[[UIAlertView alloc] initWithTitle:@"提示" message:@"您的用户名或者密码为空!" delegate:self cancelButtonTitle:@"确定"  otherButtonTitles:nil, nil];
        [dialog show];
    }else{
        //HomeViewController* viewController = [[HomeViewController alloc] initWithNibName:@"HomeViewController" bundle:[NSBundle mainBundle]];
        
        //[self.navigationController pushViewController:viewController animated:YES];
        
    
        
    }
}

@end

2个回答

0

是代码中的第22行报错

nandy007
    2013-11-07 16:47:56回答
0

竟然是是xcode编译器的问题,clean之后重新build就可以
:Q

nandy007
    2013-11-07 22:38:41回答

我要回答

下载APP
扫码下载栗子社区APP