 public struct VisualFormatLanguage : ExpressibleByStringInterpolation {
     
     let format: String
-    var metrics = NSHashTable<NSNumber>(options: NSPointerFunctions.Options.weakMemory)
+    var metrics = NSHashTable<NSNumber>(options: NSPointerFunctions.Options.copyIn)
     var views = NSHashTable<UIView>(options: NSPointerFunctions.Options.weakMemory)
+    var viewCount: Int = 0  // used to check if this VFL is still valid; since views won't persist the view pointers, if the view is deallocated, there will be an exception when constraints are created later
     
     public init(stringInterpolation strings: VisualFormatLanguage...) {
         var format = ""

    
    /// Returns layout constraints with options.
    public func constraints(_ options: NSLayoutFormatOptions) -> [NSLayoutConstraint] {
        return NSLayoutConstraint.constraints(withVisualFormat: format, options: options, metrics: vflDictionary(metrics), views: vflDictionary(views))
    }
    

            }
            for view in vfl.views.allObjects {
                views.add(view)
                viewCount += 1
            }
        }
        self.format = format
    }
    
    public init<T>(stringInterpolationSegment expr: T) {
        if let view = expr as? UIView {
            format = vflKey(view)
            views.add(view)
            viewCount += 1
        } else if let number = expr as? NSNumber {
            format = vflKey(number)
            metrics.add(number)
        } else {
            format = String(describing: expr)
        }
    }
    
    func vflDictionary<T>(_ table: NSHashTable<T>) -> [String : AnyObject] {
