import Realm
class LogEntryType : RLMObject {
  dynamic var id = 0//DefaultLogEntryType.Unknown.rawValue
  dynamic var name: String! = ""
  override class func primaryKey() -> String {
    return "id"
  }
  class func getDefaultTypes() {
    let types = LogEntryType.allObject()
    if types.count == 0 {
     ...
    }
  }
}
2015-02-16 10:22:52.694 Daily[432:115819] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSArrayM insertObject:atIndex:]: object cannot be nil'
*** First throw call stack:
(0x181d71e48 0x1924b00e4 0x181c5b3e0 0x1000e0e2c 0x100103ff8 0x1001038fc 0x10010385c 0x1000dc6f8 0x1000cb0ac 0x1000c4290 0x1000ca100 0x1000ca2c4 0x1000df338 0x1000ded44 0x10010dfb0 0x1924b0bd0 0x1924b89ac 0x1924c3db8 0x100103ef8 0x1001038fc 0x10010385c 0x1000c7ae0 0x1000c48cc 0x1000c28a8 0x1000c2904 0x1865550f8 0x18653e22c 0x186554a94 0x186554720 0x18654dc74 0x18652138c 0x1867c01b4 0x18651f8f4 0x181d2a0e8 0x181d2938c 0x181d2743c 0x181c551f4 0x18ade35a4 0x186586784 0x1000ce4b0 0x1000ce4f0 0x192b1ea08)
libc++abi.dylib: terminating with uncaught exception of type NSException
--
You received this message because you are subscribed to the Google Groups "Realm" group.
To unsubscribe from this group and stop receiving emails from it, send an email to realm-cocoa...@googlegroups.com.
To post to this group, send email to realm...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/realm-cocoa/c985947a-e041-4d21-9053-8aa6a5b1af9e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
I found the problem. Apparently, it's not a good idea to initialize
RLMObject inside another RLMObject initialization when you have one-to-one
relation between them (basically assigning a default RLMObject in init() of
the parent one). When I got rid of this unrelated code, all was good. It
looks like Realm is trying to init all the RLMObjects in the project first
(probably to gather all the properties and init) so it collided hard.
On Mon, Feb 16, 2015 at 7:29 PM UTC, Help <he...@realm.io> wrote:Unfortunately, to be able to figure out where the exception is coming from, we'll need to be able to see the backtrace. Probably the easiest option (if the exception is being thrown while in development) would be to set an Exception Breakpoint in Xcode and then share the stack trace when that breakpoint gets hit. No need to catch the exception at all!
--
Samuel Giddins
On Mon, Feb 16, 2015 at 7:19 PM UTC, Pavel Serbajlo <serb...@me.com> wrote:This particular exception wouldn't symbolicate for me. All I can see is
above. Also Swift doesn't support catching exceptions directly, any advice?
On Mon, Feb 16, 2015 at 6:56 PM UTC, Help <he...@realm.io> wrote:Hm. In that case, could you share the symbolicated exception backtrace so we can help you figure out what's going on?
--
Samuel Giddins
On Mon, Feb 16, 2015 at 6:53 PM UTC, Pavel Serbajlo <serb...@me.com> wrote:Good to know that. I tried it, but still experiencing the same crashes.