【发布时间】:2013-06-10 07:57:28
【问题描述】:
我正在尝试学习objective-c,但在此示例中遇到了警告:
#import <Foundation/Foundation.h>
int main (int argc, const char * argv[])
{
@autoreleasepool {
NSMutableDictionary *booklisting = [NSMutableDictionary dictionary];
int count; // < Am getting 'unused variable' warning here
[booklisting setObject:@"Wind in the Willows" forKey:@"100-432112"];
[booklisting setObject:@"Tale of Two Cities" forKey:@"200-532874"];
[booklisting setObject:@"Sense and Sensibility" forKey:@"200-546549"];
[booklisting setObject:@"Shutter Island" forKey:@"104-109834"];
NSLog(@"Number of books in dictionary = %lu", [booklisting count]);
有人知道为什么吗?.. 不胜感激..谢谢
【问题讨论】:
标签: objective-c compiler-warnings unused-variables