如何快速使用NMSSH [英] How to use NMSSH in swift
问题描述
几个月前,我开发了一个简单的IOs应用,通过 NMSSH 通过SSH控制Raspberry Pi,这个应用程序是用obj-c开发的,我想在Swift中也使用devellop,所以我将NMSSH库导入相同,然后按照
I developed a simple IOs app to control a Raspberry Pi through SSH using NMSSH few month ago, this app is developped with obj-c and I would like to devellop alost the same in Swift so i import the NMSSH library the same and I follow this to import nmssh with bridging so I can use the library in my swift file but i wan tto compile I have 117 error because xCode see NMSSH file like swift files and not obj-c files and I don't have any idea why or how to solve this. Sorry if that's a simple question but I try to learn Swift and as a french it's not pretty simple with all documentation in Engloish. Thanks.
推荐答案
First follow the instruction in iOS Developer library about using Swift with Objective-C. Second include:
#import <Foundation/Foundation.h>
然后NMSSH导入
#import <NMSSH/NMSSH.h>
在您的Bridging header
文件中
我对这个框架是陌生的,但是基金会似乎包含了原始对象的信息/定义.
I am new with this framework but it seems like the Foundation contain information/definition of primitive objects.
还要更详细地检查以下答案:如何调用Objective- Swift中的C代码
Also check this answer in more detail: How to call Objective-C code from Swift
这篇关于如何快速使用NMSSH的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!