jessedc / JCTiledScrollView

A set of classes that wrap UIScrollView and CATiledLayer. It aims to simplify displaying large images and PDFs at multiple zoom scales.
MIT License
310 stars 47 forks source link

Compilation errors #13

Closed adamotte closed 11 years ago

adamotte commented 11 years ago

Hi,

I recently download branch master project, try to compile demo project with XCode 4.2 without modifications and i got errors on

Can you explain me why and how to fix them ?

Thanx a lot.

adamotte commented 11 years ago

Ok,

I finally understand Project xcconfig. So i changed theses values :

But am i doing this right?

jessedc commented 11 years ago

Hi Adamotte,

Warnings are treated as errors to force you to fix them rather than avoid them.

Can you post the particular warnings exactly as you're getting them from Xcode and we'll go from there.

Cheers.

adamotte commented 11 years ago

Warnings are (sorry for verbose) :

JCPDFTiledView.m:46:35: warning: unused parameter 'rect' [-Wunused-parameter,3] _-(void)drawRect:(_unused CGRect)rect

JCTiledPDFScrollView.m:95:72: warning: unused parameter 'tiledView' [-Wunused-parameter,3] _-(CGPDFDocumentRef)pdfDocumentForTiledView:(_unused JCPDFTiledView *)tiledView

JCTiledPDFScrollView.m: 100:64:warning: unused parameter 'tiledView' [-Wunused-parameter,3] _-(CGPDFPageRef)pdfPageForTiledView:(_unused JCPDFTiledView *)tiledView

JCTiledScrollView.m:107:95: warning: undeclared selector 'singleTapReceived:' [-Wundeclared-selector,3] _singleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(singleTapReceived:)];

JCTiledScrollView.m:111:95: warning: undeclared selector 'doubleTapReceived:' [-Wundeclared-selector,3] _doubleTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(doubleTapReceived:)];

JCTiledScrollView.m:117:98: warning: undeclared selector 'twoFingerTapReceived:' [-Wundeclared-selector,3] _twoFingerTapGestureRecognizer = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(twoFingerTapReceived:)];

JCTiledScrollView.m:149:65: warning: unused parameter 'scrollView' [-Wunused-parameter,3] _-(UIView )viewForZoomingInScrollView:(__unused UIScrollView )scrollView_

JCTiledScrollView.m:154:52: warning: unused parameter 'scrollView' [-Wunused-parameter,3] _-(void)scrollViewDidZoom:(_unused UIScrollView *)scrollView

JCTiledScrollView.m:164:3:{164:3-164:44}: warning: instance method '-correctScreenPositionOfAnnotations' not found (return type defaults to 'id') [3] [self correctScreenPositionOfAnnotations];

JCTiledScrollView.m:162:54: warning: unused parameter 'scrollView' [-Wunused-parameter,3] _-(void)scrollViewDidScroll:(_unused UIScrollView *)scrollView

JCTiledScrollView.m:182:5:{182:5-182:46}: warning: instance method '-correctScreenPositionOfAnnotations' not found (return type defaults to 'id') [3] [self correctScreenPositionOfAnnotations];

JCTiledScrollView.m:272:11:{272:11-272:65}: warning: instance method '-point:isWithinBounds:' not found (return type defaults to 'id') [3] if ([self point:screenPosition isWithinBounds:self.bounds])

JCTiledScrollView.m:365:48: warning: unused parameter 'tiledView' [-Wunused-parameter,3] _-(UIImage )tiledView:(__unused JCTiledView )tiledView imageForRow:(NSInteger)row column:(NSInteger)column scale:(NSInteger)scale_

jessedc commented 11 years ago

Hi Adamotte,

There's two issues you're facing, they're both due to your Xcode version being many versions behind the most recent version that supports a handful of new Objective C features that I have used in JCTiledScrollView.

  1. Unused parameter warnings are appearing due to how GCC 4.2 handled the __unused attribute. In your case it's ignoring them where I've placed them. See here, although I can't be sure of your GCC version
  2. Undeclared selector warnings are due to versions of Xcode prior to 4.3 requiring forward method declarations. See Here

My advice in this case is that you use a newer version of Xcode (which will automatically solve the warnings) or as you have discovered above, suppress these warnings.

As a side note, there's many other reasons why you'd want to upgrade your version of Xcode. Any particular reason why you haven't?

adamotte commented 11 years ago

I haven't upgrade my Xcode due to my Mac OS version (10.6.8). XCode 4.3 doesn't support my OS version. But i'll upgrade sooner and follow your advice.