使用未声明的标识符'didReceiveMemoryWarning'

时间:2016-10-23 15:03:58

标签: ios

ViewController.m:

- (void) didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

AppDelegate.m:

- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application {
    /*
     Free up as much memory as possible by purging chached data objects that can be recreated(or reloaded from disk) later.
     */
}

我在XCode 8.0中进行编程,并且不知道为什么会出现此错误。

1 个答案:

答案 0 :(得分:1)

解决。我刚刚执行了一个糟糕的括号。代码是对的!不管怎样,谢谢!