ios - Declare a read-only @NSManaged property in Swift for Parse's PFRelation -
i'm using parse object store in ios application , i've created custom subclass parse object, looks this:
class mything: pfobject, pfsubclassing { // ...pfsubclassing protocol... @nsmanaged var name: string @nsmanaged var somethingelse: string @nsmanaged var relatedthings: pfrelation } the relatedthings property works: able fetch related objects store. however, keep getting warning parse:
[warning]: pfrelation properties readonly, myapp.mything.relatedthings declared otherwise. in objective-c, have marked property readonly, unsure how in swift silence warning.
using let instead of var not allowed in combination @nsmanaged.
adding private(set) has no effect either:
@nsmanaged private(set) var relatedthings: pfrelation so how parse expect me declare relationship property?
now should use:
var relatedthings: pfrelation! { return relationforkey("relatedthings") }
Comments
Post a Comment