IOS开发的新手,在处理表格上的单元格选择时遇到问题.每当我选择时,该方法都不会在下面调用 - 任何想法为什么?
我的项目结构是:View Controller - > View - > Table View
下面的代码演示了方法调用.其他人被称为没有问题!我知道触摸工作正在下拉成功刷新,点击一个单元格确实突出显示.
import UIKit
class ViewController: UIViewController, UITableViewDelegate
{
let blah = ["blah1"]
//How many sections are in the table?
func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return 1
}
//How many rows? (returns and int)
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return blah.count
}
//table contents for each cell?
//Each time this is called it'll return the next row and thus build a table...
func tableView(tableView: …Run Code Online (Sandbox Code Playgroud) 我已经爬了很多不同的答案,但我仍然有点混淆我应该如何处理Facebook 访问令牌.我遇到的主要问题之一是由于我的浏览器中存储了哪些信息.例如,我登录到应用程序,令牌过期,除非我在浏览器中清除cookie/app设置,否则我无法再次登录.
我偶然发现了这个线程:如何在offline_access弃用后扩展访问令牌的有效性
这告诉我如何通过php创建扩展访问令牌.
我的问题是:
1.我是否需要将访问令牌存储在任何地方?
2.访问令牌过期或变为无效时会发生什么?目前,我的应用程序只是在短期访问过期时停止工作.
3.有没有办法处理它们以检查它们是否已过期?我正在使用php sdk并且基本上使用了标准if($ user)...像这样:
require 'sdk/src/facebook.php';
$facebook = new Facebook(array(
'appId' => 'XXXXXXXXXXXXXXXXXXXXX',
'secret' => 'XXXXXXXXXXXXXXXXXXXXX',
));
$user = $facebook->getUser();
if( $user ){
try{
$user_profile = $facebook->api('/me');
} catch (FacebookApiException $e) {
error_log($e);
$user = null;
}
}
if (!$user){
$params = array(
'scope' => 'email',
);
$loginUrl = $facebook->getLoginUrl( $params );
echo '<script type="text/javascript">
window.open("'. $loginUrl .'", "_self");
</script>';
exit;
}
if( $user ){
$access_token = $facebook->getExtendedAccessToken();
$get_user_json …Run Code Online (Sandbox Code Playgroud)