Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7064547
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T04:50:52+00:00 2026-05-28T04:50:52+00:00

I am passing a string from objective C to javascript in this way –

  • 0

I am passing a string from objective C to javascript in this way –

NSArray *array = [NSArray arrayWithObjects:@"10",@"9",@"8", nil];
string = [[array valueForKey:@"description"] componentsJoinedByString:@","];

[graphView stringByEvaluatingJavaScriptFromString:[NSString stringWithFormat:@"methodName2([%@])", string]];

and in my javascript I am trying to convert the string into an array by –

function methodName2(val)
            {
                var b = val;
                var temp = new Array();
                temp = b.split(',');

                alert(temp);
            }

The way I am using to convert does not seem to work. I am wondering if this is because there is a mismatch in the way the javascript understands the “string” being sent to it?

It would be great if someone could help me out with this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T04:50:53+00:00Added an answer on May 28, 2026 at 4:50 am

    val is already an array, you don’t need to split it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm passing a string from javascript to Objective-C in the form of 2012-02-17 14:21:30
i am struck with passing String array from one activity to another using intent.
I believe I am passing a String array from Class A to Class B
Curently I'm passing my const string values up from my C++ into my C#
I got a string from parsing a XML file which looks like this: Fri,
I'm used to passing around string like this in my C++ applications: void foo(const
Given this XML structure from (http://localhost:3000/route.xml): <objects type=array> <object> <trip0> <departure>20:01</departure> <start>Place a</start> <end>Place
I'm passing a string from one page to another, is the url encoding necessary
I am passing string _nameProcessed from the UI to my DAL and updating my
I got this error when using the Twitter gem, and passing in an array.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.