小编And*_*eev的帖子

Firestore 查询的默认限制是多少?

假设我有一个mycollection包含 1,000,000 条记录的集合。

此查询将返回多少条记录?

const query = firestore.collection('mycollection').get()
Run Code Online (Sandbox Code Playgroud)

我在文档中找不到。

google-cloud-firestore

11
推荐指数
1
解决办法
4725
查看次数

tSQL NOT IN查询

我想获取[interaction]表的ID,但这些ID不能等于[EmailOUT]表.我无法编写查询.

Select ID from EmailOut         
where ID NOT IN         
   (select ID from
    [172.28.101.120].[GenesysIS].dbo.interactions 
    where media_type = 'email'
    and type = 'Outbound')
Run Code Online (Sandbox Code Playgroud)

类似的东西.我想在交互表中输出外发电子邮件,但这些电子邮件可能存在于EmailOut表中.我想删除它们.出站电子邮件数约为300,但此查询结果应小于300

sql t-sql sql-server notin

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

Flutter iOS 应用程序在启动时显示白屏并在该屏幕上挂断

我有一个使用 firebase auth 库的 flutter 应用程序。当我启动它的 iOS 版本时,它向我显示一个空白的白色屏幕并在该屏幕上挂断。我按照所有步骤将一些与 firebase 相关的标志添加到 Info.plist 中,例如 FirebaseScreenRecordingEnabled - NO、FirebaseScreenRecordingDeactiv - YES 以及一两个。我试图清理构建文件夹和颤振缓存。刚刚也尝试了以下答案: iOS Flutter with Firebase : white screen and SIGABRT in FlutterAppDelegate on launch

~/Documents/Work/Workspaces/flutter/myapp $ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[?] Flutter (Channel master, v1.10.7-pre.80, on Mac OS X 10.15.2 19C57, locale en-IN)

[?] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
[?] Xcode - develop for iOS and macOS (Xcode 11.2) …
Run Code Online (Sandbox Code Playgroud)

ios flutter

9
推荐指数
2
解决办法
8330
查看次数

Swift泛型错误:无法将"Type <T>"类型的值转换为预期的参数类型"Type <_>"

请考虑以下设置:

protocol MyProcotol {
}

class MyModel: MyProcotol {
}

enum Result<T> {
    case success(value: T)
    case failure
}

class Test {
    func test<T: MyProcotol>(completion: (Result<T>) -> Void) {
        let model = MyModel()
        let result = Result.success(value: model)
        completion(result)
    }
}
Run Code Online (Sandbox Code Playgroud)

我为什么不打电话completion(result)?我收到这个错误:

无法将"结果"类型的值转换为预期的参数类型"结果<_>"

任何解决方法?

generics swift

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

如果physicsBody.dynamic属性为NO,则两个物理实体不联系

有两个物理机构:a AirplaneNode:

- (id)initAirplaneNode {
    self = [super initWithImageNamed:@"airplane.png"];
    if (self) {
        self.name = @"player";
        self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.frame.size];
        self.physicsBody.dynamic = NO;
        self.physicsBody.affectedByGravity = NO;
        self.physicsBody.categoryBitMask = AIRPLANE_CATEGORY;
        self.physicsBody.contactTestBitMask = BULLET_CATEGORY;
    }
    return self;
}
Run Code Online (Sandbox Code Playgroud)

和a BulletNode:

- (id)initBulletNode {    
    self = [super initWithImageNamed:@"bullet.png"];
    if (self) {
        self.name = @"bullet";
        self.physicsBody = [SKPhysicsBody bodyWithRectangleOfSize:self.frame.size];
        self.physicsBody.dynamic = NO;
        self.physicsBody.usesPreciseCollisionDetection = YES;
        self.physicsBody.categoryBitMask = BULLET_CATEGORY;
        self.physicsBody.contactTestBitMask = AIRPLANE_CATEGORY;
    }
    return self;
}
Run Code Online (Sandbox Code Playgroud)

他们都有physicsBody.dynamic财产设置NO.

问题是当子弹击中飞机时,我SKScene不会打电话给 …

objective-c collision-detection game-physics ios sprite-kit

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

collectionView:cellForItemAtIndexPath:为什么我的视图没有子视图?

请考虑以下代码:

func collectionView(collectionView: UICollectionView, cellForItemAtIndexPath indexPath: NSIndexPath) -> UICollectionViewCell {
    let cell = collectionView.dequeueReusableCellWithReuseIdentifier("DataItemCell", forIndexPath: indexPath) as DataItemCollectionViewCell

    println("\(cell.parametersView.subviews.count)")

    return cell
}
Run Code Online (Sandbox Code Playgroud)

