1

I need to communicate the with code http://code.kwint.in/emoji/source/. I have written code to get iPhone emoji to web view (editor) but it do not show emoji except square box with question mark, indicating there is no image. So i found the above link. How do i communicate with this. I had my js file.

 -(void)imageToTextViewForHome:(id)sender
{
UIButton *refrenceButtonForHome;
refrenceButtonForHome = sender;
int tag  = refrenceButtonForHome.tag;
NSLog(@"tag...%d",tag);
NSString *imageNameToPass = [NSString stringWithFormat:@"%@",[emoticonsArrayForHomeEmoji 
objectAtIndex:tag]];
NSString *path =[[NSBundle mainBundle] pathForResource:imageNameToPass ofType:@"png"];
NSLog(@"pathForImage..%@",path);
[webViewForEditing stringByEvaluatingJavaScriptFromString:[NSString 
stringWithFormat:@"document.execCommand('insertImage', false, '%@')", path]];
 }
2
  • What are you trying to accomplish? You can use emoticons just fine using their unicode representation. Commented Oct 22, 2012 at 7:09
  • @Eiko I have a webview which accept image return by java script. And i can insert image any where ib between text. Thats why i need that code to convert it into .png formant. Commented Oct 22, 2012 at 7:12

1 Answer 1

1

A webview can run javascript, but I guess you're not able to return something directly.

Take a look at the example below:

http://will.thimbleby.net/script/

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.