追了一下可能的問題是在於 Facebook SDK 的設計:
id<FBGraphUser> friend
id<FBGraphUserExtraFields> user
然後範例都教人使用:
user.id 或 [user id]
解法:
[user objectForKey:@"id"]
只要透過存取方式的修改,即可避開。
id<FBGraphUser> friend
id<FBGraphUserExtraFields> user
user.id 或 [user id]
[user objectForKey:@"id"]
location ~^ /ci/ {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
}
location ~^ /ci/ {
auth_basic "Restricted";
auth_basic_user_file htpasswd;
# for codeigniter
index index.html index.htm index.php;
try_files $uri $uri/ /ci/index.php;
# for php
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
$ apt-get update && apt-get upgrade && apt-get dist-upgrade
$ adduser userid
$ vim /etc/group
sudo:userid
$ vim /etc/hostname
$ hostname -F /etc/hostname
$ vim /etc/hosts
127.0.1.1 YourName
$ apt-get install denyhosts
$ vim /etc/hosts.allow
# whilelist
sshd: MyIP : allow
$ apt-get install nginx php5-cli php5-fpm mysql-server phpmyadmin
$ nginx -v
nginx version: nginx/1.1.19
$ php -v
PHP 5.3.10-1ubuntu3.9 with Suhosin-Patch (cli) (built: Dec 12 2013 04:27:25)
$ php5-fpm -v
PHP 5.3.10-1ubuntu3.9 (fpm-fcgi) (built: Dec 12 2013 04:31:25)
$ vim /etc/nginx/sites-available/default
server {
# …
index index.html index.htm index.php;
# …
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
# NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
# With php5-cgi alone:
fastcgi_pass 127.0.0.1:9000;
# With php5-fpm:
#fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
# http://wiki.nginx.org/Codeigniter
location /ci_proj/ {
index index.html index.htm index.php;
try_files $uri $uri/ /ci_proj/index.php;
}
# …
}
$ service nginx restart
$ ln -s /usr/share/phpmyadmin/ /usr/share/nginx/www/phpmyadmin
$ sudo service php5-fpm restart
$ vim /etc/phpmyadmin/config.inc.php
/* Authentication type */
$cfg['Servers'][$i]['AllowRoot'] = FALSE;
$ mysql -u db_account -p -D db_name < db_backup.sql
- (IBAction)AUIButtonEvent:(id)sender {
// Step 1 : doing …
// Step N : fire a segue event
[self performSegueWithIdentifier:@"ChangeViewController" sender:sender];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:@"ChangeViewController"]) {
UIViewController *target = segue.destinationViewController;
if ([target isKindOfClass:[UINavigationController class]]) {
target = [[(UINavigationController *)target viewControllers] lastObject];
}
if([target isKindOfClass:[BUIViewController class]]) {
BUIViewController *v = (BUIViewController *)target;
// … other setting …
}
}
}