设置UIPanGestureRecognizer委托时发生异常

时间:2015-08-30 12:27:21

标签: ios exception delegates scrollview uipangesturerecognizer

我需要检测水平滚动的长度并做一些事情

writerObj = VideoWriter('runningNodes.avi');
open(writerObj);
plot(x(1,:),y(1,:));
axis tight
set(gca,'nextplot','replacechildren');
set(gcf,'Renderer','zbuffer');
for ii=1:3600
   plot(x(ii,:),y(ii,:));
   frame = getframe;
   writeVideo(writerObj,frame);
end

close(writerObj);

同时允许用户正常垂直滚动。 所以我设置了UIGestureRecognizerDelegate,但发生了异常。

 UIPanGestureRecognizer *panGestureRecognizer;     
 panGestureRecognizer=[[UIPanGestureRecognizer alloc] initWithTarget:self action:@selector(doSomething:)];

这是我的委托.m

 MyGestureDelegate *deleg = [[MyGestureDelegate alloc] init];
 [panGestureRecognizer setDelegate:deleg];
 [self.scrollView addGestureRecognizer:panGestureRecognizer];

我能做些什么来做对吗?

0 个答案:

没有答案