我将以下代码作为 iOS 应用程序的一部分,该应用程序从 URL 获取 JSON 数组并使用它来填充表格视图。出于某种原因,函数中没有发出请求,我不知道为什么。功能如下图。
PS - 我是这个 Objective-C 云雀的新手,如果我犯了一个非常明显的错误,请原谅我!
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
// Create a URL Request
self.responseData = [NSMutableData data];
NSURLRequest *request = [NSURLRequest requestWithURL:
[NSURL URLWithString:@"http://mydomain.com/return_json_list"]];
[[NSURLConnection alloc] initWithRequest:request delegate:self];
self.viewController = [[BIDViewController alloc] initWithNibName:@"BIDViewController" bundle:nil];
self.window.rootViewController = self.viewController;
[self.window makeKeyAndVisible];
return YES;
}