Undeclared - 'first use in function'
- by Ragunath Jawahar
I'm new to Objective-C, though I have a very good hand in Android. I'm trying to make a call to a method but it gives me 'first use in function'. I know I'm making a silly mistake but experts could figure it out easily.
RootViewController.h
#import <UIKit/UIKit.h>
#import "ContentViewController.h"
@interface RootViewController : UITableViewController {
ContentViewController *contentViewController;
}
@property (nonatomic, retain) ContentViewController *contentViewController;
- (NSString*)getContentFileName:(NSString*)title; //<--- This function declartion
@end
RootViewController.m
#import "RootViewController.h"
#import "HAWATAppDelegate.h"
#import "ContentViewController.h"
@implementation RootViewController
@synthesize contentViewController;
...
more methods
...
#pragma mark -
#pragma mark Table view delegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
HAWATAppDelegate *appDelegate = (HAWATAppDelegate *)[[UIApplication sharedApplication] delegate];
NSString *title = (NSString *) [appDelegate.titles objectAtIndex:indexPath.row];
NSString *fileName = getContentFileName:title; //<--- Here is the error
...
}
- (NSString*) getContentFileName:(NSString*)title {
return [title lowercaseString];
}
@end
There must be a simple thing I'm missing. Please let me know. Thanks in advance.