小编use*_*697的帖子

Swift:返回self类型的数组

我想编写一个类函数,它将返回类类型的数组.据我所知,我可以使用"Self"作为objective-c"instanceType".我的目标是使用fetchObjects方法为NSManagedObject创建扩展.此方法将返回NSManagedObject子类的数组.这是我的伪代码的一个例子,它不编译:

extension NSManagedObject {

    class func fetchObjects(entity: String, context: NSManagedObjectContext, predicate: NSPredicate?, sortDescriptors: NSSortDescriptor[]?) -> Self[] {
        // can't define return type of an array with type Self
        // also var declaration does not work
        var objects : Self[]?

        return objects
    }
}
Run Code Online (Sandbox Code Playgroud)

知道如何定义Self类型的数组吗?

谢谢你的帮助!

arrays types ios swift

14
推荐指数
1
解决办法
4164
查看次数

Mac OS X Build Server缺少IPA中的archived-expanded-entitlements.xcent文件

我正在尝试使用Xcode 6.1.1和Mac OS X Server 4.0.3以及OS X 10.10.2归档项目.使用"adHoc"配置对应用程序进行签名可在集成中进行.但现在我遇到了问题,文件".entitlements"没有得到正确处理.

当我下载xcarchive时,archived-expanded-entitlements.xcent是应用程序包的一部分,但在相同集成的IPA文件中,文件丢失,因此我无法将其安装在设备上.是否具有"adHoc"证书的xcarchive导出不像处理企业或开发配置那样处理权限?如果是这样,我应该如何配置使用"adHoc"配置创建archived-expanded-entitmentments.xcent的项目?

谢谢你的帮助

macos xcode continuous-integration ios server

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

标签 统计

ios ×2

arrays ×1

continuous-integration ×1

macos ×1

server ×1

swift ×1

types ×1

xcode ×1