I am relatively new to Objective-C and XCODE. I know C++ very well, but objective-C is giving me some headaches so far. I am trying to define a simple class, with one method / function which has two parameters, searchStr and searchPath. However, when I try to use this method, I get an error that indicates that the method could not be found or called.
Here is my search.h file:
here is the search.m file:
and finally, here is the portion of code where my function is called:
The project compiles with no warnings or errors, but when I try to call the searchForFiles method, it can't be found or hangs in debug mode. Any idea what I am doing wrong?
Thanks!!
Here is my search.h file:
PHP:
#import <Cocoa/Cocoa.h>
@interface CSearch : NSObject
- (NSMutableArray *) searchForFiles:(NSString *)searchStr path:(NSString *)searchPath;
@end
here is the search.m file:
PHP:
#import "Search.h"
@implementation CSearch
- (id) init { return self; }
- (void) dealloc { [super dealloc]; }
//
// SEARCH FOR FILES
//////////////////////////////////////////////////////
- (NSMutableArray *) searchForFiles:(NSString *)searchStr path:(NSString *)searchPath
{
...
}
@end
and finally, here is the portion of code where my function is called:
PHP:
CSearch * searchClass;
NSString *searchStr = @"searchstring";
NSString *filePathSearchStr = @"testpath";
[searchClass searchForFiles:searchStr path:filePathSearchStr];
The project compiles with no warnings or errors, but when I try to call the searchForFiles method, it can't be found or hangs in debug mode. Any idea what I am doing wrong?
Thanks!!