Saturday, July 21, 2012

convert NSArray in float[]


        NSArray *c=[NSArray arrayWithObjects:@"1",@"8",@"4",@"2",nil];
        
        NSEnumerator *enumerator;
        float * cArray;
        id obj;
        int index=0;
        
        cArray = (float *) malloc(sizeof(float) * [c count]);
        enumerator = [c objectEnumerator];
        while(obj = [enumerator nextObject])
        {
            cArray[index] = [obj floatValue];
            index++;
        }
        



       


4 comments:

  1. Obviously, this is still a slooooooow thing to do, so take after ThemsAllTook's recommendation and don't utilize a NSArray for this if conceivable. What I'd do, by and by, is given NSArray a chance to deal with your capacity while you're building or generally controlling your information. Be that as it may, once your information's prepared, duplicate it over to a crude exhibit and let go of the NSArray. Visit website.

    ReplyDelete
  2. This is an awesome post.Really very informative and creative contents. These concept is a good way to enhance the knowledge.I like it and help me to article very well.Thank you for this brief explanation and very nice information.Well, got a good knowledge.
    DedicatedHosting4u.com

    ReplyDelete
  3. Thanks For Sharing Information
    Yaaron Studios is one of the rapidly growing editing studios in Hyderabad. We are the best Video Editing services in Hyderabad. We provides best graphic works like logo reveals, corporate presentation Etc. And also we gives the best Outdoor/Indoor shoots and Ad Making services.
    Best video editing services in Hyderabad,ameerpet
    Best Graphic Designing services in Hyderabad,ameerpet­
    Best Ad Making services in Hyderabad,ameerpet­

    ReplyDelete