wrld3d / ios-api

iOS API for WRLD: Stunning, Interactive 3D Maps
BSD 2-Clause "Simplified" License
19 stars 7 forks source link

Work around name collision with NSTextRange initWithLocation #41

Closed chrisdjali-wrld3d closed 2 years ago

chrisdjali-wrld3d commented 2 years ago

I'm not entirely sure why this is necessary. Something I read suggested that potentially the [self alloc] is returning a generic type, so the compiler searches all known types for candidate methods. The advice for that situation was to add an explicit cast, but doing so gave syntax errors, despite everything matching the most similar examples I could find.

Instead, I just did manual name mangling by adding a 2 to the method name.

Hopefully, we've still got employees who have some vague familiarity with Objective-C/Objective-C++ and one of them can fix this properly before we're forced to put this into production code. It can live as a draft PR until then.

chrisdjali-wrld3d commented 2 years ago

There's a merge conflict with something that already fixes this, so it looks like someone pushed an API change without updating the submodules in the parent repo.