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 6822395
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T21:39:29+00:00 2026-05-26T21:39:29+00:00

my string value is this // The string should be something like UIDeviceRGBColorSpace 0.5

  • 0

my string value is this
// The string should be something like "UIDeviceRGBColorSpace 0.5 0 0.25 1"

i’m parsing the string to get the color value alone

 -(UIColor*)colorFromNSString:(NSString *)string {


        NSMutableArray *values = [string componentsSeparatedByString:@""];
        CGFloat red = [[values objectAtIndex:1] floatValue];
        CGFloat green = [[values objectAtIndex:2] floatValue];
       CGFloat blue = [[values objectAtIndex:3] floatValue];
      CGFloat alpha = [[values objectAtIndex:4] floatValue];
      UIColor *color = [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
   //     NSLog(@"the color in string is %@",red);
       return color;
}

i’m geting the error msg of sigabrt in this line

NSMutableArray *values = [string componentsSeparatedByString:@""];

crash log is

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayM componentsSeparatedByString:]: unrecognized selector sent to instance 0x4b4a3e0'
*** Call stack at first throw:
(
    0   CoreFoundation                      0x00dcf5a9 __exceptionPreprocess + 185
    1   libobjc.A.dylib                     0x00f23313 objc_exception_throw + 44
    2   CoreFoundation                      0x00dd10bb -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
    3   CoreFoundation                      0x00d40966 ___forwarding___ + 966
    4   CoreFoundation                      0x00d40522 _CF_forwarding_prep_0 + 50
    5   PhotoApp                            0x00002800 -[PhotoAppViewController colorFromNSString:] + 67
    6   PhotoApp                            0x000027b5 -[PhotoAppViewController touchesBegan:withEvent:] + 950
    7   UIKit                               0x0038d0f4 forwardMethod2 + 92
    8   UIKit                               0x002e3d41 -[UIWindow _sendTouchesForEvent:] + 395
    9   UIKit                               0x002c4c37 -[UIApplication sendEvent:] + 447
    10  UIKit                               0x002c9f2e _UIApplicationHandleEvent + 7576
    11  GraphicsServices                    0x01727992 PurpleEventCallback + 1550
    12  CoreFoundation                      0x00db0944 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION__ + 52
    13  CoreFoundation                      0x00d10cf7 __CFRunLoopDoSource1 + 215

any suggestion welcome

  • 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-26T21:39:30+00:00Added an answer on May 26, 2026 at 9:39 pm
     CGColorRef coloref = [selectst CGColor];
         const CGFloat* components = CGColorGetComponents(coloref);
    
        CGFloat red = components[0];
        CGFloat green = components[1];
        CGFloat blue = components[2];
        CGFloat alpha =1;
        UIColor *color = [UIColor colorWithRed:red green:green blue:blue alpha:alpha];
    

    hope this help you

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

Sidebar

Related Questions

I need to find input value in a string, it should look something like
I am building an ObjectQuery like this: string query = select value obj from
I'm trying to isolate the percentage value in a string of text. This should
I've a Java String with new lines(\n), say for example String value = This
Just to make this clear - what is the difference between: String(value) and value
Helo! Is this possible to use string value of one node which tells what
i'm trying to find out if a string value EndsWith another string. This 'other
Lets say I have a string COLIN. The numeric value of this string would
(LocalVariable)ABC.string(Name) = (IDataReader)dataReader.GetString(0); This name value is coming from database. What happening here is
I am getting this warning: Use of uninitialized value in eval \string\ at myscript.pl

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.