@property (nonatomic, weak) IBOutlet UIScrollView *scrollView;
[[self scrollView] setContentSize:CGSizeMake(1024, 2000)];
[[self scrollView] setContentOffset:CGPointMake(0, 150)];
[[self view] setContentSize:CGSizeMake(123, 123)];)
(When you connect the outlet that property declaration should be generated for you by XCode).
An alternative to this (that would avoid the need for casting) would be to set the UIViewController custom class back to UIView in interface builder. Then, insert a new UIScrollView as a subview (simply drag and drop in Interface Builder), connecting the UIScrollView to the UIViewController subclass via an IBOutlet that looks something like:
Hey, thanks again will. Sorry for late reply, I was out for holiday. I tried not using dot notation, the result was same. Anyways, appreciate your help : )
On second thoughts, I don't think that not using dot notation should make any difference. I think casting is your only sensible option if you want the UIViewController's top level view to be a UIScrollView.
Thanks Will, I'm appreciate your help. But, doing such thing might break the application as thousand lines of code were made within this controller and several controller and custom class were wired with it. I can simply do search & replace but prefer not to touch any code for now. If there is not a better solution, I'll do this. Anyway, do you know what cause the problem, why do I have to cast it? Thanks again
Then, in your UIViewController subclass, you can do something like:
Yeah, I'm quite sure I understand exactly what you did there, but casting sounds simpler (and therefore better) to me.