On Apr 26, 2015, at 12:40 , Charles Jenkins <cejw...@gmail.com> wrote: > > Is this a disaster in Swift-to-ObjC bridging, or have I done something wrong > to cause it?
> func textView( tv:NSTextView, shouldChangeTextInRange range:NSRange, > replacementString:String ) -> Bool The problem is that the replacement string can be nil (if only attributes are being changed, which is what happens when you Command-B), but the bridged signature is missing a ‘?’ on the replacementString type. (You can see this if you change the type to ’String!’, ignore the warning, and see the log message when you run.) Why this is, I don’t know, but I doubt it’s your fault. This delegate method is described as “superseded” in the header file. I suggest you try using the recommended method: > func textView(textView: NSTextView, shouldChangeTextInRanges > affectedRanges: [AnyObject], replacementStrings: [AnyObject]?) -> Bool _______________________________________________ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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 arch...@mail-archive.com