I am working on iPhone application. And I want to create popover controller for my app. It is only available for iPad applications. Please help.
You can do it, i have live app with with popover in iPhone. Just You have to create interface for popover
NSObject+UIPopover_Iphone.h
#import <Foundation/Foundation.h>
@interface UIPopoverController (overrides)
+(BOOL)_popoversDisabled;
@end
NSObject+UIPopover_Iphone.m
#import "NSObject+UIPopover_Iphone.h"
@implementation UIPopoverController (overrides)
+(BOOL)_popoversDisabled
{
return NO;
}
@end
and now just import NSObject+UIPopover_Iphone.h in your Viewcontroller.h
for Reference check this Link
As stated in Apple's Documentation
Popover controllers are for use exclusively on iPad devices.
So there is no way to use this class in iPhone application unfortunately. But there are a couple of custom third-party implementations of the functionality provided by UIPopoverController which add iPhone support and more.
You can check this Link for example.
You can try to use open source framework for it for example https://github.com/werner77/WEPopover
来源:https://stackoverflow.com/questions/18205903/popover-controller-for-iphone