I was able to run one UIScrollview in my app,my goal is to run two UIScrollview in one view. How will I able to put two UIScrollview instances into my nib file and bind both of their datasources/delegates to the view controller as normal?
Asked
Active
Viewed 236 times
-3
-
@vikingosegundo hi sir? do you need to see my whole code? I tried adding another UIView. then connecting it again with the same delegate and datasource, but it doesn't appear. – Bazinga Apr 25 '12 at 09:03
-
1aroth gave you all the information, you need. if you can't handle it, you should start with some beginner courses. a collection of resources: http://stackoverflow.com/questions/4539990/ios-sdk-first-advice-for-beginners/4540136#4540136 – vikingosegundo Apr 25 '12 at 09:08
2 Answers
1
Did you try to do that? What problems occured then? You just add them to you xib and everyting works. In your delegate calss you just inspect what exact scrollview
did call this and do the things accordingly.

Nikita Pestrov
- 5,876
- 4
- 31
- 66
-
Nothing appears. Even my other UIScrollView was gone. Do I have to make another class(.m and .h file) to assign it with? – Bazinga Apr 25 '12 at 08:57
-
No,you can do it in one .m file.Just make it step by step.try to do it again, there should't be any tricky things. – Nikita Pestrov Apr 25 '12 at 08:59
1
Yes, you can do that. If you take a look at the UIScrollViewDelegate reference you will see that all of the delegate methods accept as a parameter the UIScrollView
instance that triggered the call. This is so that when multiple UIScrollView
instances share a single delegate object (which is what you are trying to do), the delegate can still determine which UIScrollView
has fired each event/delegate callback.

aroth
- 54,026
- 20
- 135
- 176