2010-04-01 116 views
0

不知道我是否可以正確解釋這一點,但我試圖執行方法設備定位動畫完成。現在我有[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(didRotate:) name:UIDeviceOrientationDidChangeNotification object:nil];,但立即觸發。視圖旋轉動畫完成後有沒有辦法讓它調用didRotateiPhone:UIDeviceOrientation變更完成後執行代碼

謝謝!

回答

0

在您的UIViewController子類中實現-didRotateFromInterfaceOrientation:。把-didRotate:的東西放在那裏,或者叫它。

+0

謝謝,那就像魅力一樣。所以真的沒有理由使用NSNotificationCenter方法,是嗎? – carloe 2010-04-01 19:38:05

+1

@carloe:這種方法不適合您的情況。 – kennytm 2010-04-01 19:39:34