Skip to content

Not working in Swift inheriting from NSObject #18

@mergesort

Description

@mergesort

I have a very simple model, it's a few booleans, Strings, and so on.

import AutoCoding

public class Bitlink : NSObject {
    var longURLString = ""
    var shortURLString = ""

    var archived = false
    var title: String? = ""

    ... and so on
}

I'm using YapDatabase, which is leveraging NSCoder for persistence. When I save and read from the database, what I saved is correct going in and reading back out. Then when I restart the app, and query, it comes back with the default values.

I tried manually using initWithCoder: and encodeWithCoder:, and that resolved the issues, so I'm fairly certain this has something to do with AutoCoding.

Any thoughts?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions