1.## and @# in the macro inside how to use
##Use, first we add a macro
1 #define Lrweakself (type) __weak typeof (Type) weak# #type = type;
##Is the function of the connection, that is, when using the above macro will weak connect with the input type values such as:
#It means to add a double quote followed by the identifier behind it "" @# , and we add a normal macro:
1 #define Lrtoast (str) [NSString stringwithformat:@ "%@", str]2// This macro needs to write 3 lrtoast (@ " Warm tips "); 4 NSLog (@ "%@", Lrtoast (@ " warm tip "));
Emphasize that I just casually define a macro to do the example, the above code is normal use, we are going to see @# how the addition is used:
1 #define Lrtoast (str) [NSString stringwithformat:@ "%@", @ #str]2 // This macro needs to be written like this 3 lrtoast (warm hint); 4 // normal operation, printing will not error 5 NSLog (@ "%@", lrtoast (warm hint));
We can see LRToast(温馨提示); with the LRToast(@"温馨提示"); difference, that @# is to say can replace @"" then we develop later on the easy, do not have to add @"" !
2. Tips for debugging crash problems with breakpoints
Sometimes we get a bug that crashes directly into the main function, which is where we want to quickly locate the crash.
Xcode provides a global breakpoint that allows you to quickly locate where the crash is and how to add a global breakpoint:
But after adding a global breakpoint will jump to the main function, you will encounter the situation, then 80% the problem is storyboard or xib drag line is not cleaned up 坏线 in time, so it will be caused 崩溃 !
Rules for 3.APP iteration development version numbers
How does a simple version number in iOS manage? First, our first version is on- App line, such as the 1.0.0 version number for first-time launch:
- On the line suddenly found a serious
Bug then we will fix the updated version, at this time our version number is1.0.1
So if the repair Bug or optimization function, we only modify the superimposed third digit, the other unchanged
- If there is a new requirement, add a new function on the original basis, then our version number becomes
1.1.0 , need to empty the third digit for 0 , to overlay modify the second digit
- If the
App demand function changed greatly, the update amount is very large, then our version number changes 2.0.0 , need to overlay the first digit to change, empty the other numbers for0
Some of the most useful coding and debugging methods in iOS development