You cannot - variable names are resolved by the compiler long before Objective-C code is executed. What you can do is save a line map for objects like buttons, etc. Using NSMutableDictionary :
NSString *string = @"someString"; [buttonMap setObject: [UIButton buttonWithType:UIButtonTypeCustom] forKey: string];
user23743
source share