I had an issue, which I originally thought was related to my Xamarin bindings. However, I have now made a sample Objective-C app, to remove Xamarin from the equation, and I have the same issue. I have created a library with the following header:
#import <Foundation/Foundation.h>
@interface StarIOFunctions : NSObject {
}
+ (NSMutableData *) GetDataToSendToPrinter:(UIImage *)image maxWidth:(int)maxWidth drawerKick:(BOOL)drawerKick compressionEnable:(BOOL)compressionEnable;
@end
And am calling it from my app on the click of a button:
- (IBAction)DevButton_TouchUpInside:(id)sender {
UIImage *imageToPrint = [UIImage imageNamed:@"image1.png"];
NSMutableData *commandsToPrint = [StarIOFunctions GetDataToSendToPrinter:imageToPrint maxWidth:100 drawerKick:YES compressionEnable:YES];
}
Everything works fine in the simulator but crashes when I deploy to device with:
2014-10-02 13:34:04.821 StarIO SDK[449:95479] +[StarIOFunctions GetDataToSendToPrinter:maxWidth:drawerKick:compressionEnable:]: unrecognized selector sent to class 0x13dddc
2014-10-02 13:34:04.825 StarIO SDK[449:95479] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[StarIOFunctions GetDataToSendToPrinter:maxWidth:drawerKick:compressionEnable:]: unrecognized selector sent to class 0x13dddc'
*** First throw call stack:
(0x24b2df87 0x324cac77 0x24b33299 0x24b31259 0x24a62d68 0xce213 0x27fdd497 0x27fdd439 0x27fc804d 0x27fdce69 0x27fdcb43 0x27fd6451 0x27faccc5 0x28220513 0x27fab707 0x24af4807 0x24af3c1b 0x24af2299 0x24a3fdb1 0x24a3fbc3 0x2bd74051 0x2800ba31 0x93a3f 0x93040)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
Someone has mentioned about the difference between the device and simulator with regards to case, but the filename is deffinitely lower case:
Whats causing my app to crash?