hit counter

Timeline

My development logbook

Values of Type NSInteger Should Not Be Used as Format Arguments

In this example,

1
2
NSInteger val = 15000;
    NSLog(@"%i", val);

XCode will flag this error

Values of type "NSInteger" should not be used as format arguments: add an explicit cast to 'long' instead.

It is because NSInteger can be 32-bit or 64-bit, depending on the platform, the compiler recommends to add a cast to long generally.

Unrecognized Selector -replacementObjectForKeyedArchiver:

Here is the code in question:

class Something: NSCoding {
    ...

let smth = Something() 
let data = NSKeyedArchiver.archivedDataWithRootObject(smth);

It throws this exception:

2014-09-12 16:30:00.463 MyApp[30078:60b] *** NSForwarding: warning: object 0x7a04ac70 of class '_TtC8MyApp7Something' does not implement methodSignatureForSelector: -- trouble ahead
Unrecognized selector -[MyApp.Something replacementObjectForKeyedArchiver:]

It is because Something does not inherit from NSObject

Css Overflow

Valid values of attribute overflow are visible, hidden, scroll, auto, initial and inherit

It controls browser behavior if content overflows an element’s box.