Xcode使用技巧

2016-01-16  本文已影响104人  forvert

Xcode使用技巧

技巧一

1.解决上面的问题需要终端中输入

问题就这样解决了!!!

2. 如果想恢复成原来的样子可以再终端中输入下面的命令

补充:如果通过手动删除文件,需要让Mac显示隐藏文件(隐藏文件),的命令如下:

// 显示隐藏文件的命令
defaults write com.apple.finder AppleShowAllFiles Yes && killall Finder
// 不显示隐藏文件的命令
defaults write com.apple.finder AppleShowAllFiles No && killall Finder

技巧二

1.给category添加属性的小技巧
// .h文件中
#import @interface NSObject (LLExtention)
@property (copy,nonatomic) NSString *LLString;
@end
// .m文件中
#import "NSObject+LLExtention.h"
#import <objc runtime.h="">
@implementation NSObject (LLExtention)
- (void)setLLString:(NSString *)LLString {
    objc_setAssociatedObject(self, @selector(LLString), LLString, OBJC_ASSOCIATION_COPY_NONATOMIC);
}
- (NSString *)LLString {
    return objc_getAssociatedObject(self, @selector(LLString));
}
@end</objc>
上一篇 下一篇

猜你喜欢

热点阅读