我正在使用以下命令从命令行构建/运行IOS应用程序:
xcodebuild -sdk "${TARGET_SDK}" -xcconfig "${CONFIG_FILE_PATH}" -configuration Release
/usr/bin/xcrun -sdk "${TARGET_SDK}" PackageApplication -v "${PROJECT_BUILD_DIR}/${APPLICATION_NAME}.app" -o "${OUTPUT_DIR}/${APPLICATION_NAME}.ipa"
Run Code Online (Sandbox Code Playgroud)
是否有任何清理目标的命令.或者这些命令负责清洁自己.
任何人都能告诉我代理函数所做的所有场景除了第一次启动应用程序时,IOS还会调用FininLaunchingWithOptions.我使用XCode将应用程序启动到设备中并删除了连接,然后尝试通过wifi向设备发送消息.然后我注意到didFinishLaunchingWithOptions被调用的次数很少.为什么会发生这种情况以及调用此函数的条件是什么.我无法弄清楚所有场景.提前致谢.
在我的数据库服务器上,我将数据插入一个自动增量字段为'id'的表中.现在我想在后续步骤中使用最后插入的'id'的值.我可以用这个: -
select * from table_name order by id desc limit 1;
Run Code Online (Sandbox Code Playgroud)
但这里的问题是,它是一个服务器,可能会发生更多的插入,可能有一种情况,我试图用我提到的查询检索数据,并得到一个不同的ID即.在我的插入和选择之间可能有一些其他插入,我不会得到我插入的值.可以解决这个问题的任何方式.
提前致谢.
我一直在试图找出的意义ngAfterContentChecked(),并 ngAfterViewChecked()在一段时间.曾尝试过各种帖子,但仍无法理解其确切含义.以下是angular.io中给出的定义.有人可以用一些好的例子来解释它.
ngAfterViewChecked()- Respond after Angular checks the component's views and child views.
Called after the ngAfterViewInit and every subsequent ngAfterContentChecked().
A component-only hook.
ngAfterContentChecked()- Respond after Angular checks the content projected into the component.
Called after the ngAfterContentInit() and every subsequent ngDoCheck().
A component-only hook.
Run Code Online (Sandbox Code Playgroud) 我正在使用phonegap/cordova 2.1.0开发移动应用程序(IOS/android)UI.我想在新窗口/页面中打开锚标记的href属性中给出的链接.我试过了 :
target="_blank"
Run Code Online (Sandbox Code Playgroud)
但它不适用于IOS.有没有可用的解决方法?谢谢
我在iOS/android中创建应用程序.当设备收到远程通知时,didReceiveRemoteNotification应该被呼叫.但它没有发生.我通过APNS发送消息的服务器端代码如下:
$deviceToken = $obj_listener->ref_id;
// Put your private key's passphrase here:
$passphrase = 'blahblah';
$ctx = stream_context_create();
stream_context_set_option($ctx, 'ssl', 'local_cert', '/var/www/mobileapp/TestAppCK.pem');
stream_context_set_option($ctx, 'ssl', 'passphrase', $passphrase);
// Open a connection to the APNS server
$fp = stream_socket_client(
'ssl://gateway.sandbox.push.apple.com:2195', $err,
$errstr, 60, STREAM_CLIENT_CONNECT|STREAM_CLIENT_PERSISTENT, $ctx);
if (!$fp){
$this->log->debug("Failed to connect: $err $errstr" . PHP_EOL);
exit("Failed to connect: $err $errstr" . PHP_EOL);
}
$badge_count = $obj_listener->badge_count + 1;
// Create the payload body
$body['aps'] = array(
//'alert' => 'Message received',
'sound' => …Run Code Online (Sandbox Code Playgroud) 我在 IOS 中创建了一个应用程序,并希望通过命令行构建和运行它。xcodebuild 命令有助于构建应用程序,其基本语法如下:
xcodebuild -target "${TARGET_NAME}" -sdk "${TARGET_SDK}" -configuration Release -xcconfig "${BUILD_SETTINGS_FILE_PATH}"
Run Code Online (Sandbox Code Playgroud)
每个目标都将包含其产品名称和其他构建设置。现在我不想采用 xcode 目标中指定的产品名称/构建设置,而是通过一些可以包含构建设置的外部文件。所以,我尝试使用该-xcconfig选项,但我不清楚它的实现。它应该是什么类型的文件以及如何配置文件的路径?。官方文档似乎也不太清楚。
我在Bitbucket存储库中启用了管道,每次构建后,我都需要运行Angular 2构建并在服务器中部署dist文件夹(在执行build命令后创建)。
我的bitbucket-pipelines.yml文件中包含以下内容:
image: node:4.6.0
pipelines:
default:
- step:
script: # Modify the commands below to build your repository.
- npm install
- npm run build:prod
Run Code Online (Sandbox Code Playgroud)
我在Internet上找到了以下代码片段:
- apt-get update
- apt-get -qq install git-ftp
- git ftp push --user $FTP_USERNAME --passwd $FTP_PASSWORD ftp://123.456.789.123/timount/angular_app
Run Code Online (Sandbox Code Playgroud)
我使用pem文件通过SSH客户端登录到服务器。那么上面的代码片段有用吗?如果没有,如何在上述命令中使用pem文件?
为了更加清楚,npm run build:prod命令实际上创建了dist文件夹,该文件夹需要部署在上述位置的服务器上。我该如何实现?
我正在从我的客户端向 google oauth 2 API'https://accounts.google.com/o/oauth2/auth?redirect_uri=http://blah.com&response_type=token&client_id....'进行ajax 调用以获取访问令牌,但出现以下错误:
对预检请求的响应未通过访问控制检查:请求的资源上不存在“Access-Control-Allow-Origin”标头。因此,不允许访问来源 ' http://blah-blah.com '
我希望调用是 ajax,以便在调用时不会打扰用户,url或者window.location.href换句话说,我如何获取访问令牌以使整个页面不加载,并且是否可以解决上述问题错误???
我正在尝试从命令行构建/运行我的iOS应用程序。要构建应用程序,我在shell脚本中给出的命令如下:
PROJECT_DIR="/Users/ingenyous/Desktop/splistV11_test_sh_build/code/app/ios"
TARGET_NAME="splistapp2"
TARGET_SDK="iphoneos5.1"
PROJECT_BUILD_DIR="${PROJECT_DIR}/build/Release-iphoneos"
OUTPUT_DIR="/Users/ingenyous/Desktop/ipa"
# compile project
echo Building Project
cd "${PROJECT_DIR}"
xcodebuild -target "${TARGET_NAME}" -sdk "${TARGET_SDK}" -configuration Release
Run Code Online (Sandbox Code Playgroud)
在这里,我指定目标名称和其他参数。是否可以在此脚本本身中提供目标属性,例如产品名称和其他选项,从而可以覆盖编辑器目标中实际提供的属性。或者可以通过Shell脚本本身创建目标,而无需通过Xcode编辑器创建目标。
我试图异步调用服务器(ARC -on):
NSURLConnection *theConnection=[[NSURLConnection alloc] initWithRequest:request delegate:self];
if (theConnection) {
content = [NSMutableData data];
NSLog(@"responseData from setup.php: %@", content);
} else {
// Inform the user that the connection failed.
NSLog(@"error from server response in set up");
}
- (void)connection:(NSURLConnection *)connection didReceiveResponse:(NSURLResponse *)response
{
NSLog(@"connection did receive response");
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
[content appendData:data];
NSLog(@"connection did receive data");
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection
{
NSLog(@"connection did finish load");
NSLog(@"Succeeded! Received %@ bytes of data",receivedData);
}
Run Code Online (Sandbox Code Playgroud)
但是我从服务器获取内容时遇到问题:-在didReceiveData函数中,出现以下错误:-'NSString'没有可见的@interface声明选择器'appendData'
有人可以建议我哪里我错了吗?
我的路由文件中有以下代码:
router.post('/submit', function(req, res) {
var email = req.body.email;
console.log(email);
});
Run Code Online (Sandbox Code Playgroud)
我正在从邮递员那里拨打电话,并提供以下详细信息: http://localhost:3000/login/submit
参数:
email=abcxyz@gmail.com
Run Code Online (Sandbox Code Playgroud)
和标题我都试过了
Content-Type:application/json
Run Code Online (Sandbox Code Playgroud)
和
Content-Type: application/x-www-form-urlencoded
Run Code Online (Sandbox Code Playgroud)
另外,我在 app.js 中单独安装了正文解析器,并带有以下内容
var bodyParser = require('body-parser');
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: true }));
Run Code Online (Sandbox Code Playgroud)
但是,电子邮件的控制台日志显示“未定义”。为什么我无法使用 req.body.email 获取帖子参数。
我想完成上传文件拖动:我正在使用ng2-file-upload版本1.2.1以及以下代码片段:
app.module.ts:
import { FileUploadModule } from 'ng2-file-upload/ng2-file-upload';
..
imports: [
FileUploadModule
]
Run Code Online (Sandbox Code Playgroud)
component.ts:
import { FileUploader } from 'ng2-file-upload/ng2-file-upload';
...
class AppXYZComponent{
private uploader: FileUploader = new FileUploader({ url: 'blah.com' });
public hasBaseDropZoneOver:boolean = false;
//public hasAnotherDropZoneOver:boolean = false;
public fileOverBase(e:any):void {
console.log("hasBaseDropZoneOver", e);
this.hasBaseDropZoneOver = e;
}
}
Run Code Online (Sandbox Code Playgroud)
app.component.html:
<div class="well" ng2FileDrop [uploader]="uploader" [ngClass]="{'another-file-over-class': hasBaseDropZoneOver}"
(fileOver)="fileOverBase($event)"
>
Drop CSV here
</div>
Run Code Online (Sandbox Code Playgroud)
函数fileOverBase在拖动时成功调用,事件e打印为true.现在我如何获得拖动文件的对象?
angular-file-upload angular2-directives ng2-file-upload angular