kishikawakatsumi / UICKeyChainStore

UICKeyChainStore is a simple wrapper for Keychain on iOS, watchOS, tvOS and macOS. Makes using Keychain APIs as easy as NSUserDefaults.
http://kishikawakatsumi.com
MIT License
3.08k stars 383 forks source link

Only define -testArgumentError when nullability is unavailable. #121

Closed danielphillips closed 8 years ago

danielphillips commented 8 years ago

Having imported UICKeyChainStore via Carthage into my project. I am getting the follow unpleasant warnings:

/Users/daniel/Documents/Code/trainline/Carthage/Checkouts/UICKeyChainStore/Lib/UICKeyChainStoreTests/UICKeyChainStoreTests.m:1471:12: warning: null passed to a callee that requires a non-null argument [-Wnonnull]
    [store setString:@"kishikawakatsumi" forKey:nil error:&error];

My pull request deals with this by only defining the -testArgumentError only when nullability is unavailable. Also enabled the CLANG_WARN_NULLABLE_TO_NONNULL_CONVERSION warning.

danielphillips commented 8 years ago

I only got one warning when I was integrating this into my project. Which I fixed. But I enable the wrong warning flag so now there are many more warnings of misuse of nullability.

Also my pull request has been automatically rejected because the test coverage has decreased (expected as I've effectively removed one test for Xcode 7).

I'll do some more work on this to either enable to correct warning flag to reproduce my initial issue or fix the misuse of nullability.

kishikawakatsumi commented 8 years ago

Thanks for PR!!