2017年4月27日 星期四

[iOS] How to read byte in NSData?

如何從NSData讀Byte? 
 
NSData * theData = [NSData dataWithContentsOfFile: path];
const char* theBytes = (const char*)[theData bytes];
 
那讀幾個Byte?
 
NSRange range = NSMakeRange(location, length);
NSData *someData = [theData subdataWithRange:range]; 
const char* theBytes = (const char*)[someData bytes];

2017年4月25日 星期二

[iOS] The color of the back barbutton in Navigationbar.

Try to set this.

self.navigationController.navigationBar.tintColor

not

self.navigationItem.backBarButtonItem.tintColor

2017年4月12日 星期三

[iOS] x duplicate symbols for architecture xxxxxx

x duplicate symbols for architecture xxxxxx

之前有遇到過,有解過,但是忘記

現在記錄下來

是因為import的.h打成.m 所以才會這樣。

Class has no initializers in swift

Class has no initializers in swift I have met this situation. Found a solution here It says if you have the code like bellow var se...