> On Apr 15, 2015, at 12:47 , Marco S Hyman <[email protected]> wrote: > > >> On Apr 15, 2015, at 12:29 PM, Rick Mann <[email protected]> wrote: >> >> I used to have this code prior to 1.2, which compiled and ran fine, but now >> I get an error on the last line: >> >> '?' must be followed by a call, member lookup, or subscript > > … > >> >> var query : String?; > >> >> log("query: '\(query?)'”); > > Use > > log("query: '\(query)'”); > > If query is nil the result will be “query: ‘nil’” because string interpolation > works with optionals.
I stand corrected; that *does* work. I think I fell victim to Xcode showing me an error because although it worked in the current target, I had not yet rebuilt another target, so it was still showing the error (I REALLY hate Xcode's error reporting). Thanks! -- Rick Mann [email protected] _______________________________________________ Cocoa-dev mailing list ([email protected]) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [email protected]
