English 中文(简体)
应急行动
原标题:Redundant Compiler Warnings

我发现,我常常在用我的我的“目标1”与我的“目标1”调和时,得到警告说,“我的目标1”可能不会对我的“好像”作出反应,但方案却只得罚款。 为什么没有编辑在汇编时承认所宣布的方法?

John Doner

最佳回答

经常发生这种情况的一个情况是,含有物体的变数类型是超级类别,而这种方法仅针对子类别。 可以通过将其归类为<条码>id或使静态打字更为具体的方式避免这种情况。 如果变量类型是类别本身,则可能发现,这种方法在你再次试图援引该方法的范围之内,而另一种答案则涉及这种情况。

问题回答

这表明是一种警告,因为目标C是一种非常活跃的语言。 编辑时发现,在试图汇编案卷时,“Method”声明(如果你没有头盔档案,或想把档案列入头盔?) 。 然而,它只是发出警告,因为目标C有能力在操作时间制造和装载额外方法,以便在守则执行时,这种方法将存在。 因此,这只是警告。

很可能,你只是先在适当的主人档案中宣布这种方法。

警告意味着你重新要求一种汇编者尚未看到方法申报的方法。 这是大多数其他语文的错误,当然是你不能忽视的警告。

如果您在来源档案(如果是私人方法)的顶点上或上课的头部档案(如果是公共方法的话)上打上了@interface的栏目。

如果你在头盔档案中宣布了这种方法,则肯定会进口头盔档案。

如果你宣布了这一方法,而且你正在进口正确的头盔文件,你就有一个打字体。

有时,如果你重新使用代表类别,你需要用这些代表方法界定一个类别,以便汇编者找到这些类别。

通常增加

@class myObject1

解决这个问题。 https://stackoverflow.com/questions/322597/objective-c-class-vs-import>。 目 录 页: 1





相关问题
Asynchronous request to the server from background thread

I ve got the problem when I tried to do asynchronous requests to server from background thread. I ve never got results of those requests. Simple example which shows the problem: @protocol ...

objective-c: Calling a void function from another controller

i have a void, like -(void) doSomething in a specific controller. i can call it in this controller via [self doSomething], but i don t know how to call this void from another .m file. I want to call ...

ABPersonViewController Usage for displaying contact

Created a View based Project and added a contact to the AddressBook using ABAddressBookRef,ABRecordRef now i wanted to display the added contact ABPersonViewController is the method but how to use in ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

NSUndoManager and runModalForWindow:

I have a simple Core Data app which displays a list of entities in the main window. To create or add new entities, I use a second modal window with a separate managed object context so changes can be ...

NSMutableArray values becoming "invalid"

I m trying to show a database information in a tableview and then the detailed information in a view my problem is as follow: I created a NSMutableArray: NSMutableArray *myArray = [[NSMutableArray ...

iPhone numberpad with decimal point

I am writing an iPhone application which requires the user to enter several values that may contain a decimal point (currency values, percentages etc.). The number of decimal places in the values ...

热门标签