How to dynamically set background color in IOS? -


I have to set the background color in the iOS using string value. It should be done dynamically how is it possible?

  myColors = @ [@ "redColor", @ "greencolor", @ "blue color ", @" Yellow color ", @" black color ", @" cyan coral ", @" magenta cloor ", @" purple color ", @" gray color "]; // value in NSArray / int a = arc4random ()% 9; // Choose Random Value // SEL ABC = NSSelectorFromString ([myColors objectAtIndex: A]); [_canvas setBackgroundColor: [UIColor performSelector: abc]];    

Comments

Popular posts from this blog

python - Writing Greek in matplotlib labels, titles -

c# - LINQ to Entities does not recognize the method 'Int32 IndexOf(System.String, System.StringComparison)' method -

Pygame memory leak with transform.flip -