InjectionApp icon indicating copy to clipboard operation
InjectionApp copied to clipboard

Dequeuing cells in Swift

Open hartbit opened this issue 9 years ago • 6 comments

In Swift, when de-queuing custom cells who's class has been swizzled causes a crash:

Could not cast value of type 'MyApp.SectionHeaderView' (0x10e9afee0) to 'MyApp.SectionHeaderView' (0x123532bb8).

hartbit avatar Jan 17 '17 13:01 hartbit

Intersesting.. Any chance you would be able to put together a small example project and I’ll take a look.

johnno1962 avatar Jan 17 '17 13:01 johnno1962

I’ll try this evening.

On 17 Jan 2017, at 14:50, John Holdsworth [email protected] wrote:

Intersecting. Any change you would be able to put together a small example project and I can look into it.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/johnno1962/InjectionApp/issues/12#issuecomment-273164304, or mute the thread https://github.com/notifications/unsubscribe-auth/AAT3jyEIgcpd5fI57k5XLS7N93MgR_Wjks5rTMcWgaJpZM4Llq1H.

hartbit avatar Jan 17 '17 13:01 hartbit

Cheers, I have an idea what it is but not quite what to do about it. Swizzled instance has different “isa"

johnno1962 avatar Jan 17 '17 14:01 johnno1962

Yeah, was thinking the same, and it doesn't work with a Swift runtime cast.

hartbit avatar Jan 17 '17 14:01 hartbit

I found I could only replicate this when the cell class was in the same file as the UITableViewController subclass. Could this be the solution?

johnno1962 avatar Jan 17 '17 23:01 johnno1962

I'm in that case!

hartbit avatar Jan 17 '17 23:01 hartbit