小编Phi*_*hil的帖子

iOS 8和Swift中的MapKit

我正在尝试在iOS 8上使用MapKit并且我不断收到错误:

Trying to start MapKit location updates without prompting for location authorization. Must call   
-[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager 
requestAlwaysAuthorization] first. 
Run Code Online (Sandbox Code Playgroud)

在这里查找,我发现我必须NSLocationWhenInUsageDescription在我的plist中实现并且也调用locationManager.requestWhenInUseAuthorization()但没有任何反应,我仍然在控制台中得到错误.我究竟做错了什么?

mapkit ios swift ios8

7
推荐指数
3
解决办法
1万
查看次数

警告:缺少1个参数

知道我为什么会收到这个错误:

Warning: Missing argument 1 for person::__construct(), called in /home/fishbein/public_html/dev/OOP/index.php on line 5 and defined in /home/fishbein/public_html/dev/OOP/class_lib.php on line 6

Warning: Missing argument 1 for person::__construct(), called in /home/fishbein/public_html/dev/OOP/index.php on line 6 and defined in /home/fishbein/public_html/dev/OOP/class_lib.php on line 6
Run Code Online (Sandbox Code Playgroud)

使用此代码:

<?
    class person {

            var $name;

            function __construct($persons_name) {       
            $this->name = $persons_name;        
            }

            function set_name($new_name) {
                $this->name = $new_name;
            }

            function get_name() {
                return $this->name;
            }

    }
?>
Run Code Online (Sandbox Code Playgroud)

我也在我的索引文件中使用它:

$tyler = new person("Tyler");
Run Code Online (Sandbox Code Playgroud)

php constructor warnings

6
推荐指数
1
解决办法
3万
查看次数

标签 统计

constructor ×1

ios ×1

ios8 ×1

mapkit ×1

php ×1

swift ×1

warnings ×1