Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Realm.io Optional Properties

Tags:

ios

realm

I have just started using Realm.io on iOS and am attempting to populate objects but am getting the following:

Invalid value nil for property

How can I make a property optional?

like image 391
Enea G UnlimApps Avatar asked Aug 17 '14 01:08

Enea G UnlimApps


People also ask

What are .objects realm?

Realm objects are regular Swift or Objective-C classes, but they also bring a few additional features like live queries. The Swift SDK memory maps Realm objects directly to native Swift or Objective-C objects, which means there's no need to use a special data access library, such as an ORM .

What is @persisted in realm Swift?

@Persisted is used to declare properties on Object subclasses which should be managed by Realm. Int, Bool, String, ObjectId and Date properties can be indexed by passing indexed: true to the initializer.


1 Answers

You can’t at the moment. Only relationships can be nil at this point. We’re working on adding this soon though!

like image 64
timanglade Avatar answered Oct 18 '22 07:10

timanglade