AppDelegate.swift fetchRequest和managedObjectContext

时间:2016-11-29 07:55:09

标签: core-data swift3 ios10

我遇到问题我使用Swift 3.0.1在核心数据中保存数据一些文字和图像我在我的代码中遇到此错误

AppDelegate.swift文件

import UIKit
import CoreData

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    setUpAppearance()

    return true
}



func setUpAppearance()
{
    let navStyle = UINavigationBar .appearance()
    navStyle.barTintColor = UIColor .orange
    navStyle.tintColor = UIColor .darkGray
    navStyle.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.darkGray]

}

表查看文件代码

import UIKit
import CoreData

@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {

var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
    // Override point for customization after application launch.
    setUpAppearance()

    return true
}



func setUpAppearance()
{
    let navStyle = UINavigationBar .appearance()
    navStyle.barTintColor = UIColor .orange
    navStyle.tintColor = UIColor .darkGray
    navStyle.titleTextAttributes = [NSForegroundColorAttributeName:UIColor.darkGray]

}

任何解决方案都会给我所做的......

0 个答案:

没有答案