Explorar el Código

Store the argument input view’s type encoding as an NSString for easier/safer memory management.

Ryan Olson hace 12 años
padre
commit
ba5c5cc836

+ 1 - 1
Classes/Editing/Argument Input Views/FLEXArgumentInputNumberView.m

@@ -29,7 +29,7 @@
 
 - (id)inputValue
 {
-    return [FLEXRuntimeUtility valueForNumberWithObjCType:self.typeEncoding fromInputString:self.inputTextView.text];
+    return [FLEXRuntimeUtility valueForNumberWithObjCType:[self.typeEncoding UTF8String] fromInputString:self.inputTextView.text];
 }
 
 + (BOOL)supportsObjCType:(const char *)type withCurrentValue:(id)value

+ 1 - 1
Classes/Editing/Argument Input Views/FLEXArgumentInputView.h

@@ -47,9 +47,9 @@ typedef NS_ENUM(NSUInteger, FLEXArgumentInputViewSize) {
 // For subclass eyes only
 
 @property (nonatomic, strong, readonly) UILabel *titleLabel;
-@property (nonatomic, assign, readonly) const char *typeEncoding;
 @property (nonatomic, readonly) BOOL showsTitle;
 + (CGFloat)titleBottomPadding;
+@property (nonatomic, strong, readonly) NSString *typeEncoding;
 
 @end
 

+ 2 - 2
Classes/Editing/Argument Input Views/FLEXArgumentInputView.m

@@ -12,7 +12,7 @@
 @interface FLEXArgumentInputView ()
 
 @property (nonatomic, strong) UILabel *titleLabel;
-@property (nonatomic, assign) const char *typeEncoding;
+@property (nonatomic, strong) NSString *typeEncoding;
 
 @end
 
@@ -22,7 +22,7 @@
 {
     self = [super initWithFrame:CGRectZero];
     if (self) {
-        self.typeEncoding = typeEncoding;
+        self.typeEncoding = @(typeEncoding);
     }
     return self;
 }