不明白为什么我收到“未找到方法定义错误”

时间:2016-02-04 19:04:55

标签: objective-c ios9 xcode7

我不得不将一些现有代码移出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];

1 个答案:

答案 0 :(得分:1)

有类似的方法声明

-(void) initalizeEnsembles;
i

之后

没有sortAndReloadServicesArray