9
votes

I was tinkering with XCode 4.5.2 this morning and wanting to make a table view I naturally added the UITableViewDataSource and UITableViewDelegate protocols to one on my view controller definitions.

#import <UIKit/UIKit.h>

@interface MyViewController : UIViewController <UITableViewDataSource, UITableViewDelegate>

@end

#import "MyViewController.h"

@implementation MyViewController

@end

Now I know at this stage I need to implement the @required methods of the UITableViewDataSource protocol but out of (presumably TDD) habit I decided to perform a build first with the expectation that the compiler would throw up warnings about the unimplemented @required methods (indicating to me which ones to implement).

But NO the build completed without a single error or warning from the compiler which has confused and concerned me slightly.

So I realize this question is normally the other way round i.e. 'why I am getting this warning', instead of 'why am I NOT getting this warning' but this really simple issue has really baffled me. Clearly I'm doing something wrong but I've no idea what. Any ideas how this might be possible?

FYI this a new project with no build/project setting customisation on a brand new clean install of XCode 4.5.2 on a new Mac Book.

1
have you clean the target, removed the Derived data and checked?Sumanth
Thanks Sumanth, I had already tried a clean and restart etc. I've just tried cleaning, quiting XCode, deleting the Derived Data folder for the project, restarting XCode and rebuilding but with the same result.Oliver Pearmain
I had the same experience, and someone linked me here. Here's my question, featuring a minimal test case: stackoverflow.com/questions/17453434/…Mark Amery
A possible explanation could be, that the two required methods are already implemented in the UIViewController class.Flovdis

1 Answers

0
votes

In XCode 4.5.x there is a option for setting different warnings to display (YES/NO). You can check it under build setting Compiler Warnings for LLVM 4.1 compiler.

I hope it'll resolve your issue.