0
以下是我的東西....iPhone上KVO ..如何從viewWillAppear方法調用他觀察ValueForKeyPath方法?
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context {
if ([object isKindOfClass:[UIAccelerometer class]]) {
NSNumber *interfaceValue = [change objectForKey:NSKeyValueChangeNewKey];
UIInterfaceOrientation toInterfaceOrientation = [interfaceValueintValue];
//here is my code....
}
你有什麼問題? – jtbandes