- 彻底关闭 Xcode 和模拟器
- $ sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService
- $ rm -rf ~/Library/Developer/CoreSimulator/Devices
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)set_:(NSInteger)_ | |
{ | |
__ = _; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Problem: | |
// I want to hack -awakeAfterUsingCoder: which has an attribute "NS_REPLACES_RECEIVER" | |
// Now I have a block version implmentation and to be added into UIView class | |
// It works fine in ARC with right object ownership | |
// But Xcode gives me a warning "ns_consumes_self attribute only applies to methods" | |
id (^newIMPBlock)(id, NSCoder *) NS_REPLACES_RECEIVER = | |
^id (UIView *self, __unused NSCoder *decoder) NS_REPLACES_RECEIVER { | |
// Do my staff | |
}; |
__attribute__((overloadable)) NSString *descriptionFromValue(float value) {
return @(value).stringValue;
}
__attribute__((overloadable)) NSString *descriptionFromValue(NSRange range) {
return NSStringFromRange(range);
}
__attribute__((overloadable)) NSString *descriptionFromValue(id object) {
return [object description];
}