storyboard static table cell 不能通过拖拽创建IBOutlet, 可以先讲cell设置为dynamic cell, 然后拖拽创建IBOutlet,然后再切换成static cell, 然后再连线
Retrieve the UUID
CFUUIDRef uuid = CFUUIDCreate(NULL);
assert(uuid != NULL);
CFStringRef uuidStr = CFUUIDCreateString(NULL, uuid);
[NSString stringWithFormat:@"%@", uuidStr]
new & alloc/init
new和alloc/init在功能上几乎是一致的,分配内存并完成初始化。差别在于,采用new的方式只能采用默认的init方法完成初始化,采用alloc的方式可以用其他定制的初始化方法。NSInteger
A NSInteger is 32 bits on 32-bit platforms, and 64 bits on 64-bit platforms. Is there a NSLogspecifier that always matches the size of NSInteger
For 32 bit code, I need the %d specifier. But if I use the %d specifier, I get a warning when compiling for 64 bit suggesting I use %ld instead.If I use %ld to match the 64 bit size, when compiling for 32 bit code I get a warning suggesting I use %d instead.
How do I fix both warnings at once? Is there a specifier I can use that works on either?With current Xcode, you can make use of the z and t modifiers to handle NSInteger and NSUInteger without warnings, on all architectures.
You want to use %zd for signed, %tu for unsigned, and %tx for hex.clear UIWebView background color
[_webView setBackgroundColor:[UIColor clearColor]];
[_webView setOpaque:NO];