title: property_copyAttributeValue(property, "T") return wired result
body: <p>I got wired propertyType using <code>property_copyAttributeValue(property, "T")</code>, have seen <a href="http://nshipster.com/type-encodings/" rel="nofollow">NSHipster's article</a>, it should be like <code>i</code>, <code>s</code>, ... but what I got is <code>ø¸u</code>, <code>ø¸u8</code>, <code>ø¸u8</code>, what may the reason of this result? here is my encoding/decoding script</p>
  
  <pre><code>- (void)encodeWithCoder:(NSCoder *)aCoder
  {
      unsigned int propertyCount;
      objc_property_t *properties = class_copyPropertyList([self class], &amp;propertyCount);
  
      for (int i = 0; i &lt; propertyCount; i++) {
          objc_property_t property = properties[i];
          char *propertyType = property_copyAttributeValue(property, "T");
          NSString *propertyName = [NSString stringWithFormat:@"%s", property_getName(property)];
          free (propertyType);
          char *iVar = property_copyAttributeValue(property, "V");
          NSString *iVarName = [NSString stringWithFormat:@"%s", iVar];
          free(iVar);
  
          switch (propertyType[0]) {
              case 'i': // int
              case 's': // short
              case 'l': // long
              case 'q': // long long
              case 'I': // unsigned int
              case 'S': // unsigned short
              case 'L': // unsigned long
              case 'Q': // unsigned long long
              case 'f': // float
              case 'd': // double
              case 'B': // BOOL
                  [aCoder encodeInteger:[[self valueForKey:iVarName] intValue] forKey:propertyName];
                  break;
              default:
                  [aCoder encodeObject:[self valueForKey:iVarName] forKey:propertyName];
          }
      }
      free(properties);
  }
  
  - (id)initWithCoder:(NSCoder *)aDecoder
  {
      if (self = [super init]) {
          unsigned int propertyCount;
          objc_property_t *properties = class_copyPropertyList([self class], &amp;propertyCount);
  
          for (int i = 0; i &lt; propertyCount; i++) {
              objc_property_t property = properties[i];
              char *propertyType = property_copyAttributeValue(property, "T");
              NSString *propertyName = [NSString stringWithFormat:@"%s", property_getName(property)];
              free(propertyType);
              char *iVar = property_copyAttributeValue(property, "V");
              NSString *iVarName = [NSString stringWithFormat:@"%s", iVar];
              free(iVar);
  
              switch (propertyType[0]) {
                  case 'i': // int
                  case 's': // short
                  case 'l': // long
                  case 'q': // long long
                  case 'I': // unsigned int
                  case 'S': // unsigned short
                  case 'L': // unsigned long
                  case 'Q': // unsigned long long
                  case 'f': // float
                  case 'd': // double
                  case 'B': // BOOL
                      [self setValue:[NSNumber numberWithInteger:[aDecoder decodeIntegerForKey:propertyName]] forKey:iVarName];
                      break;
                  default:
                      NSLog(@"propertyType:%@", [NSString stringWithUTF8String:propertyType]);
                      [self setValue:[aDecoder decodeObjectForKey:propertyName] forKey:iVarName];
              }
          }
          free(properties);
      }
      return self;
  }
  </code></pre>
  
  <hr>
  
  <p><strong>update</strong>: found the reason: referencing a freed variable.</p>