Objective-C不能将NSInteger分配给NSInteger变量?

uni*_*der 3 iphone objective-c nsinteger

这似乎是一个非常愚蠢的问题,但我无法弄清楚为什么我会收到错误.

我有一个实例变量声明为:

NSInteger *scopeSelected;
Run Code Online (Sandbox Code Playgroud)

我正在使用此变量来跟踪在UISearchDisplay控制器中使用以下内容选择的范围:

- (BOOL)searchDisplayController:(UISearchDisplayController *)controller 
shouldReloadTableForSearchScope:(NSInteger)searchOption {
    scopeSelected=searchOption;
    return YES;
}
Run Code Online (Sandbox Code Playgroud)

但是,我一直在分配线上抛出这个警告:

赋值从整数中生成指针而不进行强制转换

有人可以告诉我我的代码有什么问题吗?它不仅仅是NSInteger分配的NSInteger吗?

fal*_*eek 18

NSInteger 是一个int

更改:

NSInteger *scopeSelected;
Run Code Online (Sandbox Code Playgroud)

至:

NSInteger scopeSelected;
Run Code Online (Sandbox Code Playgroud)