2

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.. :)

Ankur
  • 5,086
  • 19
  • 37
  • 62
  • i have solved this problem, code is on http://stackoverflow.com/questions/11723202/how-to-get-response-from-clpclips-file/11771089#11771089 hope it helps... – Ankur Aug 02 '12 at 04:39

0 Answers0