objective c - iOS framework is not able to be updated after the initial archiving -
i creating ios framework used in app. followed this tutorial in order , going.
everything worked fine initially. archived project simple following:
e.h
#import <foundation/foundation.h> #import <uikit/uikit.h> foundation_export double eversionnumber; foundation_export const unsigned char eversionstring[]; @interface e : nsobject + (void)showalert; @end
e.m
#import "e.h" @implementation e + (void)showalert { uialertview *alert = [[uialertview alloc] initwithtitle:@"hello there!" message:@"" delegate:nil cancelbuttontitle:@"cool" otherbuttontitles:nil]; [alert show]; } @end
i included archived output of debug , release directories app, , added reference .framework
file via embedded binary section of app's build settings.
i ran app main bit:
viewcontroller.m
#import "viewcontroller.h" #import "e.h" @interface viewcontroller () @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; [e showalert]; } @end
everything works here.
however, weirdness started when tried add method framework's code. updated versioning, cleaned, archived new version of framework, wiped old framework info out of app included, , added new version of framework app.
here updated framework files:
e.h
#import <foundation/foundation.h> #import <uikit/uikit.h> foundation_export double eversionnumber; foundation_export const unsigned char eversionstring[]; @interface e : nsobject + (void)showalert; + (void)shownewalert; @end
e.m
#import "e.h" @implementation e + (void)showalert { uialertview *alert = [[uialertview alloc] initwithtitle:@"hello there!" message:@"" delegate:nil cancelbuttontitle:@"cool" otherbuttontitles:nil]; [alert show]; } + (void)shownewalert { uialertview *alert = [[uialertview alloc] initwithtitle:@"new method!" message:@"does work??" delegate:nil cancelbuttontitle:@"cool" otherbuttontitles:nil]; [alert show]; } @end
i ran app new code:
viewcontroller.m
#import "viewcontroller.h" #import "e.h" @interface viewcontroller () @end @implementation viewcontroller - (void)viewdidload { [super viewdidload]; [e shownewalert]; } @end
the app builds successfully, when run it:
+[e shownewalert]: unrecognized selector sent class 0x10ef57188
why e subclass of nsobject , not subclass of uiviewcontroller?
Comments
Post a Comment