Can Objective-C not assign NSInteger to an NSInteger variable?

This will seem like a really stupid question, but I cannot understand why I am getting an error.

I have an instance variable declared as:

NSInteger *scopeSelected;

I use this variable to track which area was selected in the UISearchDisplay controller using:

- (BOOL)searchDisplayController:(UISearchDisplayController *)controller 
shouldReloadTableForSearchScope:(NSInteger)searchOption {
    scopeSelected=searchOption;
    return YES;
}

However, I continue to receive this warning in the destination line:

Destination makes a pointer out of the whole without a throw

Can someone please tell me what is wrong with my code? Isn't that just an NSInteger assignment for NSInteger?

+3
source share
1 answer

NSInteger is an int

changes:

NSInteger *scopeSelected;

at

NSInteger scopeSelected;
+18
source

Source: https://habr.com/ru/post/1759375/


All Articles