下面是调用代码:无法模拟调用applicationDidReceiveMemoryWarning:?
[[NSNotificationCenter defaultCenter] postNotificationName:UIApplicationDidReceiveMemoryWarningNotification
object:[UIApplication sharedApplication]];
它不能从UIApplicationDelegate
调用applicationDidReceiveMemoryWarning:
。
有什么问题吗?
是不是调用委托方法?我见过很多示例都使通知名称成为字符串,例如@“UIApplicationDidReceiveMemoryWarningNotification”。我怀疑这真的很重要,因为这个常数可能是一样的。 – raidfive 2011-03-16 13:43:02
即使更改为NSString,它也无法工作。 – Forrest 2011-03-17 03:42:48