I am developing an iPhone app that uses CLIPS RULES ENGINE.
I have integrated it successfully with XCode using below code.
InitializeEnvironment();
Clear();
NSString *filePath = [[NSBundle mainBundle]
pathForResource:@"animal" ofType:@"clp"];
NSData *myData = [NSData dataWithContentsOfFile:filePath];
if (myData) {
char *clipsFileChar = (char *)[filePath cStringUsingEncoding:NSASCIIStringEncoding];
IncrementGCLocks();
Load(clipsFileChar);
Reset();
AssertString("(find-all-facts ((?f state-list)) FALSE)");
int numberRulesFired = Run(-1);
NSLog(@"Number of rules that fired: %d", numberRulesFired);
DecrementGCLocks();
}
else {
NSLog(@"Could not find file %@", filePath);
}
the problem is when I run my app, it goes to infinite loop from line int numberRulesFired = Run(-1);
.
Please help me if you have any idea.......
Thanks.. :)