Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

punchScrollView does not work in UINavigationController #1

Closed
bitflying opened this Issue · 6 comments

2 participants

@bitflying

I tried to use punchScrollView in UINavigationController (based on your Example project). When I clicked the Next Page button and got a "EXC BAD_ACCESS" crash.

beak point at " [self loadPages];"

  • (void)scrollViewWillBeginDragging:(UIScrollView *)scrollView { [self loadPages]; }

Thanks in advance!

@tapwork
Owner

looks like that you are dragging a page when pushing a new controller, you should remove yourself as delegate and datasource from punchscrollview in dealloc
self.scrollview.punchDataSource = nil;
self.scrollview.punchDelegate = nil;

@bitflying

I do as you told, thing seems better. but only "Page 0 In Section 0" and "Page 1 In Section 0" got be showed. I continued drag 4 times, and got crash at
return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));

So, Can you give me a example which can work in UINavigation.

Thank in advance!

@tapwork
Owner
@bitflying
  1. I create a Empty project in XCode 4.2
  2. use PunchScrollView.h/PunchScrollView.m, ExamplePageView.h/ExamplePageView.m, PunchUIScrollViewViewController.h/PunchUIScrollViewViewController.m from your exmaple project
  3. In method application didFinishLaunchingWithOptions of AppDelegate.m , add: PunchUIScrollViewViewController *rvc = [[PunchUIScrollViewViewController alloc] init]; UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:rvc]; [self.window addSubview:[nvc view]];
@bitflying

It work!
I should use
self.window.rootViewController = nvc;
instead of
[self.window addSubview:[nvc view]];
No crash, nat more

Thanks Christian!

@bitflying bitflying closed this
@tapwork
Owner
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.