cat*_*eof 4 iphone xcode objective-c ios
我正在接受Xcode的警告.这是代码
DeviceList *dList = (DeviceList* )[[User thisUser] devices];
[dList getListId];
Run Code Online (Sandbox Code Playgroud)
警告声明未找到实例方法-getListId.但是该方法存在于我的源代码中
- (NSString*) getListId
{
T
if ( ... != nil)
{
return ...;
}
else
{
return @"";
}
}
Run Code Online (Sandbox Code Playgroud)
我在调用方法时无法弄清楚问题是什么.
在你的DeviceList.h中,确保你有
@interface DeviceList : Parent
- (NSString*) getListId;
..
..
@end
Run Code Online (Sandbox Code Playgroud)
当您的方法未在头文件中声明并且您尝试在(自己)类之外调用它时,会发出警告.