0

Why does the debugger 'po' works with var:

var myDict = currentImageDownloader.dict

As shown here:

(lldb) po myDict
Some
 {
  [0] = {
    key = "ispublic"
    value = (instance_type = Builtin.RawPointer = 0xb000000000000013)


    (lldb) po myDict
    error: <EXPR>:1:1: error: use of unresolved identifier 'myDict'
    myDict
    ...

yet via 'let':

let myDict = currentImageDownloader.dict

The debugger 'po' doesn't work:

(lldb) po myDict
error: <EXPR>:1:1: error: use of unresolved identifier 'myDict'
myDict

^


Although I can view everything via 'let' or 'var' using the debugger's frame command:
(lldb) fr v 
(UICollectionView) collectionView = 0x00007fc2d2821600 {
  UIKit.UIScrollView = {
    UIKit.UIView = {
      UIKit.UIResponder = {
        ObjectiveC.NSObject = {}
      }
    }
  }
}
(NSIndexPath) indexPath = 0xc000000000000016 {
  ObjectiveC.NSObject = {}
}
(FlickrSwift.ViewController) self = 0x00007fc2d2580f20 {
  UIKit.UIViewController = {
    UIKit.UIResponder = {
      ObjectiveC.NSObject = {}
    }
  }
  collectionView = Some
}
(FlickrSwift.ImageDownloader) currentImageDownloader = 0x00007fc2d4449750 {
  image = nil
  bigImage = nil
  dict = Some {
    [0] = {
      key = "ispublic"
      value = (instance_type = Builtin.RawPointer = 0xb000000000000013)
    }
    [1] = {
      key = "height_sq"
      value = (instance_type = Builtin.RawPointer = 0xb0000000000004b3)
    }
    [2] = {
      key = "url_m"
      value = (instance_type = Builtin.RawPointer = 0x00007fc2d25131a0 -> 0x00000001088e7488 (void *)0x00000001088e7438: __NSCFString)
    }
    [3] = {
      key = "title"
      value = (instance_type = Builtin.RawPointer = 0x00007fc2d25a7030 -> 0x00000001088e7488 (void *)0x00000001088e7438: __NSCFString)
    }
    [4] = {
      key = "isfamily"
      value = (instance_type = Builtin.RawPointer = 0xb000000000000003)
    }
    ...
  }
  descString = nil
}
(AnyObject) cell = <variable not available>

(UIImageView) photoImageView = <variable not available>

(UIImage) image = <variable not available>
Bryan Chen
  • 45,816
  • 18
  • 112
  • 143
Frederick C. Lee
  • 9,019
  • 17
  • 64
  • 105
  • possible duplicate of [po Swift String "unresolved identifier"](http://stackoverflow.com/questions/24309005/po-swift-string-unresolved-identifier) – mmmmmm Oct 07 '14 at 21:49

1 Answers1

0

There were a couple of bugs in the debug information for "let" variables that kept lldb from being able to understand them correctly. These should all be fixed in the upcoming Xcode release. You'll need to recompile your code once you get the new release, but after that you should be able to see them.

If you aren't please file a bug with http://bugreporter.apple.com.

Jim Ingham
  • 25,260
  • 2
  • 55
  • 63