I am currently in complete frustration as I cannot find any errors, but my ActionSheet crashes on the iPad but works well on the iPhone, here is the action code
if (view.annotation.title as String!) == "San Francisco" { currentLat = 37.615223 currentLong = -122.389977 url = "www.google.de" let action:UIActionSheet = UIActionSheet(title: "Change Map Type", delegate: self, cancelButtonTitle: "Back", destructiveButtonTitle: nil, otherButtonTitles: "Product Page", "Video") action.showInView(self.view) action.tag = 0 VideoID = "XXXXXX" }
So the action that needs to be processed is
if actionSheet.tag == 0{ if buttonIndex == 1{ performSegueWithIdentifier("showShop", sender: self) } if buttonIndex == 2{ UIApplication.sharedApplication().openURL(NSURL(string: "http://www.youtube.com/watch?v=\(youtubeVideoID)")) }
Youtube works fine on iPhone and iPad, showShop works fine on iPhone, but not on iPad
"showShop" go to my ViewControllerShopView, which looks like
import UIKit class ViewControllerShopView: UIViewController { @IBOutlet weak var activity3: UIActivityIndicatorView! @IBOutlet weak var webView: UIWebView! override func viewDidLoad() { super.viewDidLoad() loadurl() } override func didReceiveMemoryWarning() { super.didReceiveMemoryWarning() println("memory warning") } override func viewWillAppear(animated: Bool) { loadurl() } func loadurl(){ var loadingurl = "google.com" var homeurl = "google1.com" loadingurl = url let webviewURL = NSURL(string: loadingurl) let request = NSURLRequest(URL: webviewURL) webView.loadRequest(request) } @IBAction func Reload(sender: AnyObject) { var loadingurl = "google.com" var homeurl = "google1.com" loadingurl = url let webviewURL = NSURL(string: loadingurl) let request = NSURLRequest(URL: webviewURL) webView.loadRequest(request) } func webViewDidStartLoad(_ : UIWebView){activity3.startAnimating()} func webViewDidFinishLoad(_ : UIWebView){activity3.stopAnimating()} }
but Segue was never made on an iPad, it just crashes on Segue.
Can anyone understand what might be wrong?
swift ipad uiactionsheet
Fabian Boulegue Sep 25 '14 at 11:37 2014-09-25 11:37
source share