diff --git a/Source/CDTextClassDumpVisitor.m b/Source/CDTextClassDumpVisitor.m index 763358d5..143b832b 100644 --- a/Source/CDTextClassDumpVisitor.m +++ b/Source/CDTextClassDumpVisitor.m @@ -6,6 +6,7 @@ #import "CDTextClassDumpVisitor.h" #import "CDClassDump.h" +#import "CDType.h" #import "CDOCClass.h" #import "CDOCCategory.h" #import "CDOCMethod.h" @@ -122,8 +123,16 @@ - (void)visitClassMethod:(CDOCMethod *)method; - (void)visitInstanceMethod:(CDOCMethod *)method propertyState:(CDVisitorPropertyState *)propertyState; { CDOCProperty *property = [propertyState propertyForAccessor:method.name]; - if (property == nil) { + if (property.isReadOnly && [property.setter isEqualToString:method.name]) { + [self.resultString appendFormat:@"- (void)%@(%@)arg1;\n", method.name, [property.type formattedString:nil formatter:self.classDump.typeController.propertyTypeFormatter level:0]]; + } else if (property == nil) { //NSLog(@"No property for method: %@", method.name); + // C++ destructors can't be called and this header can't be compiled with one declared. So let's comment it out. + // Leave it there so the user knows that the class has a C++ implementation though. + if ([method.name isEqualToString:@".cxx_destruct"]) { + [self.resultString appendString:@"// "]; + } + [self.resultString appendString:@"- "]; [method appendToString:self.resultString typeController:self.classDump.typeController]; [self.resultString appendString:@"\n"]; diff --git a/Source/CDType.m b/Source/CDType.m index 2e2bd84b..6c5f744f 100644 --- a/Source/CDType.m +++ b/Source/CDType.m @@ -437,6 +437,8 @@ - (NSString *)formattedString:(NSString *)previousName formatter:(CDTypeFormatte result = @"CDUnknownFunctionPointerType"; else result = [NSString stringWithFormat:@"CDUnknownFunctionPointerType %@", currentName]; + result = [NSString stringWithFormat:@"void * /* %@ */", result]; + break; case T_BLOCK_TYPE: @@ -447,6 +449,7 @@ - (NSString *)formattedString:(NSString *)previousName formatter:(CDTypeFormatte result = @"CDUnknownBlockType"; else result = [NSString stringWithFormat:@"CDUnknownBlockType %@", currentName]; + result = [NSString stringWithFormat:@"id /* %@ */", result]; } break; diff --git a/Source/CDVisitorPropertyState.m b/Source/CDVisitorPropertyState.m index 04d5bab5..9421826d 100644 --- a/Source/CDVisitorPropertyState.m +++ b/Source/CDVisitorPropertyState.m @@ -28,7 +28,7 @@ - (id)initWithProperties:(NSArray *)properties; //NSLog(@"property: %@, getter: %@, setter: %@", [property name], [property getter], [property setter]); _propertiesByName[property.name] = property; _propertiesByAccessor[property.getter] = property; - if (property.isReadOnly == NO) + if (property.isReadOnly == NO || property.setter) _propertiesByAccessor[property.setter] = property; } }