原创 [讀書筆記]Ruby 元編程4
#單件方法 例子 c = Class.new(Array) c.send :define_method, :my_method do 'Hello!' end MyClass = c # puts c.name obj = MyC
原创 [IOS] NSArray to Bytes
NSArray *arr = @[1,2,3,3,4,4,2,0] unsigned c = arr.count; uint8_t *bytes = (uint8_t*)malloc(sizeof(*bytes
原创 UITableView 滾動到指定行 section
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:0 inSection:2]; CGRect frame = [tableview rectForSection
原创 關於 cocos2d: CCTexture2D: Using RGB565 texture since image has no alpha 錯誤
具體看是什麼版本了。個人用的是v2.0 。查了下源碼,發現是在代碼上遺漏了大括號,在else之後沒有將 CCLOG(@"cocos2d: CCTexture2D: Using RGB565 texture since image has
原创 NSDate 時差問題 筆記
NSDate *currentDate = [NSDate date]; NSTimeZone *zone = [NSTimeZone systemTimeZone]; NSInteger interval = [zone seco
原创 IOS 長按顯示圓形菜單
今天比較有空就隨便寫了個以後會用到的功能,之後等空閒了再慢慢更新。 目前仍有不少bug。。。 顏色什麼的可以自己改。 之後會增加圖片。 https://github.com/fnjnkn/TouchMenu---IOS/ 效果:
原创 iOS 禁用多控件同時點擊 筆記
[view setExclusiveTouch:YES]; exclusiveTouch A Boolean value that indicates whether the receiver handles touch events e
原创 IOS 自動填充視圖控件長寬 筆記
self.view.autoresizingMask = UIViewAutoresizingFlexibleWidth| UIViewAutoresizingFlexibleHeight;