我一直在关注有关使用 Xcode 解析 json 的教程,但遇到了我无法解决的问题。我怀疑是因为教程使用的是 5.1 而我使用的是 6.1
AppDelegate.m 未使用的变量 'navController' 使用未声明的标识符 'navController' 见下文
@implementation AppDelegate
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPhone" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: self.viewController];
} else {
self.viewController = [[ViewController alloc] initWithNibName:@"ViewController_iPad" bundle:nil];
UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController: self.viewController];
}
self.window.rootViewController = navController;
[self.window makeKeyAndVisible];
return YES;
}
ViewController.m 预期的方法主体 使用未声明的标识符“theData”
- (void)connection:NSURLConnection *)connection didReceiveData:(NSData *)theData
{
[data appendData:theData];
}