subject.layer.borderColor =UIColor.grayColor.CGColor;
subject.layer.borderWidth =1;
2、加上下面兩行即可設置圓角邊框
subject.layer.cornerRadius =5.0;
#import <QuartzCore/QuartzCore.h>
3、方法:“+”是類方法:是對類本身執行某些操作的方法例如創建類的實例
“-”實例方法
4、[error debugDescription]
NSObject協議中還有個方法要注意,那就是debugDescription,此方法的用意與description非常想似。二者區別在於,debugDescription方法是開發者在調試器中以控制檯命令打印對象時才調用的。
5.1MAC系統沒有地址欄,如何快捷複製文件夾路徑?
打開文本編輯,格式菜單裏選純文本,然後把需要獲取路徑的文件拖進文本編輯的窗口裏,路徑就出現了,oh
yeah!
5.2在Finder裏點擊command + ⬆️ 即可返回上層文件夾,也可在上面的工具欄中點“前往”-》“上層文件夾”
6、顯示/隱藏Mac隱藏文件
顯示Mac隱藏文件的命令:defaults write com.apple.finder AppleShowAllFiles YES
隱藏Mac隱藏文件的命令:defaults write com.apple.finder AppleShowAllFiles NO
輸完單擊Enter鍵,退出終端,重新啓動Finder就可以了
重啓Finder:鼠標單擊窗口左上角的蘋果標誌-->強制退出-->Finder-->重新啓動
7、升級xcode6之後,直接建立Empty工程後發現,這是太坑,真的是什麼都沒有啊。只能換個方法了
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
ViewController *VController = [[ViewController alloc] init];
self.window.rootViewController = VController;
[self.window makeKeyAndVisible];
return YES;
}
UIImageView *userImage = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 35, 26)];//
userImage.image = [UIImage imageNamed:@"icon_account"];
_userTF.leftView = userImage;
_userTF.leftViewMode = UITextFieldViewModeAlways;
//控制左視圖位置
- (CGRect)leftViewRectForBounds:(CGRect)bounds
{
NSLog(@"%@",NSStringFromCGRect(bounds));
CGRect inset = CGRectMake(bounds.origin.x +10, bounds.origin.y, bounds.size.width-100, bounds.size.height);
return inset;
//return CGRectInset(bounds,50,0);
}
9、中文字符ASCII碼和NSString相互轉換
在xcode中,文件以utf8格式保存。因此,其中變量對象也是以utf8格式保存。不同語言的utf8編碼不一樣,英文的utf8編碼和ascii碼一樣。
10、Mac10.11 關閉Rootless權限的方法
1)、開機按住Command + R鍵,讓電腦進入恢復模式
2)、打開終端,在終端中鍵入:csrutil disable 並回車
3)、重新啓動電腦進入普通模式即可
11、如何上傳FLV文件並獲取有效的外鏈地址
http://blog.163.com/yang_fengabc/blog/static/214130233201381112931767/
12、成員變量寫在頭文件與寫在類實現文件中的類擴展裏的區別
一般把要公開的信息(變量、屬性、方法)定義在頭文件,把要隱藏的信息定義在類擴展裏,這樣可以隔離接口和實現