クラスのメソッドformatSearchString
を作成しましたが、それを実装する前に行で呼び出そうとしています (関係ありませんか?)。次のエラーが表示されます。
Error: Semantic Issue
Use of undeclared identifier 'formatSearchString'
XCode 4.6.2 を使用しています
インターフェイス ファイルFHViewController.h
:
#import <Foundation/Foundation.h>
@interface FHViewController : UITableViewController
<UITableViewDataSource, UITableViewDelegate, NSURLConnectionDataDelegate>
@property(strong, nonatomic) NSString *searchTerm;
- (NSString *)formatSearchString:(NSString *)userEntry;
@end
実装ファイルFHViewController.m
:
#import "FHViewController.h"
@interface FHViewController()
- (NSString *)formatSearchString:(NSString *)userEntry;
@end
@implementation FHViewController
@synthesize searchTerm;
-(void)viewDidLoad
{
[super viewDidLoad];
NSString *formatted = [formatSearchString userEntry:searchTerm];
}
- (NSString *)formatSearchString:(NSString *)userEntry
{
NSLog(@"User Entry: %@", userEntry);
return @"Dummy string for now";
}
@end