和单元格的视图层次结构:

查看层次结构

我无法弄清楚为什么输出0.

我想要实现的是递归循环遍历所有的后代parametersView.

ios uicollectionviewcell swift

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

等同的实现似乎不适用于泛型

我仍然在与Swift仿制药作斗争.今天我发现我的Equatable协议实现不起作用,如果它是从泛型类调用的.

我的模特课:

func ==(lhs: Tracking, rhs: Tracking) -> Bool {
    // This method never executes if called from BaseCache
    return lhs.id == rhs.id 
}

class Tracking: NSObject, Equatable, Printable {
    var id: String?
    ..... 
}
Run Code Online (Sandbox Code Playgroud)

类,使用泛型类型:

class BaseCache<T: NSObject where T: Equatable, T: Printable>  {

    .....

    func removeEntities(entities: [T]) {
        var indexesToRemove = [Int]()
        for i in 0...allEntities.count - 1 {
            let item = allEntities[i]
            for entity in entities {
                println("equal: \(entity == item)")
                // FOR SOME REASONS THE STATEMENT …
Run Code Online (Sandbox Code Playgroud)

generics ios swift

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

MKMapView MKCircle呈现一个半径太大的圆圈

我面临着MKCircle外表的奇怪行为.基本上我正试图用一个任意的中心绘制一个半径为8500 km的圆.这是我的代码:

private func addCircle() {
    mapView.removeOverlays(mapView.overlays)
    let circle = MKCircle(centerCoordinate: mapCenter, radius: 8500000.0)
    mapView.addOverlay(circle)
}
Run Code Online (Sandbox Code Playgroud)

我还有一个自定义双击手势处理程序,它会覆盖地图视图的标准处理程序,并允许通过双击地图视图来更改地图中心:

private func configureGestureRecognizer() {
    doubleTapGestureRecognizer.addTarget(self, action: Selector("handleDoubleTap:"))
    doubleTapGestureRecognizer.numberOfTapsRequired = 2
    if let subview = mapView.subviews.first as? UIView {
        subview.addGestureRecognizer(doubleTapGestureRecognizer)
    }
    else {
        println("Can't add a gesture recognizer")
    }
}

@objc private func handleDoubleTap(sender: UITapGestureRecognizer) {
    let point = sender.locationInView(mapView)
    let location = mapView.convertPoint(point, toCoordinateFromView: mapView)
    mapCenter = location
    addCircles()
}
Run Code Online (Sandbox Code Playgroud)

结果很奇怪:

纽约市中心

位于纽约市北部的中心

您可能会注意到这两个半径之间存在显着差异:第二个半径比第一个半径大!

发生了什么,如何使它们正确显示?

编辑

感谢@blacksquare,我可以更接近解决方案,但仍然存在北极问题:

在此输入图像描述

(小圈jsut代表一个中心)

geolocation mkmapview ios swift

6
推荐指数
2
解决办法
2905
查看次数

获取拖动预览的框架

我正在UICollectionView使用iOS 11中引入的新Apple API 实现拖放操作.

我需要的是获得一个拖动预览框架(见下面,红色矩形) iOS在UICollectionView上拖放

我试图得到拖动的位置:

extension ViewController: UICollectionViewDropDelegate {
    func collectionView(_ collectionView: UICollectionView, 
         dropSessionDidUpdate session: UIDropSession, 
         withDestinationIndexPath destinationIndexPath: IndexPath?) -> UICollectionViewDropProposal {
        let location = session.location(in: collectionView)
    }
Run Code Online (Sandbox Code Playgroud)

但它只代表我手指的位置.我需要得到整个框架,或者至少是它的起源.

我也尝试将y触摸位置存储在我的单元格中然后执行类似的操作dragLocation.y - touchLocationInCell.y,但这种方法并不准确:看起来预览会从触摸位置获得一些偏移.

drag-and-drop ios uicollectionview swift

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

UIStackView - 使用动画隐藏和折叠子视图

我试图像这样隐藏UIStackView的子视图:

UIViewPropertyAnimator.runningPropertyAnimator(withDuration: 2.0, 
      delay: 0, options: [.curveEaseOut], animations: {
    self.label.isHidden = true
    self.label.alpha = 0.0
    self.stackView.layoutIfNeeded()
})
Run Code Online (Sandbox Code Playgroud)

但是,使用此代码时标签会立即消失.我怀疑这是因为设置isHidden为true,这是折叠所必需的.

有没有办法如何隐藏和折叠UIStackView的动画子菜单?或者根本不使用UIStackView可能会更好?

ios swift uistackview

5
推荐指数
1
解决办法
3450
查看次数