I have a function who get(ID) return(ID) the good information based on languageID. Work great for string, object(uiButton, etc), but not for INT or CGRect. But the exemple below are not ok. (goal are ONE fonction who take anything and return anything)
Thanks for suggestions!
[bButton setFrame:(CGRect) [Parametres getByLanguage:CGRectMake(262,51,43,31) FrenchID:CGRectMake(272,51,33,31)]];
or
[bButton setFrame:[Parametres getByLanguage:CGRectMake(262,51,43,31) FrenchID:CGRectMake(272,51,33,31)]];
Are not ok with Xcode.
+ ( id ) getByLanguage: (id)English FrenchID:(id)French{
P66AppDelegate* appDelegate = [[UIApplication sharedApplication] delegate];
if (appDelegate.nLanguageId == 0) {
return French;
}
else {
return English;
}
}
Cocoa provides a wrapper class called
NSValuethat should help you out:and