I have an issue with the UIPageControl. I simplified the issue for clarity below:
I put a button and a UIPageControl in my app with Interface builder and put the following in the code:
- (IBAction)tappedButton:(id)sender{
self.pageControl.currentPage = 3;
NSLog(@"Tapped Button");
}
- (IBAction)changePage:(id)sender{
NSLog(@"PAGE Changed!!!!");
}
I attached the Value Changed action to the pageController via Interface Builder.
When I tap on the button, I see the output “Tapped Button” and the third dot is highlighted… but the changePage method is never called.
Any ideas?
The changePage: method will only be called when the users request a change of page using the UIPageControl. It won’t be called when the user taps the button. If you want to call the changePage: method when the button is pressed called it explicitly: