johnno1962 / injectionforxcode

Runtime Code Injection for Objective-C & Swift
MIT License
6.55k stars 565 forks source link

Inject: EXC_BAD_ACCESS in typeInfoForClass in IvarAccess.h #199

Closed andrewschreiber closed 7 years ago

andrewschreiber commented 7 years ago

Setting up for the first time. This happens when I attempt to inject in Swift 3, Xcode 8.2.1, iOS 10.2 iPhone 6 simulator.

screen shot 2017-01-28 at 5 22 30 pm

Bundle is loading successfully according to to the console.

I am using the NSNotification center approach detailed in https://karlbowden.com/quick-start-hot-reloading-in-swift/ and referenced in #180 .

Console log:

Compiling /Users/andrew/git/SmartDart/SmartDart/ViewController.swift objc[82715]: Class _TtC9SmartDart14ViewController is implemented in both /Users/andrew/Library/Developer/CoreSimulator/Devices/2F4AD2CF-EA00-411A-951E-8DDF983F51E3/data/Containers/Bundle/Application/D14AA20D-6592-46C0-9EA7-A0BD13A102D9/SmartDart.app/SmartDart (0x104355090) and /Users/andrew/git/SmartDart/iOSInjectionProject/build/Debug-iphonesimulator/InjectionBundle2.bundle/InjectionBundle (0x118586620). One of the two will be used. Which one is undefined. 10 injections performed so far. 2017-01-28 17:26:25.169 SmartDart[82715:2091935] Ignore any warning, Swizzled SmartDart.ViewController 0x118586620 -> 0x104355090

andrewschreiber commented 7 years ago

Realized I didn't delete the original injection function. Working great now!

johnno1962 commented 7 years ago

This should be fixed now with the new release.