【问题标题】:Don't see why I'm getting a “Method Definition not found error” [closed]不明白为什么我会收到“未找到方法定义错误”[关闭]
【发布时间】:2016-02-04 19:04:55
【问题描述】:

我不得不将一些现有代码移出 AppDelegate 并将其放在一个公共类中,这样就不必重新启动应用程序。在我采取行动之前,一切都在构建并且没有错误并且执行正确。这是我的 .h 文件中的代码:

#import <Foundation/Foundation.h>
#import "AppDelegate.h"
#import "SingletonClass.h"
#import "SettingsViewController.h"
#import "CoreData+MagicalRecord.h"

@interface CommonMethods : NSObject {

}

@property (nonatomic, strong) NSMutableArray *unsortedNailArray;
@property (nonatomic, strong) NSMutableArray *unsortedHairArray;
@property (nonatomic, strong) NSMutableArray *unsortedCustomArray;

-(void) sortAndReloadServicesArray: (NSMutableArray *) textboxValues;
-(void) initalizeEnsembles;

-(void) displayAlert: (NSString *)alertTitle andMessage: (NSString *)alertMessage andViewController: (UIViewController *) viewController andTag:(int)tag;
-(NSMutableDictionary *) createStaffNamesDictionary;
-(NSMutableArray *) createStaffNamesArray;
-(BOOL)testConnectionToInternet;

-(void) initializeEnsembles;  //  definition that is missing?

- (NSString *) convert12HourTimeTo24HourTime: dateString andReturnType: (NSString *) dateOrDateTime;
- (NSString *) convert24HourTimeTo12HourTime: (NSString *)timeString;
- (NSNumber *) checkForApptOverlap: startTime andStopTime: stopTime andServiceTech: serviceTech;

@end

这是关联的 .m 文件:

#import "CommonMethods.h"

@interface CommonMethods () <CDEPersistentStoreEnsembleDelegate>
@end

@implementation CommonMethods  {

CDEPersistentStoreEnsemble *ensemble;
CDEICloudFileSystem *cloudFileSystem;
}

@synthesize unsortedNailArray;
@synthesize unsortedHairArray;
@synthesize unsortedCustomArray;


#pragma mark - initializeEnsembles
-(void) initializeEnsembles  {  //  <---- here it is!

// set Ensembles verbose logging
CDESetCurrentLoggingLevel(CDELoggingLevelVerbose);

//  Ensemble: load the model
NSManagedObjectModel *model = [NSManagedObjectModel MR_newManagedObjectModelNamed:@"salonbook.momd"];  //  (xcdatamodeld)
[NSManagedObjectModel MR_setDefaultManagedObjectModel:model];

【问题讨论】:

    标签: objective-c ios9 xcode7


    【解决方案1】:

    有类似的方法声明

    -(void) initalizeEnsembles;
    

    sortAndReloadServicesArray 之后没有i

    【讨论】:

    • 难以置信!非常感谢! (我看了又看了一个多小时……)
    猜你喜欢
    • 2013-11-05
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2012-01-30
    • 1970-01-01
    • 2016-02-03
    • 1970-01-01
    相关资源
    最近更新 更多