Breakpoint in swift_dynamicCastClassUnconditional testing NSManagedObject-derived class

Originator:bob
Number:rdar://17866892 Date Originated:31-Jul-2014
Status:Closed Resolved:20-Aug-2014
Product:Xcode Product Version:6 Beta 4
Classification:Serious Bug Reproducible:Always
 
Fixed using instructions based on https://devforums.apple.com/message/1016337#1016337
This issue has been verified as resolved and can be closed.


Summary:
Pure Swift iOS app using Core Data -- "RoadTrips"
Target app defines "@objc class Route: NSManagedObject { ... }"
* data model associates entity w/ "RoadTrips.Route"
* Route.swift is also compiled into the RoadTripsTest target

RouteTests.swift...
* var route: Route?
* setUp(): creates the CoreData infrastructure, then
  route = (NSEntityDescription.insertNewObjectForEntityForName("Route", inManagedObjectContext: managedObjectContext) as Route)

Running tests under the debugger, hit a breakpoint in swift_dynamicCastClassUnconditional from the "route = ..." line

Can continue -- tests pass

If not under the debugger -- whether Debug or Release -- the  breakpoint kills the app and the test eventually times out.

Steps to Reproduce:
1. Install Xcode 6 Beta 4
2. Unpack the ZIP
3. Open RoadTrips.xcodeproj
4. Select the Test scheme -- confirm it will run under the debugger
5. Run/test

Expected Results:
Tests complete without stopping

Actual Results:
Breakpoint in swift_dynamicCastClassUnconditional
under debugger, can continue
w/out debugger, app dies

Version:
Xcode 6 Beta 4
OS X 10.9.4

Notes:
using "@objc(Route)\n" in Route.swift makes the CoreData complain it can't load RoadTrips.Route
using "@objc(RoadTrips.Route)" doesn't compile

someone else's problems w/ Beta 3: http://stackoverflow.com/questions/24841856/swift-breakpoint-in-coredata-library

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!