小编Mot*_*oth的帖子

构建纯Swift可可触摸框架

我正在使用Xcode-6探索Swift,到目前为止一直都很好,尽管我认为新的集合需要一些工作,因为我已经设法打破了编译器几次.

问题是我现在卡住尝试创建框架包然后在另一个项目中使用.项目构建没有问题,所有测试都成功通过.当我去创建Archive(我假设是必需的)时,我收到错误:

:0:错误:未找到基础Objective-C模块"Sample"

现在我假设这与我的Sample.h的内容有关,它告诉我

// In this header, you should import all the public headers of your framework using statements like #import <Sample/PublicHeader.h>
Run Code Online (Sandbox Code Playgroud)

这很好,除了我只使用了swift枚举,结构和类这个框架,因此没有.h文件存在.

任何人都可以对这一点有所了解,因为我找不到任何文件吗?

cocoa cocoa-touch swift xcode6

35
推荐指数
2
解决办法
2万
查看次数

Swift将委托设置为self赋予EXC_BAD_ACCESS

我正在通过移植现有的应用程序来学习Swift.我一直坚持设置代表,无法解决问题所在.

我有一个扩展UITableViewCell的类

import UIKit

protocol SwitchCellDelegate{
    func switchChanged(switchCell: SwitchCell, state: Bool)
}

class SwitchCell: UITableViewCell {

    @IBOutlet var swtSelector: UISwitch
    @IBOutlet var lblTitle: UILabel

    var delegate: SwitchCellDelegate?

    init(style: UITableViewCellStyle, reuseIdentifier: String) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
    }

    @IBAction func switchChanged(){
        delegate?.switchChanged(self, state: swtSelector.on)
    }

}
Run Code Online (Sandbox Code Playgroud)

然后在ViewController中定义为

class SettingsViewController: UIViewController, UITableViewDelegate, UITableViewDataSource, SwitchCellDelegate {
Run Code Online (Sandbox Code Playgroud)

并在方法内

func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!) -> UITableViewCell! {
Run Code Online (Sandbox Code Playgroud)

我们有

case 2:
    storeCredentialsCell = tableView.dequeueReusableCellWithIdentifier("StoreCredentialsCell") as? SwitchCell
    if(storeCredentialsCell != nil){
        ...
        NSLog("Setting delegate to %@ for …
Run Code Online (Sandbox Code Playgroud)

delegates exc-bad-access swift xcode6

11
推荐指数
2
解决办法
6363
查看次数

从java访问SMB2.1或SMB3共享?

由于Windows 2012R2不再支持SMB1协议而没有一些注册表黑客,使用Java中的SMB共享是否有任何成功,只支持SMB2.1或SMB3?JCIFS库显然只是SMB1,所以它出来了.我看到微软有一个用于Azure的Java库,但这似乎是利用服务而不是SMB.

java smb

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

标签 统计

swift ×2

xcode6 ×2

cocoa ×1

cocoa-touch ×1

delegates ×1

exc-bad-access ×1

java ×1

smb ×1