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

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -