I just joined a new company and met some problems. I feel I need to record them and share them with you.
Problem 1 the interface corresponds to the code
Since I just joined the company, I didn’t know where the code corresponding to the interface was. Besides, the project was old and large, so how to quickly find the corresponding between the interface and the code was the first problem.
Practice:
- In the beginning, I went through all the interfaces of the app to get a general idea of what they were. Then I started to look at the code names, guess which interface they might be based on the names, and verify if they were correct. But then I found that it was very tiring, and because the code was old, some classes were rewritten, the old ones were not deleted, and the names were very similar, so some of them could not correspond at all; And it’s very inefficient. If the project is small, that’s fine, but the project is big and the time is tight, it just doesn’t work.
- And then I was walking home from work at night, and I remembered a blog POST I had read, Method Swizzling and AOP practices, where they introduced using Method Swizzling to add statistics to every interface, and I thought, now that I can add statistics to every interface, I’m sure you can print information for each screen, too. So, I replace the ViewWillAppear: Method with a Method Swizzling implementation, and then print the current class name every time the interface appears. So ALL I have to do is run my app, click on the screen, and it will print the current class. It’s easy to find the interface code.
Q.2 The emulator works fine and the real machine works fine, but the packaged display is not correct
Develop a new version, package it to the test, and the test says you’re not showing it right; Then I took a closer look, and sure, everything was wrong with the numbers, but I was running on the simulator and everything was fine
Screen:
- At first, I thought it was the certificate, but it was unlikely. If it was the certificate, the result would be that the package could not be packed, rather than the wrong package data. And THEN I wondered, could it be because I didn’t set something when I packed? But they didn’t pick it up, and I wasn’t told to do anything special.
- So I need to locate the error, and then I go on the real machine, directly run, sister, also right ah, this is what the hell.
- And then I’m going to ask you, if it’s scheme, because if there’s any difference between packaging and running it, it’s Scheme. So I changed scheme to Release and ran it directly. I have no choice but to change Scheme to DEBUG and make a package. (Packaging is a very painful thing, computer card, project is big, compilation takes a few minutes, test by myself, I click Archieve, then go to the bathroom, come back to find that compilation is not finished…) , the result is still incorrect. No tears…
- Then the test urged me, so I find the next person to help me dozen a package, the results found that he dozen a package is no problem… So I thought I was missing something when I packed, but I couldn’t find it.
- Tested and drives to the next day, packaging, can’t, then check and found that the enemy – the pit of iOS development in # 3 – use the asi framework under the xcode run normally, but the packaging but not for network access and asi packing of ipa, and then I changed according to the specification, compile packaging, to witness the miracle time, well, ya, That’s the question. The project is old, so I have not replaced asi, and I have not used it before, but miraculously, the iOS next to me, its compilation condition is -fno-objC-arc, but the output package is ok, this is very strange!
Problem 3 The simulator runs properly, but the real machine runs incorrectly
The last problem has just been fixed. There was a bug mentioned in the test at night. Click the link to jump to the web, but the loading failed
Screen:
- When the test first came in, I checked and found that there was no problem on the simulator, and the test told me that there was no problem on Android, so I was thinking, damn, is there something wrong with the packaging again? But if I replace the link with Baidu, there is no problem.
- Old rule, on the real machine, and then step debugging, the link is right ah, but does not load ah, is the webView interface write wrong (I am new, so use the previous existing load web class), and then step by step debugging, found every time load, link behind the splice.” Source =app”, ha ha ha, I am smart, comment out, run, shit, how not; Then the background told me it didn’t actually affect the link, so I obediently opened the comment again.
- So, is that why, or background said, you try other mobile phone can open? Copy this link to your browser and see if it opens directly. Then I tried it, and damn it, I couldn’t open it in my browser. Then switch to another test machine, found that it can, can, can ah, the original test did not look at other phones ah… (Ps: My mobile phone has not been added to the test account, so it has not been able to use), alas, but the mobile phone is obviously connected to the Internet, why not? Why? Later I think, first of all, our company’s network is limited; Again: this link is the link of the test, there may be no good front end.
- But it’s not my problem. Why did I take so long to change? Why is that? Yeah, why is that?