Problem:
Yesterday, I converted a large project to support arm64 , after which I immediately received 500+ warnings. About 70% of them are where the NSIntegerint is assigned or vice versa, and the rest where the NSUInteger is formatted NSStringas follows:
NSInteger a = 123;
NSString *str = [NSString stringWithFormat:@"Int:%d", a];
Now I know how to access them manually, but this is a huge task and very laborious. I also know that I can completely disable type mismatch warnings, but I don't want to do this. Of course, they are very useful.
What I tried:
- I converted
[NSNumber numberWithInt:abc];to [NSNumber numberWithInt:(int)abc];using find-n-replace. He fixed some. I also tried changing all my int properties to NSInteger properties but it doubled the number of warnings (up to 900). So I'm back.
I also tried to find some kind of regular expression, but could not find something suitable for my needs.
Question:
I am looking for a regex or any other workaround that someone has tried, which may reduce the amount of work needed to fix them manually.
Thanks in advance.
source
share