2014-09-02 44 views
0

我有以下問題:我有一個ViewController與UIScrollView和UICollectionView在其中。當我在此View Controller中直接啓動應用程序時,一切正常。當我打電話的ViewController,從另一個視圖控制器(這裏是一個谷歌地圖SDK地圖),在視圖控制器的負載,但是當我嘗試滾動我得到這個消息,並且應用程序停止:執行Segue後事情不起作用

*** -[TheSecondViewController respondsToSelector:]: message sent to deallocated instance 0x16ef3890 

下面是一些更多的代碼: 調用視圖:

-(void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker { 

    [self performSegueWithIdentifier:@"OpenSecondView" sender:self]; 

} 

viewDidLoad中的secondView:

- (void)viewDidLoad 
{ 
    [super viewDidLoad]; 

    // Do any additional setup after loading the view. 

    if (IS_IPHONE5) { 

     self.scrollV.frame = CGRectMake(0, 0, 320, 568); 
     NSLog(@"Das Geraet ist ein iPhone 5/iPhone 5S"); 

    } else { 

     self.scrollV.frame = CGRectMake(0, 0, 320, 480); 
     NSLog(@"Das Geraet ist ein iPhone 4/iPhone 4S"); 

    } 

    [self.view bringSubviewToFront:scrollV]; 

    [scrollV setScrollEnabled:YES]; 
    [scrollV setDelegate:self]; 
    [scrollV setContentSize:CGSizeMake(320, 833)]; 
    [collectionV setScrollEnabled:NO]; 

    activityInd.activityIndicatorViewStyle = UIActivityIndicatorViewStyleWhite; 

    [activityInd startAnimating]; 

    [imageView setUserInteractionEnabled:YES]; 

} 
+2

請提供一些更多詳細信息和源代碼 – 2014-09-02 11:31:06

+0

提供SecondViewController的viewDidLoad的一些源代碼 – 2014-09-02 12:04:04

+0

看起來你的一些屬性缺少強有力的參考。請張貼更多信息。 – anoop4real 2014-09-02 12:05:11

回答

1

知道你剛纔加載的secondViewController,它看起來LIK e您的secondViewController沒有正確分配(而不是被解除分配)。嘗試使用在故事板中創建的段落,並使用代碼調用這些段落,和/或使用強而不是對視圖的弱引用

+0

執行的Segue是一個故事板Segue ... – Jannes 2014-09-02 11:43:21

+0

我現在解決了這個問題。我改變了一些屬性並刪除了模擬器數據。現在它工作... – Jannes 2014-09-03 09:26:33