title: Conflicting types - Function
body: <p>The following code leads to "Conflicting types for 'testf'". Does anybody have an idea?</p>
  
  <p>.h:</p>
  
  <pre><code>#import &lt;UIKit/UIKit.h&gt;
  @interface RootViewController : UITableViewController {
  }
  @end
  </code></pre>
  
  <p>.m:</p>
  
  <pre><code>#import "RootViewController.h"
  @implementation RootViewController
  - (void)viewDidLoad
  {
      [super viewDidLoad];
      NSString *testString=testf(1);
  }
  NSString* testf(int x){
      NSDateFormatter *dateFormatter=[[NSDateFormatter alloc] init];
      [dateFormatter setDateFormat:@"dd.MM.yyyy"];
      NSString *infstr=[dateFormatter stringFromDate:[[NSDate date] dateByAddingTimeInterval:(60*x)]];
      [dateFormatter release];
      return infstr;
  }
  - (void)dealloc
  {
      [super dealloc];
  }
  @end
  </code></pre>
  
  <p>Although this is a stripped down version of my original code, it doesn't work either.</p>
  
  <p>The exact error is "Conflicting types for 'testf'". There are also a couple of warnings, including "Implicit declaration of function 'testf' is invalid in C99".</p>
  
  <p>Thanks in advance.</p>