You will love Xcode 6.3+
TL; DR
(lldb) e @import UIKit (lldb) po self.view.bounds
LLDB Objective-C expression parser can now import modules. Any subsequent expression may be based on prototypes of functions and methods defined in the module:
(lldb) p @import Foundation (lldb) p NSPointFromString(@"{10.0, 20.0}"); (NSPoint) $1 = (x = 10, y = 20)
Prior to Xcode 6.3, methods and functions without debugging information required explicit tricks to indicate their return type. Import modules allow the developer to avoid the more laborious process of defining and specifying this information manually:
(lldb) p NSPointFromString(@"{10.0, 20.0}"); error: 'NSPointFromString' has unknown return type; cast the call to its declared return type error: 1 errors parsing expression (lldb) p (NSPoint)NSPointFromString(@"{10.0, 20.0}"); (NSPoint) $0 = (x = 10, y = 20)
Other advantages of import modules include improved error messages, access to variational functions when working on 64-bit devices, and eliminating potentially incorrect valid argument types.
PS : If you also confuse p vs po
p == print == expression -- == e -- po == expression -O -- == e -O --
-- is a separator between command+flag vs inputs
-O flag is for calling the description method
onmyway133 Aug 30 '15 at 3:11 2015-08-30 03:11
source share