Przeglądaj źródła

Eliminate ambiguity when using the property, ivar, and method boxes.

Some users have reported build errors in these areas. They likely have conflicting methods that get imported through a PCH. For example, if the compiler sees a definition of another method called “property” that returns an NSString, it doesn’t know which one to pick.
Ryan Olson 12 lat temu
rodzic
commit
f956f85190

+ 12 - 6
Classes/Object Explorers/FLEXObjectExplorerViewController.m

@@ -663,7 +663,8 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
             
             
         case FLEXObjectExplorerSectionProperties: {
         case FLEXObjectExplorerSectionProperties: {
             if ([self canHaveInstanceState]) {
             if ([self canHaveInstanceState]) {
-                objc_property_t property = [[self.filteredProperties objectAtIndex:row] property];
+                FLEXPropertyBox *propertyBox = [self.filteredProperties objectAtIndex:row];
+                objc_property_t property = propertyBox.property;
                 id currentValue = [self valueForPropertyAtIndex:row];
                 id currentValue = [self valueForPropertyAtIndex:row];
                 BOOL canEdit = [FLEXPropertyEditorViewController canEditProperty:property currentValue:currentValue];
                 BOOL canEdit = [FLEXPropertyEditorViewController canEditProperty:property currentValue:currentValue];
                 BOOL canExplore = currentValue != nil;
                 BOOL canExplore = currentValue != nil;
@@ -673,7 +674,8 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
             
             
         case FLEXObjectExplorerSectionIvars: {
         case FLEXObjectExplorerSectionIvars: {
             if ([self canHaveInstanceState]) {
             if ([self canHaveInstanceState]) {
-                Ivar ivar = [[self.filteredIvars objectAtIndex:row] ivar];
+                FLEXIvarBox *ivarBox = [self.filteredIvars objectAtIndex:row];
+                Ivar ivar = ivarBox.ivar;
                 id currentValue = [self valueForIvarAtIndex:row];
                 id currentValue = [self valueForIvarAtIndex:row];
                 BOOL canEdit = [FLEXIvarEditorViewController canEditIvar:ivar currentValue:currentValue];
                 BOOL canEdit = [FLEXIvarEditorViewController canEditIvar:ivar currentValue:currentValue];
                 BOOL canExplore = currentValue != nil;
                 BOOL canExplore = currentValue != nil;
@@ -767,7 +769,8 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
             break;
             break;
             
             
         case FLEXObjectExplorerSectionProperties: {
         case FLEXObjectExplorerSectionProperties: {
-            objc_property_t property = [[self.filteredProperties objectAtIndex:row] property];
+            FLEXPropertyBox *propertyBox = [self.filteredProperties objectAtIndex:row];
+            objc_property_t property = propertyBox.property;
             id currentValue = [self valueForPropertyAtIndex:row];
             id currentValue = [self valueForPropertyAtIndex:row];
             if ([FLEXPropertyEditorViewController canEditProperty:property currentValue:currentValue]) {
             if ([FLEXPropertyEditorViewController canEditProperty:property currentValue:currentValue]) {
                 viewController = [[FLEXPropertyEditorViewController alloc] initWithTarget:self.object property:property];
                 viewController = [[FLEXPropertyEditorViewController alloc] initWithTarget:self.object property:property];
@@ -777,7 +780,8 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
         } break;
         } break;
             
             
         case FLEXObjectExplorerSectionIvars: {
         case FLEXObjectExplorerSectionIvars: {
-            Ivar ivar = [[self.filteredIvars objectAtIndex:row] ivar];
+            FLEXIvarBox *ivarBox = [self.filteredIvars objectAtIndex:row];
+            Ivar ivar = ivarBox.ivar;
             id currentValue = [self valueForIvarAtIndex:row];
             id currentValue = [self valueForIvarAtIndex:row];
             if ([FLEXIvarEditorViewController canEditIvar:ivar currentValue:currentValue]) {
             if ([FLEXIvarEditorViewController canEditIvar:ivar currentValue:currentValue]) {
                 viewController = [[FLEXIvarEditorViewController alloc] initWithTarget:self.object ivar:ivar];
                 viewController = [[FLEXIvarEditorViewController alloc] initWithTarget:self.object ivar:ivar];
@@ -787,12 +791,14 @@ static const NSInteger kFLEXObjectExplorerScopeIncludeInheritanceIndex = 1;
         } break;
         } break;
             
             
         case FLEXObjectExplorerSectionMethods: {
         case FLEXObjectExplorerSectionMethods: {
-            Method method = [[self.filteredMethods objectAtIndex:row] method];
+            FLEXMethodBox *methodBox = [self.filteredMethods objectAtIndex:row];
+            Method method = methodBox.method;
             viewController = [[FLEXMethodCallingViewController alloc] initWithTarget:self.object method:method];
             viewController = [[FLEXMethodCallingViewController alloc] initWithTarget:self.object method:method];
         } break;
         } break;
             
             
         case FLEXObjectExplorerSectionClassMethods: {
         case FLEXObjectExplorerSectionClassMethods: {
-            Method method = [[self.filteredClassMethods objectAtIndex:row] method];
+            FLEXMethodBox *methodBox = [self.filteredClassMethods objectAtIndex:row];
+            Method method = methodBox.method;
             viewController = [[FLEXMethodCallingViewController alloc] initWithTarget:[self.object class] method:method];
             viewController = [[FLEXMethodCallingViewController alloc] initWithTarget:[self.object class] method:method];
         } break;
         } break;