简体   繁体   English

Objective-C-延迟打开视图iOS 7.1

[英]Objective-C - Delay open view iOS 7.1

I have a map with markers (GoogleMaps framework 1.8.1 - iPhone 4S - iOS 7.1). 我有一个带有标记的地图(GoogleMaps框架1.8.1-iPhone 4S-iOS 7.1)。 Every time I click on a marker I need to show to another screen. 每次单击一个标记时,都需要显示到另一个屏幕。

The problem is that it has a delay 2-3 seconds on any screen that is connected to this view with map. 问题是它在与地图连接到此视图的任何屏幕上都有2-3秒的延迟。 In some instances the delay reaches 20 to 30 seconds. 在某些情况下,延迟会达到20到30秒。

Code creation map: 代码创建图:

camera = [GMSCameraPosition cameraWithLatitude: locationManager.location.coordinate.latitude
                                     longitude: locationManager.location.coordinate.longitude
                                          zoom: 14];
map = [GMSMapView mapWithFrame: CGRectMake(0,
                                           0,
                                           self.view.frame.size.width,
                                           self.view.frame.size.height)
                                           camera: camera];

Code didTapMarker : 代码didTapMarker

[self performSegueWithIdentifier: @"EntityDetail" sender: self];
return YES;

PS: This not only happens at the click of the markers. PS:这不仅发生在单击标记处。 Happens on any screen that is connected to this with the map. 发生在与地图关联的任何屏幕上。

Code viewDidLoad view controller segue: 代码viewDidLoad视图控制器segue:

NSString * titleString =[NSString stringWithFormat: @"Title Here"];
    if (titleString.length > 15) {
        self.title = [titleString substringWithRange:NSMakeRange(0, 15)];
    }else{
        self.title = titleString;
    }

Even though it only takes a screen this big delay. 即使只需要一个屏幕,延迟也很大。

After much research and implementation found what was causing. 经过大量研究和实施,找到了造成问题的原因。

Solution: 解:

When we add the Google Maps framework to our project it creates a reference to framework automatically in Build Settings on Framework search paths . 当我们将Google Maps框架添加到我们的项目时,它会在 框架”搜索路径上的“ 构建设置”中自动创建对框架的引用。 When we exclude the framework he does not remove automatically this reference. 当我们排除框架时,他不会自动删除此引用。

Turns out I came across references the old version of the framework that was using. 原来,我遇到了引用所使用的框架的旧版本 I removed this reference and it worked perfectly. 删除了参考 ,它运行良好。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM