我刚刚意识到Facebook URI方案发布功能不再起作用了.它打开了Facebook应用程序,但仅此而已.有没有办法通过URI方案发布内容?
你可以在下面找到我的代码.
NSString *post = [NSString stringWithFormat:@"fb://publish/profile/me?text=foo"];
[[UIApplication sharedApplication] openURL:[NSURL URLWithString:post]];
Run Code Online (Sandbox Code Playgroud) 我有一个使用故事板的标签栏控制器应用程序.每个选项卡都有一个UIWebview.我想在用户单击Webview上的链接时捕获链接,如果链接是外部链接(如果它不是我的站点)我想在不同的UIViewControl中打开链接.(就像一个popupi Twitter iphone应用程序那样做)
马上; 我有这个代码捕获链接(如果链接是bing.com然后它应该打开它另一个视图控制器)但我无法打开另一个UIViewController(在这种情况下PopViewController).它给了我这个错误:
'GundemViewController'没有可见的@interface声明选择器'pushViewController:animated:'
- (BOOL)webView:(UIWebView*)webView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType {
//CAPTURE USER LINK-CLICK.
NSURL *url = [request URL];
NSString *urlString = [url absoluteString];
/******
UIWebViewNavigationTypeLinkClicked: When user click on a link in the app it senses the action
*/
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
if ([urlString hasPrefix:@"http://www.bing.com/"]) {
PopViewController *popUpView = [[PopViewController alloc] initWithNibName:@"PopupViewController" bundle:nil];
[self pushViewController:popUpView animated:YES];
return NO;
}
}
return YES;
}
Run Code Online (Sandbox Code Playgroud) 我有一个列表列表,我想添加面向列的值。就像下面的代码示例一样:
Data = new List<List<double>>();
for (int i = 0; i < columnCount; i++)
{
for (int j = 0; j < rowCount; j++)
{
Data[j][i] = (probabilityList[j]) * K); // It won't work
}
}
Run Code Online (Sandbox Code Playgroud)
我知道它不起作用,因为当前情况下数据的索引不存在,我需要使用 add() 方法。
但是,我需要将值添加到以列开头的列表:
[1 , null] ----> [1, null]
[null, null] [2, null]
Run Code Online (Sandbox Code Playgroud)
如何将值添加到以列开头的列表列表中?