0
我已經實現了一個自定義的故事板segue,它在iOS 6下工作正常,但在iOS 5.1下的模擬器中沒有任何反應。 問題是popoverController在iOS 5.1下始終爲零?自定義UIStoryboardPopoverSegue不會在iOS 5.1下工作
@implementation PopoverFromRectSegue
-(id)initWithIdentifier:(NSString *)identifier
source:(UIViewController *)source
destination:(UIViewController *)destination {
if(self = [super initWithIdentifier:identifier
source:source
destination:destination]) {
}
return self;
}
- (void)perform {
UIPopoverController *popCtrl = ((UIStoryboardPopoverSegue *)self).popoverController;
id controller = [self sourceViewController];
if ([controller isKindOfClass:[UIViewController class]] && [controller respondsToSelector:@selector(popoverRect)]) {
[popCtrl presentPopoverFromRect:[[controller performSelector:@selector(popoverRect)] CGRectValue] inView:[controller view] permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
}
}
@end
任何幫助/提示表示讚賞。
編輯: 剛做了一個新的示例項目。看起來在iOS5.1下,popoverController沒有爲自定義UIStoryBoardSegues設置爲 。 我還能做什麼。 正常的彈出窗口需要一個錨點,但原型tableView單元格不被接受(編譯期間失敗),我無法找到修改彈出窗口顯示的矩形的方法。