質問編集履歴
2
エラーが発生します。
test
CHANGED
File without changes
|
test
CHANGED
@@ -467,3 +467,65 @@
|
|
467
467
|
```
|
468
468
|
|
469
469
|
宜しくお願い申し上げます。
|
470
|
+
|
471
|
+
|
472
|
+
|
473
|
+
swift3での変更点は修正したつもりです。
|
474
|
+
|
475
|
+
```ここに言語を入力
|
476
|
+
|
477
|
+
let subjectTitle = ["おもち" ,"ごはん","パン"]
|
478
|
+
|
479
|
+
let imgArray : NSMutableArray = []
|
480
|
+
|
481
|
+
for x in 0...subjectTitle.count {
|
482
|
+
|
483
|
+
let filePath = localDocumentsPath + USDocInfo.NAME + "." + USDocInfo.ECTENSION + "." + subjectArray[x] // <- Use of unresolved identifier ‘subjectArray’ エラー
|
484
|
+
|
485
|
+
let fileUrl = NSURL(fileURLWithPath:filePath)
|
486
|
+
|
487
|
+
//ファイルの存在チェック
|
488
|
+
|
489
|
+
isFileExists = FileManager.default.fileExists(atPath: filePath)
|
490
|
+
|
491
|
+
document = USDocument(fileURL:fileUrl as URL)
|
492
|
+
|
493
|
+
// if isFileExists{
|
494
|
+
|
495
|
+
// document.open(completionHandler: { (success:Bool) -> Void in
|
496
|
+
|
497
|
+
if isFileExists{
|
498
|
+
|
499
|
+
let doc:USDocument = self.documentArray[self.x] as! USDocument // <- Value of type ‘ViewController’ has no member ‘documentArray’ エラー
|
500
|
+
|
501
|
+
doc.open(completionHandler: { (success:Bool) -> Void in
|
502
|
+
|
503
|
+
|
504
|
+
|
505
|
+
|
506
|
+
|
507
|
+
if success{
|
508
|
+
|
509
|
+
self.imgArray.addObject(self.document.img) // <- Value of type ‘ViewController’ has no member ‘imgArray’ エラー
|
510
|
+
|
511
|
+
}else{
|
512
|
+
|
513
|
+
print("Documentを開けませんでした。")
|
514
|
+
|
515
|
+
}
|
516
|
+
|
517
|
+
})
|
518
|
+
|
519
|
+
}else{
|
520
|
+
|
521
|
+
print("Documentがありませんぬ")
|
522
|
+
|
523
|
+
}
|
524
|
+
|
525
|
+
}
|
526
|
+
|
527
|
+
|
528
|
+
|
529
|
+
```
|
530
|
+
|
531
|
+
エラーが発生します。大変申し訳ございませんが、今一度ご教授願います。
|
1
AppDelegate\.swift を追加しました。
test
CHANGED
File without changes
|
test
CHANGED
@@ -423,3 +423,47 @@
|
|
423
423
|
|
424
424
|
|
425
425
|
宜しくお願い申し上げます。
|
426
|
+
|
427
|
+
|
428
|
+
|
429
|
+
AppDelegate.swiftもアップします。
|
430
|
+
|
431
|
+
```swift3
|
432
|
+
|
433
|
+
//
|
434
|
+
|
435
|
+
// AppDelegate.swift
|
436
|
+
|
437
|
+
//
|
438
|
+
|
439
|
+
import UIKit
|
440
|
+
|
441
|
+
|
442
|
+
|
443
|
+
@UIApplicationMain
|
444
|
+
|
445
|
+
class AppDelegate: UIResponder, UIApplicationDelegate {
|
446
|
+
|
447
|
+
var window: UIWindow? //ウィンドウ
|
448
|
+
|
449
|
+
|
450
|
+
|
451
|
+
//アプリ起動完了時に呼ばれる
|
452
|
+
|
453
|
+
func application(_ application: UIApplication,
|
454
|
+
|
455
|
+
didFinishLaunchingWithOptions
|
456
|
+
|
457
|
+
launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
|
458
|
+
|
459
|
+
return true
|
460
|
+
|
461
|
+
}
|
462
|
+
|
463
|
+
}
|
464
|
+
|
465
|
+
|
466
|
+
|
467
|
+
```
|
468
|
+
|
469
|
+
宜しくお願い申し上げます。
|