I want to parse and get the contents within the braces, which actually is as follows.
-(void)testfunction
{
//do something
integer myVal = 0;
NSString *testString = @"Test";
myVal = [someObject test];
if(myVal >10)
{
NSLog(@"Test Succeed");
}
else
{
NSLog(@"Test Succeed");
if(testString)
{
NSLog("Still");
}
}
}
I am expecting the output as all the text in the testFunction.
Is there a simpler logic to parse?
I am using NSString and developing for MAC OS and not iPhone.
Regards, Nirav
{}? then you probably need a proper parser somehow. If the functions always start with{}as first character in the line then you might get away with some regex/substring hack. What will it be used for?