質問編集履歴
5
問題箇所と関係ない為、削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -50,70 +50,6 @@
|
|
50
50
|
|
51
51
|
|
52
52
|
|
53
|
-
--Swiftソース--
|
54
|
-
|
55
|
-
public class GetIosSsid : NSObject {
|
56
|
-
|
57
|
-
@objc public static func swiftMethod() -> Void {
|
58
|
-
|
59
|
-
print("Start!!")
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
var interfaces: CFArray?
|
64
|
-
|
65
|
-
interfaces = CNCopySupportedInterfaces()
|
66
|
-
|
67
|
-
if interfaces == nil {
|
68
|
-
|
69
|
-
print("interfaces Null")
|
70
|
-
|
71
|
-
return;
|
72
|
-
|
73
|
-
}
|
74
|
-
|
75
|
-
var count: Int?
|
76
|
-
|
77
|
-
count = CFArrayGetCount(interfaces)
|
78
|
-
|
79
|
-
if count == nil{
|
80
|
-
|
81
|
-
print("count Null")
|
82
|
-
|
83
|
-
return;
|
84
|
-
|
85
|
-
}
|
86
|
-
|
87
|
-
if count! > 0 {
|
88
|
-
|
89
|
-
print("Count=(count!)")
|
90
|
-
|
91
|
-
if count == 1 {
|
92
|
-
|
93
|
-
let interfaceData = unsafeInterfaceData as NSDictionary!
|
94
|
-
|
95
|
-
let ssid = interfaceData!["SSID"] as! String
|
96
|
-
|
97
|
-
let bssid = interfaceData!["BSSID"] as! String
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
print("count=1");
|
102
|
-
|
103
|
-
}
|
104
|
-
|
105
|
-
}
|
106
|
-
|
107
|
-
print("End")
|
108
|
-
|
109
|
-
return;
|
110
|
-
|
111
|
-
}
|
112
|
-
|
113
|
-
}
|
114
|
-
|
115
|
-
|
116
|
-
|
117
53
|
|
118
54
|
|
119
55
|
### 試したこと
|
4
エラー内容を追記
test
CHANGED
File without changes
|
test
CHANGED
@@ -16,19 +16,27 @@
|
|
16
16
|
|
17
17
|
太字の箇所で
|
18
18
|
|
19
|
-
C++ requires a type specifier for all declarations
|
19
|
+
・C++ requires a type specifier for all declarations
|
20
|
+
|
21
|
+
・Expected ')'
|
22
|
+
|
23
|
+
・Expected external declaration
|
24
|
+
|
25
|
+
・Expected ';' after top level declarator insert ';'
|
20
26
|
|
21
27
|
のエラーがでています。
|
22
28
|
|
23
|
-
|
29
|
+
自動生成されるメソッドなので、修正方法がわかりません。
|
30
|
+
|
31
|
+
コーディングミスでしょうか。
|
32
|
+
|
33
|
+
ご教示いただけると助かります。
|
24
34
|
|
25
35
|
|
26
36
|
|
27
37
|
### 該当のソースコード
|
28
38
|
|
29
|
-
ProductName-Swift.h
|
39
|
+
--ProductName-Swift.h内エラー箇所--
|
30
|
-
|
31
|
-
|
32
40
|
|
33
41
|
SWIFT_CLASS("_TtC11UnityIphone10GetIosSsid")
|
34
42
|
|
@@ -36,9 +44,75 @@
|
|
36
44
|
|
37
45
|
+ (void)swiftMethod;
|
38
46
|
|
39
|
-
**- (nonnull instancetype)init S
|
47
|
+
**- (nonnull instancetype)init OBJC_DESIGNATED_INITIALIZER;**
|
40
48
|
|
41
49
|
@end
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
--Swiftソース--
|
54
|
+
|
55
|
+
public class GetIosSsid : NSObject {
|
56
|
+
|
57
|
+
@objc public static func swiftMethod() -> Void {
|
58
|
+
|
59
|
+
print("Start!!")
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
var interfaces: CFArray?
|
64
|
+
|
65
|
+
interfaces = CNCopySupportedInterfaces()
|
66
|
+
|
67
|
+
if interfaces == nil {
|
68
|
+
|
69
|
+
print("interfaces Null")
|
70
|
+
|
71
|
+
return;
|
72
|
+
|
73
|
+
}
|
74
|
+
|
75
|
+
var count: Int?
|
76
|
+
|
77
|
+
count = CFArrayGetCount(interfaces)
|
78
|
+
|
79
|
+
if count == nil{
|
80
|
+
|
81
|
+
print("count Null")
|
82
|
+
|
83
|
+
return;
|
84
|
+
|
85
|
+
}
|
86
|
+
|
87
|
+
if count! > 0 {
|
88
|
+
|
89
|
+
print("Count=(count!)")
|
90
|
+
|
91
|
+
if count == 1 {
|
92
|
+
|
93
|
+
let interfaceData = unsafeInterfaceData as NSDictionary!
|
94
|
+
|
95
|
+
let ssid = interfaceData!["SSID"] as! String
|
96
|
+
|
97
|
+
let bssid = interfaceData!["BSSID"] as! String
|
98
|
+
|
99
|
+
|
100
|
+
|
101
|
+
print("count=1");
|
102
|
+
|
103
|
+
}
|
104
|
+
|
105
|
+
}
|
106
|
+
|
107
|
+
print("End")
|
108
|
+
|
109
|
+
return;
|
110
|
+
|
111
|
+
}
|
112
|
+
|
113
|
+
}
|
114
|
+
|
115
|
+
|
42
116
|
|
43
117
|
|
44
118
|
|
@@ -46,7 +120,9 @@
|
|
46
120
|
|
47
121
|
|
48
122
|
|
49
|
-
|
123
|
+
';'を文末に追加してみたが、エラー内容は変わらずです。
|
124
|
+
|
125
|
+
別のObjective-CプロジェクトでSwiftを呼ぶと問題なく動きました。
|
50
126
|
|
51
127
|
|
52
128
|
|
3
タイトルの修正
test
CHANGED
@@ -1 +1 @@
|
|
1
|
-
|
1
|
+
<プロジェクト名>-Swift.hのエラー
|
test
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
XCodeでビルドエラー
|
12
12
|
|
13
|
-
自動生成される
|
13
|
+
自動生成される"<プロジェクト名>-Swift.h"で作成していないメソッドでエラーになっています。
|
14
14
|
|
15
15
|
|
16
16
|
|
2
初心者マークのつけ忘れ
test
CHANGED
File without changes
|
test
CHANGED
File without changes
|
1
文末の修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
### 前提・実現したいこと
|
2
2
|
|
3
|
-
UnityでiOS のネイティブプラグインを Swiftでコーディング
|
3
|
+
UnityでiOS のネイティブプラグインを Swiftでコーディング。
|
4
4
|
|
5
5
|
|
6
6
|
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
XCodeでビルドエラー
|
12
12
|
|
13
|
-
自動生成される「ProductName-Swift.h」で作成していないメソッドでエラーになってい
|
13
|
+
自動生成される「ProductName-Swift.h」で作成していないメソッドでエラーになっています。
|
14
14
|
|
15
15
|
|
16
16
|
|
@@ -18,7 +18,9 @@
|
|
18
18
|
|
19
19
|
C++ requires a type specifier for all declarations
|
20
20
|
|
21
|
-
のエラーがでてい
|
21
|
+
のエラーがでています。
|
22
|
+
|
23
|
+
追加したメソッドではないので、修正方法がわかりません。
|
22
24
|
|
23
25
|
|
24
26
|
|