Skip to content

Commit 734f835

Browse files
committed
Try something else
1 parent 38a34d1 commit 734f835

File tree

7 files changed

+18
-10
lines changed

7 files changed

+18
-10
lines changed
Binary file not shown.
Binary file not shown.
123 Bytes
Binary file not shown.
123 Bytes
Binary file not shown.

source/IOSResolver/src/IOSResolver.cs

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -844,32 +844,40 @@ public static void SettingsDialog() {
844844
internal static bool MultipleXcodeTargetsSupported {
845845
get {
846846
try {
847-
return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
848-
"GetUnityMainTargetGuid", Type.EmptyTypes) != null;
849-
} catch (Exception) {
847+
return MultipleXcodeTargetsSupportedInternal();
848+
} catch (Exception e) {
850849
return false;
851850
}
852851
}
853852
}
854853

854+
private static bool MultipleXcodeTargetsSupportedInternal() {
855+
return typeof(UnityEditor.iOS.Xcode.PBXProject).GetMethod(
856+
"GetUnityMainTargetGuid", Type.EmptyTypes) != null;
857+
}
858+
855859
/// <summary>
856860
/// Name of the Xcode main target generated by Unity.
857861
/// </summary>
858862
public static string XcodeMainTargetName {
859863
get {
860864
try {
861-
// NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
862-
// longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
863-
// so we'll use this constant as a relatively safe default.
864-
return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
865-
(string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
866-
"GetUnityTargetName", null);
867-
} catch (Exception) {
865+
return XcodeMainTargetNameInternal();
866+
} catch (Exception e) {
868867
return "Unity-iPhone";
869868
}
870869
}
871870
}
872871

872+
private static string XcodeMainTargetNameInternal() {
873+
// NOTE: Unity-iPhone is hard coded in UnityEditor.iOS.Xcode.PBXProject and will no
874+
// longer be exposed via GetUnityTargetName(). It hasn't changed in many years though
875+
// so we'll use this constant as a relatively safe default.
876+
return MultipleXcodeTargetsSupported ? "Unity-iPhone" :
877+
(string)VersionHandler.InvokeStaticMethod(typeof(UnityEditor.iOS.Xcode.PBXProject),
878+
"GetUnityTargetName", null);
879+
}
880+
873881
/// <summary>
874882
/// Name of the Xcode UnityFramework target generated by Unity 2019.3+
875883
/// </summary>
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)