Please help me, what am I doing wrong.
I use BubbleCell
and BubbleElement
from the examples.
For unknown reasons, the application sometimes crashes in native code.
I try out a little bit to correct the situation if I do not use DequeueReusableCell
, and always create a new BubbleCell
.
Also, the problem disappears if the constructor BubbleElement
to pass a string constant as the caption, not the object field.
Stacktrace: http://pastebin.com/KAYzpHDk
The problem is deeper than it seems. Your suggestion doesn't help, the application still crashes.
I made a separate project, leaving it a minimum of code necessary to show the problem. The problem is somehow related to System.Json... maybe.
Here is an archive of the project: https://dl.dropbox.com/u/63074515/BubbleNativeCrash.zip
The sequence of actions: 1) open the project 2) compile and run the emulator without debugging (configuration Debug|iPhoneSimulator) 3) click horse1 in the first view 4) in the list that appears, scroll whole items a few times up and down 5) in my case at this stage we crash... (stack trace: http://pastebin.com/KAYzpHDk)
If not immediately fail, you can return to the contact list, and vice versa, or even once a few times. How quickly will fail depends on the number of messages in the chat.
Now the fun part. The problem disappears completely (or I can not repeat it in a reasonable time) if in ChatViewController.cs comment the line 406 and uncomment line 407:
// string messageText = msg.MessageText ?? string.Empty;
string messageText = "Hello, World!!!";
That is, make a constant string passed into BubbleElement constructor. After that, the problem does not repeat, I think.
I tried to leave everything as is, but remove the work with the Json - the problem disappears. The problem in only when BubbleElement takes a string read from the JsonValue (IM\IMMessage.cs at line 36). Even if there is, in IMMessage.cs, to set a constant string for MessageText - the problem disappears.
What am I doing wrong? :)
p.s. Sorry for my english... it powered by google translate.