[[NSString alloc] initWithContentsOfFile:f] was deprecated 

initWithContentsOfFile was deprecated , for using , cause 'NSScanner:nil string argument'
update [[NSString alloc] initWithContentsOfFile:file encoding:NSStringEncodingConversionAllowLossy error:nil]; to instead