当向类别中添加自定义属性时会报instance variables may not be placed in categories错误,还好我们有了runtime,我们可以通过runtime的Associate为类别添加属性
1 | @interface UIView (LFEaseBlankPageView) |
正确做法如下:
1 |
|
有时候,静下心来学习是一种享受!
1 | @interface UIView (LFEaseBlankPageView) |
1 |
|
1 | NSString *const MC_MYCOUPON_STORAGE = @"CouponStorage"; |
1 | // 全局变量:只有一份内存,所有文件共享,与extern联合使用。 |
1 | - (IBAction)changeFont:(id)sender { |


1 | + (NSString *)libraryPath |
1 | + (NSString *)cachePath |
1 | + (NSString *)tmpPath |
1 | @interface TestVC (){ |
1 | __weak typeof(self) weakSelf = self; |
1 | -(void)test{ |
1 | ^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{8,10}$ |
1 | ^[\u4e00-\u9fa5]{0,}$ |
1 | ^\w+$ |
1 | [\w!#$%&'*+/=?^_`{|}~-]+(?:\.[\w!#$%&'*+/=?^_`{|}~-]+)*@(?:[\w](?:[\w-]*[\w])?\.)+[\w](?:[\w-]*[\w])? |
1 | ^[1-9]\d{7}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}$ |
1 | ^[1-9]\d{5}[1-9]\d{3}((0\d)|(1[0-2]))(([0|1|2]\d)|3[0-1])\d{3}([0-9]|X)$ |
1 | ^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$ |
1 | ^[0-9]+(.[0-9]{2})?$ |
1 | ^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$ |
1 | ^.*MSIE[5-8](?:\.[0-9]+)?(?!.*Trident\/[5-9]\.0).*$ |
1 | if(!s.match(/^[a-zA-Z]+:\/\//)) |
1 | ^(f|ht){1}(tp|tps):\/\/([\w-]+\.)+[\w-]+(\/[\w-./?%&=]*)? |
1 | $ defaults read /Applications/Xcode.app/Contents/Info DVTPlugInCompatibilityUUID |
1 | $ find ~/Library/Application\ Support/Developer/Shared/Xcode/Plug-ins -name Info.plist -maxdepth 3 | xargs -I{} defaults write {} DVTPlugInCompatibilityUUIDs -array-add 9F75337B-21B4-4ADC-B558-F9CADF7073A7 |

我的第一篇博客,Fighting!