אפשר לשנות שמות של שיטות באמצעות הדגל --mapping, שמקבל קובץ מאפיינים עם המאפיין
מיפויים לשימוש. כל מיפוי שיטה מוגדר עם חתימת שיטת Java המלאה למפתח, וגם
ערך בורר Objective-C. לדוגמה, השורה למיפוי Object.equals() ל-NSObject.isEqual:
היא:
ההצהרה בצד שמאל היא חתימת השיטה המלאה, כפי שמוגדר על ידי Java Virtual Machine
מפרט. מימין
הגדרה ידנית כוללת את הסלקטור ב-iOS (כלומר, מה שהייתם מעבירים אל @selector() ).
לשיטה ולמיפוי שלה צריך להיות מספר זהה של פרמטרים.
[[["התוכן קל להבנה","easyToUnderstand","thumb-up"],["התוכן עזר לי לפתור בעיה","solvedMyProblem","thumb-up"],["סיבה אחרת","otherUp","thumb-up"]],[["חסרים לי מידע או פרטים","missingTheInformationINeed","thumb-down"],["התוכן מורכב מדי או עם יותר מדי שלבים","tooComplicatedTooManySteps","thumb-down"],["התוכן לא עדכני","outOfDate","thumb-down"],["בעיה בתרגום","translationIssue","thumb-down"],["בעיה בדוגמאות/בקוד","samplesCodeIssue","thumb-down"],["סיבה אחרת","otherDown","thumb-down"]],["עדכון אחרון: 2024-08-28 (שעון UTC)."],[[["The `@ObjectiveCName` annotation allows developers to rename Java methods and their overrides within the translated Objective-C code."],["Method renaming can also be accomplished using mapping files specified with the `--mapping` flag during translation, providing an alternative to annotations."],["Mapping files utilize a key-value structure where the key is the Java method signature and the value is the desired Objective-C selector, ensuring both have the same parameter count."]]],["The `@ObjectiveCName` annotation renames Java methods in their Objective-C translation. The annotation's string value defines the desired Objective-C selector, excluding parameter types and names. Alternatively, the `--mapping` flag utilizes a properties file to map Java method signatures to Objective-C selectors. Each mapping specifies the full Java method signature on the left and the Objective-C selector on the right. Multiple mapping files can be provided. Mapped methods must have the same number of parameters.\n"]]