Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ContentScrollView会自动调用 #3

Open
manmanfei opened this issue May 12, 2014 · 3 comments
Open

ContentScrollView会自动调用 #3

manmanfei opened this issue May 12, 2014 · 3 comments

Comments

@manmanfei
Copy link

我分别在- (UIScrollView *)contentScrollView和- (void)viewDidLoad方法上打断点,
程序启动后首先进入的是- (UIScrollView *)contentScrollView{...}。
由于viewDidLoad里会调用contentScrollView方法
也就是说contentScrollView方法调用了两次,所以bug被屏蔽之。

问题发现是:
我继承了NSSlidingViewController类,发现在我的继承类初始化的时候,
会先进入了- (UIScrollView *)contentScrollView
导致在[self.titles count]的输出为0
scrollview的contentsize始终是320
很莫名其妙

结果我把contentScrollView的方法名字改了一下,加了3个字母,改成addContentScrollView
就正常了!

已疯,求解释。

@nonstriater
Copy link
Owner

恩,确实存在这个问题,我研究下:)

@nonstriater
Copy link
Owner

我bt打印了下调用堆栈,第一次停在contentScrollView时候,前一帧是[UIViewController setView], 难道是命名冲突,除了这个我想不出其他原因了

@manmanfei
Copy link
Author

恩,我也这么觉得。因为改下名字就正常了,只能说明contentScrollView这名字不合法呗

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants