This code is works on the simulator but crashes on the device.
Here is a simplified example of the problem:
Code:
NSScanner* scanner = [NSScanner initWithString: source];
for(int i = 0; i < 2000; i++)
{
[scanner scanUpToString:@">" intoString:nil];
[scanner scanString:@">" intoString:nil];
source = [self upDateSource([scanner scanLocation]);
scanner = [previewScanner initWithString:source];
}
The problem is that I'm allocating a new object after each iteration. Unfortunately there seems to be no way to simply update the string inside NSScanner...
Any ideas?