0

When I run my code in the simulator in debug everything seems to work fine. When I run it without the debug, I get a segfault on initialization of a promise object.

    func URLGET( url: String  ) -> Promise<NSDictionary> {
         return Promise<NSDictionary> { fulfill, reject in
             //some code here
         }
    }

I segfault at the return function when instantiating a promise object. It will also segfault while running in debug mode on an iOS device. The last instructions are

 swift_getGenericMetadata
 swift_getGenericMetadata1
 type metadata accessor for PromiseKit.Promise<ObjectiveC.NSDictionary>

I can't seem to get this to work properly. I'm not entirely sure how this is happening. Since it runs fine in debug mode on a simulator. All help is appreciated.

Lee Jacobs
  • 1,692
  • 3
  • 12
  • 21

1 Answers1

0

Turns out that when your provide your embedded frameworks as optional that iOS devices and iOS simulators can lose track of the framework. So when I try to create a new promise, it segfaults when trying to locate the promise library. I had to change the framework to required and have it as an embedded binary. This likely won't pass verification for iOS 7.1 so this will only work for iOS 8 at the moment. Unfortunate circumstances.

Lee Jacobs
  • 1,692
  • 3
  • 12
  • 21