Quellcode durchsuchen

Fix copying object description not working

Tanner Bennett vor 6 Jahren
Ursprung
Commit
8d381ea020

+ 1 - 1
Classes/ObjectExplorers/FLEXObjectExplorerViewController.m

@@ -381,7 +381,7 @@
         NSString *copy = [section titleForRow:indexPath.row];
         NSString *subtitle = [section subtitleForRow:indexPath.row];
 
-        if (subtitle) {
+        if (subtitle.length) {
             copy = [NSString stringWithFormat:@"%@\n\n%@", copy, subtitle];
         }
 

+ 13 - 0
Classes/ObjectExplorers/Sections/FLEXSingleRowSection.m

@@ -12,6 +12,9 @@
 @interface FLEXSingleRowSection ()
 @property (nonatomic, readonly) NSString *reuseIdentifier;
 @property (nonatomic, readonly) void (^cellConfiguration)(__kindof UITableViewCell *cell);
+
+@property (nonatomic) NSString *lastTitle;
+@property (nonatomic) NSString *lastSubitle;
 @end
 
 @implementation FLEXSingleRowSection
@@ -70,6 +73,16 @@
     cell.accessoryType = UITableViewCellAccessoryNone;
     
     self.cellConfiguration(cell);
+    self.lastTitle = cell.textLabel.text;
+    self.lastSubitle = cell.detailTextLabel.text;
+}
+
+- (NSString *)titleForRow:(NSInteger)row {
+    return self.lastTitle;
+}
+
+- (NSString *)subtitleForRow:(NSInteger)row {
+    return self.lastSubitle;
 }
 
 @end