Side menu gives error of bad range when implementing with TCA #3469
Replies: 2 comments 2 replies
-
Hi @holzerryan, sorry it's hard to say without more info. Are you able to create a very small project that demonstrates the behavior you are seeing? Also, fyi, the "<decode: bad range…" stuff is usually accompanied by purple runtime warnings in Xcode, which the library emits to notify users of incorrectly used APIs. Are you seeing any of those? What version of Xcode/iOS are you running? |
Beta Was this translation helpful? Give feedback.
-
I located the root cause to my problem. The issue was that my InternalLibrary.NotesListView() function was generating a new store every time menu items were selected. The quick/dirty fix was to create a variable at the top for a reference to a NoteListView so it's not recreated each time the menu selection is triggered. The parent view held a reference to the noteListView. var noteListView = InternalLibrary.NoteListView() Then I simply used noteListView inside the TabView. I'm intentionally not exposing the NoteListFeature to the outside world and I do not want to add public to all the classes and structures. My apologies for the red herring....the error I was seeing in the console didn't point me in the correct direction. (happens from time to time) |
Beta Was this translation helpful? Give feedback.
-
I'm attempting to implement a side menu or "hamburger menu", but I've run into an issue with the console outputting the following error : <decode: bad range for [%@] got [offs:394 len:1055 within:0]>
On the surface, everything appears to work correctly until the menu is presented and the view changes with the TabView. My NoteListView works as expected with the main views and when you drill into detail views. It stops working when the menu is used to change the selected tab for the TabView.
The tab view works correctly if you comment out the .toolbar code to hide the bottom tabbar. drilling into subviews in the NotesListView do not work because it seems like you cannot interact with anything on the screen. buttons and text fields don't seem to receive the tap gestures.
Any help would be appreciated.
My parent view code looks like this:
SideMenu is simple and looks like this:
Beta Was this translation helpful? Give feedback.
All reactions