由于新的Firebase Cloud Functions(版本> 1.0)。我只需要打电话
admin.initializeApp();
Run Code Online (Sandbox Code Playgroud)
没有任何参数。
但是,当我这样做时,然后运行firebase deploy --only函数,就会发生此错误:
无法从文件G:\ projects \ ANOTHER_PROJECT \ ANOTHER_PROJECT.json中读取凭据:错误:ENOENT:没有此类文件或目录,请打开“ G:\ projects \ ANOTHER_PROJECT \ ANOTHER_PROJECT.json”
Run Code Online (Sandbox Code Playgroud)service bots stop service bots start
* / 5 * * * * /home/vps171-107/runcron.sh
如何使runcron.sh停止然后在crontab中启动bots服务?
更新
在@armnotstrong的帮助下,我将脚本更改为
/usr/sbin/service bots stop
/usr/sbin/service bots start
Run Code Online (Sandbox Code Playgroud)
而且有效!
我遇到了UIImage的问题.我已经手动将UIImageView对象添加到滚动视图中.问题是:当我有超过50个图像时,内存将增加到大约200MB,并且应用程序将在iphone 4或4s上崩溃.当我收到内存警告以防止崩溃但我不知道如何使用Swift释放它们时,我想为不可见部分的图像释放内存.请帮帮我.
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
func loadImage(index:Int){
if self.imgPaths.count == 0 {
println("Has not data")
actInd.stopAnimating()
return
}
var imgURL: NSURL = NSURL(string: self.imgPaths[index].stringByTrimmingCharactersInSet(.whitespaceAndNewlineCharacterSet()))!
let width:CGFloat = self.view.bounds.width
let height:CGFloat = self.view.bounds.height
var view:UIView = UIView(frame: CGRectMake(0, 0, width, height));
if let imgObj = self.dicData[index] {
}
else
{
println("imgURL \(imgURL)")
let request: NSURLRequest = NSURLRequest(URL: imgURL)
NSURLConnection.sendAsynchronousRequest(request, queue: NSOperationQueue.mainQueue(), completionHandler: {(response: NSURLResponse!,data: NSData!,error: NSError!) -> Void in …Run Code Online (Sandbox Code Playgroud)