Hi there.
I'm trying to search an LDAP database using the ODQuery method. I have the following code set up:
- (void)awakeFromNib
{
[self startSearch:@"john"];
}
- (void)startSearch:(NSString *)searchString
{
nodeName = @"http://sububria.org.au";
session = [ODSession defaultSession];
searchNode = [[ODNode alloc] init];
searchNode = [ODNode nodeWithSession:session name:nodeName error:NULL];
query = [[ODQuery alloc] initWithNode:searchNode
forRecordTypes:kODRecordTypePeople
attribute:kODAttributeTypeAllAttributes
matchType:kODMatchInsensitiveContains
queryValues:searchString
returnAttributes:kODAttributeTypeAllAttributes
maximumResults:0
error:NULL];
[query setDelegate:self];
[query scheduleInRunLoop:[NSRunLoop currentRunLoop] forMode:NSDefaultRunLoopMode];
}
- (void)query:(ODQuery *)inSearch foundResults:(NSArray *)inResults error:(NSError *)inError
{
NSLog (@"Search ran");
NSLog (@"%@", inResults);
}
I'm pretty new to this so I'm not sure what I could be doing wrong. I'm not getting any warnings or errors in Xcode, my app is just crashing when the search query is run.
There is no console error that appears, but the most recent items in the thread stack are;
CFRetain
_ODQueryInitWIthNode
-[ODQuery initWithNode:forRecordTypes:attribute:matchType:queryValues:returnAttributes:maximumResults:error:]
-[MyAppDelegate startSearch:]
-[MyAppDelegate applicationDidFinishLaunching:]
I'd appreciate any help. Ricky.