Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xcode/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Objective c XCode 4不允许我添加新方法_Objective C_Xcode - Fatal编程技术网

Objective c XCode 4不允许我添加新方法

Objective c XCode 4不允许我添加新方法,objective-c,xcode,Objective C,Xcode,我已经用xcode 4工作了几个月了,现在没有问题,还有一些问题,但那是另一回事,现在有一个奇怪的问题。我不能添加任何新方法。。。我的意思是,当我添加一个新方法时,xcode无法识别它。follow标记没有看到它,调试器错误地说没有该名称的方法。然而,它上面的方法使用完全相同的签名减去名称,效果非常好 以前有人见过这个吗?如果是这样的话,请把我送到正确的方向。任何帮助,我都将永远感激 - (void)showMyCalendar:(TKCalendarMonthView*) calendar1

我已经用xcode 4工作了几个月了,现在没有问题,还有一些问题,但那是另一回事,现在有一个奇怪的问题。我不能添加任何新方法。。。我的意思是,当我添加一个新方法时,xcode无法识别它。follow标记没有看到它,调试器错误地说没有该名称的方法。然而,它上面的方法使用完全相同的签名减去名称,效果非常好

以前有人见过这个吗?如果是这样的话,请把我送到正确的方向。任何帮助,我都将永远感激

- (void)showMyCalendar:(TKCalendarMonthView*) calendar1
{
        if (calendar1.frame.origin.y == -calendar1.frame.size.height+calendarShadowOffset) 
    {
        [self displayCalendar:calendar1];
    }
    else
    {
        [self hideCalendar:calendar1];
    }
    [self showMyCalendar:calendar1]; // If I put a call here xcode sees it.
}


- (void)anotherMethod:(TKCalendarMonthView*) calendar1
{
        if (calendar1.frame.origin.y == -calendar1.frame.size.height+calendarShadowOffset) 
    {
        [self displayCalendar:calendar1];
    }
    else
    {
        [self hideCalendar:calendar1];
    }
    [self showMyCalendar:calendar1]; // If I put a call here xcode DOES NOT see it.
}
谢谢,
Ed

是否在.h文件中包含此方法所包含的.m文件的方法定义

- (void)anotherMethod:(TKCalendarMonthView*) calendar1;

请提供您的方法声明和实现。谢谢。好的,更多关于这个问题。。。也许我只是不太精通客观的。。。我通过[self-method-name]调用它,在方法本身中它看到了它,但在另一个方法中它没有。。。很可能有一个简单的解释,但我肯定一无所知。请告知。如果您在.h文件中声明了该方法,其他对象应该可以看到它。如果您在.m文件中声明了它,其他对象将看不到它。请不要将您的代码放在注释中,编辑您的原始问题并将它们添加到那里(请也使用代码格式功能)好的,明白了!我不认为你必须在同一个文件中这样做。杰里米其实也早一点回答了这个问题。只要它们在同一个文件中,你实际上不必这么做。。。如果您在Xcode 4.3中使用LLVM编译器。新功能。嗯,Xcode 4.3。我使用的是4.2。也许需要升级。非常感谢大家的帮助。!