Based on C, the iOS also has compile-time, link-time and run-time.
- Compile-time is when the compiler converts our code to machine instructions code.
- Link-time is when the linker puts together the compiled pieces and libraries to form an executable.
- Run-time is when the program runs. Issue at this moment is critical.
- Compile warnings: we have done something bad, it still can compile but should be fixed, as it will potentially causes errors (that are hard to find).
- Compile errors: a problem that the compiler does not accept – we have to fix it right now. Compiler will give the location of the error (file + line number).
- Linking errors: the code compiles, but some functions or libraries needed are missing.
- Fatal errors: it crashes. They can be:
- segmentation fault
- bus error
- divide by zero
- Logic errors: it hangs or behaves unexpectedly.
- It can be a loop that can’t stop.
- It can be a logic that makes you wait for ever for the resource (locking, connecting without timeout etc…)
- It can be a race-condition issue which causes the app to behaves inconsistently every run.
- Simulator first, real device later; the differences between them are:
- The iDevices file-system is case-sensitive, while simulator is running on OSX, and the HFS+ (Mac Filesystem) is defaulted to case-insensitive (if we need the Mac filesystem to be case-sensitive, we will need to format it and specifically choose the option when formatting). So sometimes, we can have this issue where the simulator can still find the files, but the real devices not.
- The simulator has much more memory.
- The simulator does not have some default apps like the AppStore app…
- Global exception breakpoint
- Use Static Clang Analyzer
- Treat warnings as errors:
- Use the AppStore Validate (before Submission) process