@import url(http://m.shnenglu.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css);

Unknown class in Interface Builder file

Check your nibs or storyboard, and make sure none of your views are set to the class!

swift中的注釋說(shuō)明:
TODO: + 說(shuō)明
如果代碼中有該標(biāo)識(shí),說(shuō)明在標(biāo)識(shí)處有功能代碼待編寫,待實(shí)現(xiàn)的功能在說(shuō)明中會(huì)簡(jiǎn)略說(shuō)明。比如  //TODO:加入登陸功能.

FIXME: + 說(shuō)明
如果代碼中有該標(biāo)識(shí),說(shuō)明標(biāo)識(shí)處代碼需要修正,甚至代碼是錯(cuò)誤的,不能工作,需要修復(fù),如何修正會(huì)在說(shuō)明中簡(jiǎn)略說(shuō)明。

XXX: + 說(shuō)明
如果代碼中有該標(biāo)識(shí),說(shuō)明標(biāo)識(shí)處代碼雖然實(shí)現(xiàn)了功能,但是實(shí)現(xiàn)的方法有待商榷,希望將來(lái)能改進(jìn),要改進(jìn)的地方會(huì)在說(shuō)明中簡(jiǎn)略說(shuō)明。

關(guān)于UIView的autoresizingMask屬性的研究

在 UIView 中有一個(gè)autoresizingMask的屬性,它對(duì)應(yīng)的是一個(gè)枚舉的值(如下),屬性的意思就是自動(dòng)調(diào)整子控件與父控件中間的位置,寬高。

1
2
3
4
5
6
7
8
9
enum {
   UIViewAutoresizingNone                 = 0,
   UIViewAutoresizingFlexibleLeftMargin   = 1 << 0,
   UIViewAutoresizingFlexibleWidth        = 1 << 1,
   UIViewAutoresizingFlexibleRightMargin  = 1 << 2,
   UIViewAutoresizingFlexibleTopMargin    = 1 << 3,
   UIViewAutoresizingFlexibleHeight       = 1 << 4,
   UIViewAutoresizingFlexibleBottomMargin = 1 << 5
};

 

UIViewAutoresizingNone就是不自動(dòng)調(diào)整。
UIViewAutoresizingFlexibleLeftMargin 自動(dòng)調(diào)整與superView左邊的距離,保證與superView右邊的距離不變。
UIViewAutoresizingFlexibleRightMargin 自動(dòng)調(diào)整與superView的右邊距離,保證與superView左邊的距離不變。
UIViewAutoresizingFlexibleTopMargin 自動(dòng)調(diào)整與superView頂部的距離,保證與superView底部的距離不變。
UIViewAutoresizingFlexibleBottomMargin 自動(dòng)調(diào)整與superView底部的距離,也就是說(shuō),與superView頂部的距離不變。
UIViewAutoresizingFlexibleWidth 自動(dòng)調(diào)整自己的寬度,保證與superView左邊和右邊的距離不變。
UIViewAutoresizingFlexibleHeight 自動(dòng)調(diào)整自己的高度,保證與superView頂部和底部的距離不變。
UIViewAutoresizingFlexibleLeftMargin  |UIViewAutoresizingFlexibleRightMargin 自動(dòng)調(diào)整與superView左邊的距離,保證與左邊的距離和右邊的距離和原來(lái)距左邊和右邊的距離的比例不變。比如原來(lái)距離為20,30,調(diào)整后的距離應(yīng)為68,102,即68/20=102/30。

其它的組合類似。


解決Xcode中swift語(yǔ)言查找符號(hào)Symbol not found的問(wèn)題。更換工程的SDK為7.1或者其他版本,應(yīng)該是SDK8.0的bug

swift使用數(shù)組+=錯(cuò)誤:Array<AnyObject>! is not identical to 'UInt8'
The += operator on arrays only concatenates arrays, it does not append an element. This resolves ambiguity working with Any, AnyObject and related types.
UIView不支持深拷貝,先壓縮之后在解壓,通過(guò)獲取解壓的版本來(lái)得到新的副本
UIView *newView = [NSKeyedUnarchiver unarchiveObjectWithData:[NSKeyedArchiver archivedDataWithRootObject:oldView]];

UITableView設(shè)置grounped特性之后,頂部空白了一段區(qū)域,解決辦法:
       tableView.sectionHeaderHeight = 0
        tableView.sectionFooterHeight 
= 0
        tableView.rowHeight           
= 0
object-c 將NSString轉(zhuǎn)換為json 字典.
NSString *data;  //一個(gè)json格式的字符串
NSDictionary *json =
    [NSJSONSerialization JSONObjectWithData: [data dataUsingEncoding:NSUTF8StringEncoding]
                                options: NSJSONReadingMutableContainers
                                  error: 
&error];