Object name from String in Objective-C -


i want set name of object uibutton string.

nsstring *buttonname = [[nsstring alloc] initwithstring:@"somestring"];

my goal is:

uibutton *somestring = [[uibutton buttonwithtype:uibuttontypecustom]retain];

how can solve this?

you can't - variable names resolved compiler before objective-c code executed. can maintain map of strings objects buttons etc. using nsmutabledictionary:

nsstring *string = @"somestring"; [buttonmap setobject: [uibutton buttonwithtype:uibuttontypecustom] forkey: string];  //...time passes...  [[buttonmap objectforkey: @"somestring"] setenabled: yes]; 

Comments

Popular posts from this blog

silverlight - Applying a style to ItemContainerStyle in C# -

c# - NullReferenceException in MySqlClient.NativeDriver -

php - How can I merge Nodes & Webform Submissions into instances of one general Content Type in Drupal 6? -