Interactive Ink

Can't add long email string by addBlock function

Hey Guys.

I'm having an issue when trying to programatically add an email (as text) as a new block on my Text Document part


[self.editor addBlock:pos type:contentType mimeType:IINKMimeTypeText data:text error:&error];

 The text contains "".

But after executing the line, error contains "Error Domain=Interactive Ink SDK Error Domain Code=0 "Error, -[IINKEditor addBlock:type:mimeType:data:error:]::417 INVALID_STATE" UserInfo={NSLocalizedFailureReason=Error, -[IINKEditor addBlock:type:mimeType:data:error:]::417 INVALID_STATE}"

The courios thing is if I enter a shorter email, like "", the function works and the text is added.

Any hints?


Dear Just,

thank you for your question.

Currently, you can refer to the API documentation of the addBlock function :

Based on your explanation, i.e. excepton only occurs when the email address is long, it looks like to the reason is there is not enough space for a new block (java.lang.IllegalStateException - if empty space around position is too small for a new block.)

You then understand the solution is that you constrain the size of the email address (or anything else that can match your use-case) to no longer have this behavior.

Best regards,


Hey Oliver!

Thanks for the quick response.

The test was done with the part empty (the block, if added, would be the first one). Also, I've tried with longer texts and it works without any issue, the only time it gives me this error is with long email address (or a long text without a space, like Abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz).

Dear Just,

I confirm my analysis (we reproduced internally).

Indeed, when importing a string, if it happens to be wider than the screen, we split it using the spaces. If the string doesn't have any space, we are not able to cut it and return with the illegal state exception.

The only workaround is to limit the number of followed characters without a space.

Best regards,


1 person likes this
Login or Signup to post a comment