回答編集履歴

4

修正

2016/06/25 10:19

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -42,6 +42,10 @@
42
42
 
43
43
  ```swift
44
44
 
45
+ // value: を追加
46
+
47
+
48
+
45
49
  //キャラクタリスティック設定
46
50
 
47
51
  characteristic = CBMutableCharacteristic(

3

修正

2016/06/25 10:19

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -36,7 +36,7 @@
36
36
 
37
37
 
38
38
 
39
- あと貼り付けて上記の部分もエラーになっていました、引数の数が違うみたいです。
39
+ あと貼り付けて`キャラクタリスティック設定`の部分もエラーになっていました、引数の数が違うみたいです。
40
40
 
41
41
 
42
42
 

2

修正

2016/06/25 10:19

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -4,15 +4,33 @@
4
4
 
5
5
  ```swift
6
6
 
7
- //キャラクタリスティック設定
7
+ class ViewController: UIViewController, CBPeripheralManagerDelegate {
8
8
 
9
- characteristic = CBMutableCharacteristic(
9
+
10
10
 
11
- type: characteristicUUID,
11
+ var characteristic: CBMutableCharacteristic!
12
12
 
13
- properties: properties,
13
+ ........
14
14
 
15
+
16
+
17
+ func publishService() {
18
+
19
+ ........
20
+
21
+
22
+
23
+ //キャラクタリスティック設定
24
+
25
+ characteristic = CBMutableCharacteristic(
26
+
27
+ type: characteristicUUID,
28
+
29
+ properties: properties,
30
+
15
- permissions: permissions)
31
+ permissions: permissions)
32
+
33
+ ........
16
34
 
17
35
  ```
18
36
 

1

修正

2016/06/25 10:16

投稿

_Kentarou
_Kentarou

スコア8490

test CHANGED
@@ -1,4 +1,4 @@
1
- 詳しくないので間違えているかもしれませんが、`var characteristic: CBMutableCharacteristic!`がインスタンス変数として保持されていないのでは無いでしょうか?
1
+ 詳しくないので間違えているかもしれませんが、`var characteristic: CBMutableCharacteristic!`がインスタンス変数として保持されていないからなのでは無いでしょうか?
2
2
 
3
3
 
4
4