Ios ipad UIAlertController crashes

  • content
  • comment
  • relevant

// Judge whether the runtime class is ipad , if yes, return true , otherwise return false

+( BOOL )IsIpad

{

    if ([[ UIDevice currentDevice ] userInterfaceIdiom ] == UIUserInterfaceIdiomPad )

    {

        return TRUE ;

    }

    return FALSE ;

}

Add the following code before popping

    if ([ utils IsIpad ])

    {

        [alert. popoverPresentationController setSourceView : self . view ];

        [alert. popoverPresentationController setSourceRect : CGRectMake ( self . view . bounds . size . width / two , self . view . bounds . size . height / two , one , one )];

    }

comment

two Comments
  1.  Gravatar

    voidcat reply

    backups
    #
    # Possible values for the Options directive are "None", "All",
    # or any combination of:
    # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
    # Note that "MultiViews" must be named *explicitly* --- "Options All"
    # doesn't give it to you.
    #
    # The Options directive is both complicated and important. Please see
    # http://httpd.apache.org/docs/2.4/mod/core.html#options
    # for more information.
    #
    Options FollowSymLinks Multiviews
    MultiviewsMatch Any

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    # AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride None

    #
    # Controls who can get stuff from this server.
    #
    Require all granted

Post reply

Your email address will not be disclosed. Required items have been used * tagging