【发布时间】:2014-09-02 20:15:56
【问题描述】:
我有以下问题:我有一个带有 UIScrollView 和 UICollectionView 的 ViewController。当我直接在此视图控制器上启动应用程序时,一切正常。当我从另一个 ViewController(这里是 Google Maps SDK 地图)调用 ViewController 时,会加载 ViewController,但是当我尝试滚动时,会收到此消息,并且应用会停止:
*** -[TheSecondViewController respondsToSelector:]: message sent to deallocated instance 0x16ef3890
这里还有一些代码: 调用视图:
-(void)mapView:(GMSMapView *)mapView didTapInfoWindowOfMarker:(GMSMarker *)marker {
[self performSegueWithIdentifier:@"OpenSecondView" sender:self];
}
第二个视图中的viewDidLoad:
- (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];
}
【问题讨论】:
-
请提供更多细节和源代码
-
从SecondViewController的viewDidLoad中提供一些源码
-
您的某些属性似乎缺少强参考。请发布更多信息。
-
我将两个属性从弱改为强。现在我得到一个 EXC_BREAKPOINT...
-
也许您可以添加该代码以查看发生了什么。
标签: ios objective-c iphone uiscrollview