Twitter Kit iOS 3.2.1 crash during composing a tweet



Twitter Kit iOS crashes occasionally during composing a tweet contains an image.

In my application, user can share an image as composing a tweet and the function was implemented with Twitter Kit SDK.
We found the application crashes occasionally in TWTRComposer type object’s showFromViewController method during share an image.

The crash doesn’t occurred in the fixed number of trial to compose a tweet; sometimes it occurred after several times of successful sharing of images in each session, but I saw a case that the app crashes when the first time I tried to share an image.
It seems the crash occurs once for 5~7 trials to compose a tweet.

This is a stack trace for the crash -

As you can figure it out in the screen capture, cause of the crash is an access violation in -[TSETweetComposerViewController viewDidLoad] function while it try to load an image from bundle.

The address of BAD ACCESS was always same every time. (0x300088)

Version of Twitter Kit I used was 3.2.1 and Twitter Core was that in the zipped package distributed with Twitter Kit 3.2.1 (the most recent).
I checked that bundle resources in Twitter Kit SDK was listed in Copy Bundle Resources in XCode Project’s Build Phases.

Obj-C code to compose a tweet is like this

TWTRComposer *composer = [[TWTRComposer alloc] init];

[composer setText:@“default message”];
[composer setImage:];

[composer showFromViewController:myViewController
completion:^(TWTRComposerResult result) {

(almost same as twitter documentation’s

I didn’t re-used composer object, and checked UIImage object passed to composer object via setImage method and View Controller object passed to showFromViewController method were still valid, correct object at the time of a crash.

The crash was occurred in not all devices but some particular devices we have.
iOS versions of devices suffering for the issue is varies from 9.2 to 10.2, and we couldn’t found exact conditions to reproduce the crash.

Is there any way to prevent this crash or walk around the issue?