Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate a few deprecated methods to reduce build warnings #67

Merged
merged 8 commits into from Apr 10, 2019

Conversation

tolmasky
Copy link
Collaborator

@tolmasky tolmasky commented Apr 9, 2019

In this PR I've tried to start tackling some of the deprecated methods that are generating a bunch of warnings in XCode. Specifically I've fixed:

  1. I believe all the warnings in FindReplaceController.m (updated beginSheetModalForWindow:)
  2. I believe all the warnings in PlainTextWindowController.m (updated beginSheetModalForWindow:)
  3. I believe all the warnings in SEEDocumentController.m (beginSheetModalForWindow: and alertWithMessageText:)
  4. I've also converted a bunch of ints and longs to NSInteger and NSUInteger as I had that warning turned on before. This is pretty straight forward most the time, except I've changed a (a == b - 1) to (a + 1 == b) here in order to be able to use NSUInteger.

This is a partial fix for #66.

…d +alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:.

Reviewed by @tolmasky.
…precated +alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:.

Reviewed by @tolmasky.
…onger use deprecated -beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:.

Reviewed by @tolmasky.
…t: in FindReplaceController to no longer use deprecated -beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:.

Reviewed by @tolmasky.
@tolmasky
Copy link
Collaborator Author

tolmasky commented Apr 10, 2019

I have gone ahead and replaced all the instances of -insertText: with -insertText:replacementRange:. There are now only 10 warnings in the SubEthaEdit project, all related to an alert that isn't as trivial to update.

…Bump to no longer use deprecated +alertWithMessageText:defaultButton:alternateButton:otherButton:informativeTextWithFormat:.

Reviewed by @tolmasky.
…r use deprecated -beginSheetModalForWindow:modalDelegate:didEndSelector:contextInfo:.

Reviewed by @tolmasky.
@tolmasky
Copy link
Collaborator Author

There were a couple more that were easy, down to 6 warnings. I think I'll stop here for this PR and do the other ones in a separate PR.

@monkeydom monkeydom merged commit e2a2902 into subethaedit:develop Apr 10, 2019
@monkeydom
Copy link
Contributor

Thanks! Generally speaking I'm not too fond of the NSUInteger for count changes
a) if count exceeds NSInteger the current collection classes fail because of different reasons, so the amount isn't needed
b) lots of subtle unhappy things can happen with unsigned types. So generally I'd rather leave stuff as it is or convert it to signed variants instead of just making the compiler happy bout inbound NSUInteger typed methods, like e.g. count.

That being said: your fixes all look sound.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants