iOS 开发:无用代码示例(Objective-C)
以下是一段无用的 OC 代码示例:
- (void)uselessMethod {
int a = 5;
for (int i = 0; i < a; i++) {
NSLog('This is a useless loop');
}
NSString *uselessString = 'This is a useless string';
NSLog(@'%@', uselessString);
NSArray *uselessArray = @['item1', 'item2', 'item3'];
NSLog(@'%@', uselessArray);
NSDictionary *uselessDictionary = @{ 'key1': 'value1', 'key2': 'value2'};
NSLog(@'%@', uselessDictionary);
UIView *uselessView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 100, 100)];
[self.view addSubview:uselessView];
}
以上代码包含一个无用的循环、一个无用的字符串、一个无用的数组、一个无用的字典以及一个无用的视图。这些代码没有实际意义,仅用于演示目的。
原文地址: https://www.cveoy.top/t/topic/pgZa 著作权归作者所有。请勿转载和采集!