After upgrading to XCode 7.3 and using RealmSwift 0.98.6 as suggested I keep getting the error in RLMSchema.mm line 228 . EXC_BAD_ACCESS (code=2, address=0x10ad2c5d8)
iOS version - tried 9.3, 8.4, simulator and device
I am creating instance of realm in AppDelegate. I am using cocoapods 0.39.0
When I tried to integrate RealmSwift through cocoapods in empty project and creating instance of realm in AppDelegate it worked. But in my original project it is not working
Thread 1Queue : com.apple.main-thread (serial)
#0 0x000000010f10404b in realizeClass(objc_class*) ()
#1 0x000000010f1045d9 in realizeAllClasses() ()
#2 0x000000010f106152 in objc_copyClassList ()
#3 0x000000010c0d7c96 in +[RLMSchema sharedSchema] at /Users/peterko/projects/ios/ishmu/Pods/Realm/Realm/RLMSchema.mm:228
#4 0x000000010c0bd732 in +[RLMRealm realmWithConfiguration:error:] at /Users/peterko/projects/ios/ishmu/Pods/Realm/Realm/RLMRealm.mm:373
#5 0x000000010c572fac in @nonobjc RLMRealm.__allocating_init(configuration : RLMRealmConfiguration) throws -> RLMRealm ()
#6 0x000000010c56fc88 in Realm.init(configuration : Realm.Configuration) throws -> Realm at /Users/peterko/projects/ios/ishmu/Pods/RealmSwift/RealmSwift/Realm.swift:75
#7 0x000000010c570028 in Realm.__allocating_init(configuration : Realm.Configuration) throws -> Realm ()
#8 0x000000010ac3c92e in AppDelegate.init() -> AppDelegate at /Users/peterko/projects/ios/ishmu/iSHMU/AppDelegate.swift:107
#9 0x000000010ac3ca31 in @objc AppDelegate.init() -> AppDelegate ()
#10 0x000000010c7b6565 in _UIApplicationMainPreparations ()
#11 0x000000010c7b5eda in UIApplicationMain ()
#12 0x000000010ac3cab2 in main at /Users/peterko/projects/ios/ishmu/iSHMU/AppDelegate.swift:18
#13 0x000000010fbce92d in start ()

Thanks for filing this, @peterturza. Do you see the same crash when running on an iOS device rather than in the simulator?
@bdash yes, the crash is the same on device and simulator
@bdash If i can help i have exactly the same issue here ....
Same issue here
The other project in which I use realm swift is functional after upgrade (tried today). @bdash maybe my model files could help to find the problem?
The nature of the crash implies that there's some metadata used by the Objective-C runtime that is in an inconsistent state. If anyone is willing to share a build of their application聽(e.g., the .app) compiled for an iOS device that reproduces the crash, I can take a look to help understand what's going on. If you're willing, please share the built app with [email protected] and mention this GitHub issue number in your email.
I have sent the build to [email protected]
@PoissonBallon, @williamvasconcelos: If you're willing to share builds of your app that reproduce this crash, I'd appreciate seeing them too. It'll help track down the common factor in the crash.
As I suspected, this is a Swift compiler bug. Caesar Wirth came to the same conclusion and has written up a blog post about the issue, including a workaround you can apply in your application. He also links to the Swift compiler bug report that is being used to track the compiler fix.
This is already getting fixed by the Swift team :+1: https://github.com/apple/swift/pull/1914
(OpenSource Swift is so amazing :heart_eyes: )
Yeah, sorry about that. If you reorder your fields so that a non-empty type is the first declared stored property, it will work around the issue.
Most helpful comment
Yeah, sorry about that. If you reorder your fields so that a non-empty type is the first declared stored property, it will work around the issue.