Lately I got back to one of my previous projects o make some updates, I was thinking I could use the new nullability feature of Xcode. I added the nullability to some of my properties like so:
@property (strong, nonatomic, nullable) NSString *itemDetailTitle;
but it seems I don't get any warning when setting a value in an array with this property. I've found some articles about getting rid of all the nullability warnings, but I actually have an opposite problem, I want these warnings to appear in my Xcode, so I can react appropriately, is it somehow possible??
thx!
UPDATED
The code I think should be showing warning:
[[Mixpanel sharedInstance]
track:MIXPANEL_ITEM_DETAIL_TRACK_ID
properties:@{
@"item location" : _itemDetail.itemDetailLocation,
@"item title" : _itemDetail.itemDetailTitle,
@"item price" :_itemDetail.itemDetailPrice
}
];
All of the various nullability annotations added to Objective-C were done to improve import of Objective-C code into a Swift environment. The extent to which
clang
will warn within Objective-C code itself is just a bonus, and is limited to assignments to the variable or property in question.If you wish it to extend to usage of the variable or property, file an enhancement request with Apple or the
clang
developers.