0

My app has a need to implement a map in two seperate UIViewController's, the problem is that once one of the maps has been rendered, trying to open the second causes a EXC_BAD_ACCESS error that shows at the declaration of AppDelegate, I have tried using Zombies and it shows nothing, tried Analyzing, again shows nothing, I have tried presenting the maps in a variety of ways, Including: programatically presentViewController(), as well as having a mapkit in each .storyboard and using containerViews that embed a map.storyboard which only contains a mapkit.

typing bt in the console gives me this:

libglInterpose.dylib`EAGLContext_renderbufferStorageFromDrawable(EAGLContext*, objc_selector*, unsigned int, id) + 204, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=EXC_ARM_DA_ALIGN, address=0x69725659)

Im using Xcode7-Beta5 and Swift, any help other possible debug methods, or some way to manage the maps more efficiently, would be greatly appreciated.

MapViewController.swift (Doesn't do anything yet, since i can't get them to both render)

import UIKit
import MapKit

class MapViewController: UIViewController {

    @IBOutlet weak var mapView: MKMapView!


    override func viewDidLoad() {
        super.viewDidLoad()

    }

    override func viewDidDisappear(animated: Bool) {
        super.viewDidDisappear(animated)

    }

    override func didReceiveMemoryWarning() {
        super.didReceiveMemoryWarning()

    }

}

EDIT:

ok, so the hierarchy goes somewhat like this:

I have a UITabBarController, one of the tabs is a map, from another tab there is a view hierarchy that eventually leads to a button that presents another map.

I was able to get both maps rendering by placing my instance of Map.storyboard within my TabBarController subclass, then using UIContainerViews on both my UIViewControllers that should have the map and adding a child ViewController (map from TabBarController) and its view to the ViewContainer

justin shores
  • 687
  • 7
  • 24
  • Can you post some code with that? – sloik Sep 04 '15 at 18:52
  • @sloik Posted the code for the MapViewController, but it doesnt do anything yet, I'm not able to get the two seperate maps rendering – justin shores Sep 04 '15 at 19:07
  • I have just built a test application using the above code and a storyboard using Xcode 7 Beta 6. I have a navigation controller as the root controller and a segue between two different view controllers with maps on. Maybe try updating your local Xcode to Beta 6 to see if that fixes it? – John Wordsworth Sep 04 '15 at 19:44
  • thanks @JohnWordsworth ill grab it right now and see what happens – justin shores Sep 04 '15 at 19:45
  • @JohnWordsworth unfortunately updating to xcode7-beta6 did not resolve the issue – justin shores Sep 04 '15 at 20:30
  • Hmmm, then I'm afraid we might need more steps / clearer information about your setup to reproduce. I have setup an app with the following Storyboard and the same MapViewController you provided above and it works fine on iOS and the Simulator. Is your case any different to this? https://drive.google.com/open?id=0B2rfBgD3wC3_RjVrb1M4cjBGVGs – John Wordsworth Sep 04 '15 at 20:41
  • Is mapView connected on both controllers? If instead of using `@IBOutlet weak var mapView: MKMapView!` you use `var mapView = MKMapView()`. Do the crashes still happen? – Murillo Sep 04 '15 at 23:07
  • @JohnWordsworth my case is a bit different, i have a tabbar, 1 of the tabs is a map, and another tab presents a UIImagepicker, then an "UploadVC" which has a button to present another map – justin shores Sep 05 '15 at 14:21
  • ok, guys thanks for all your help! Ive made some progress, and edited my question – justin shores Sep 05 '15 at 18:59

0 Answers0