info.plist添加密钥

时间:2015-08-06 21:30:53

标签: xcode info.plist

非常简单的问题:如何将此添加到info.plist?有多个info.plist文件,我只能看到如何添加一行。

<?php include_once('header.php'); ?>
<?php include_once('config/db.php'); ?>




<div id="newform">
    <form role="form">
        <div class="form-group">
            <label for="user">User</label>
            <input type="text" class="form-control" id="user" placeholder="Username"> 
        </div>
        <div class="form-group">
            <label for="rank">Rank</label>
            <select class="form-control" name="rank">
                <option value="1">Noob</option>
                <option value="2">Semi-Noob</option>
            </select>
        </div>
        <div class="form-group">
            <label for="date">Date</label>
            <input type="text" class="form-control" id="date" placeholder="<?php echo date('d M y'); ?>">
        </div>
        <div class="form-group">
            <label for="tag">Tag</label>
            <input type="text" class="form-control" id="tag" placeholder="Tag">
        </div>      
        <center>
        <button type="submit" class="btn btn-default">Submit</button>
        </center>
    </form>
</div>

<?php
if(isset($_POST['submit'])){
//Values to be inserted into the DB
$user = $_POST['user'];
$rank = $_POST['rank'];
$date = $_POST['date'];
$tag  = $_POST['tag'];

//Preparing the statement
$query = "INSERT INTO players (user, rank, date, tag) VALUES(?, ?, ?)";
$statement = $mysqli->prepare($query);

//Binding Parameters for markers, where (s = string, i = integer, d = double, b = blob)
$statement->bind_param('siss', $user, $rank, $date, $tag);

//Execution
if($statement->execute()){
    header('Location: home.php');
}else{
    die('Error : ('.$mysqli->errno .') '. $mysqli->error);
}
$statement->close();
}
?>

<?php include_once('footer.php'); ?>

1 个答案:

答案 0 :(得分:3)

如果您有多个目标,则每个目标都有一个名为[TARGET-NAME]-Info.plist的单独的PList文件。

您可以通过单击加号图标添加它,然后在“key”下面写NSAppTransportSecurity并选择type作为字典。然后打开它(左侧的箭头应朝下)并单击该行的加号图标,这将在NSAppTransportSecurity条目下添加 下的新条目。现在,您应该在新创建的条目中编写NSAllowsArbitraryLoads,并将其选为值为YES的布尔值。

如果您使用外部编辑器编辑文件,则只需将上述代码粘贴到最后一个</plist>标记之前。