我NSURL
在课堂上有一个对象ScanViewController
并将其传递给ListViewController
课堂。
NSURL *url = [NSURL URLWithString:@"http:// some url"];
我在我的项目中使用 xib,找不到替代品
[self.storyboard instantiateViewControllerWithIdentifier:]
[NSURLConnection sendAsynchronousRequest:request queue:queue completionHandler:^(NSURLResponse *response, NSData *data, NSError *error)
{
if(error || !data)
{
NSLog(@"JSON NOT posted");
}
else
{
NSLog(@"JSON data posted!");
id jsonObject = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingAllowFragments error:Nil];
if([jsonObject respondsToSelector:@selector(objectForKey:)])
{
NSDictionary *dictionaryForUserID = [jsonObject valueForKey:@"ProjID"];
NSLog(@" Project Id = %@", dictionaryForUserID);
NSURL *urlToDisplayInListView = [NSURL URLWithString:[NSString stringWithFormat:@"http://some url/%@", dictionaryForUserID]]; **//Pass this object to other viewcontroller**
}
}
}];