HaiRob, thank you for your reply
actually what i want to do is to run my exiting code in IMessage,
i am not so smart with xcode and native c, but i try to follow from corona cards tutorial
to use viewcontroller, because it looks simmiliar.
here is my MessageViewController.m
// // MessagesViewController.m // Sticker // // Created by chandra on 11/30/16. // // #import "MessagesViewController.h" @interface MessagesViewController () @property (nonatomic, strong) CoronaViewController \*coronaController; @end @implementation MessagesViewController - (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view. \_coronaController = [[[CoronaViewController alloc] init] autorelease]; [self addChildViewController:\_coronaController]; UIView \*parent = self.view; CoronaView \*coronaView = (CoronaView \*)\_coronaController.view; // Resize and center CoronaView CGRect rect = parent.frame; rect.size.width \*= 0.5; rect.size.height \*= 0.5; coronaView.frame = rect; // Half the size of the parent coronaView.center = parent.center; // Position at center [parent addSubview:coronaView]; [coronaView run]; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; // Dispose of any resources that can be recreated. } #pragma mark - Conversation Handling -(void)didBecomeActiveWithConversation:(MSConversation \*)conversation { // Called when the extension is about to move from the inactive to active state. // This will happen when the extension is about to present UI. // Use this method to configure the extension and restore previously stored state. NSLog(@"didBecomeActiveWithConversation:\n%@", conversation); } -(void)willResignActiveWithConversation:(MSConversation \*)conversation { // Called when the extension is about to move from the active to inactive state. // This will happen when the user dissmises the extension, changes to a different // conversation or quits Messages. // Use this method to release shared resources, save user data, invalidate timers, // and store enough state information to restore your extension to its current state // in case it is terminated later. } -(void)didReceiveMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when a message arrives that was generated by another instance of this // extension on a remote device. // Use this method to trigger UI updates in response to the message. } -(void)didStartSendingMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when the user taps the send button. } -(void)didCancelSendingMessage:(MSMessage \*)message conversation:(MSConversation \*)conversation { // Called when the user deletes the message without sending it. // Use this to clean up state related to the deleted message. } -(void)willTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle { // Called before the extension transitions to a new presentation style. // Use this method to prepare for the change in presentation style. } -(void)didTransitionToPresentationStyle:(MSMessagesAppPresentationStyle)presentationStyle { // Called after the extension transitions to a new presentation style. // Use this method to finalize any behaviors associated with the change in presentation style. } @end
but when i try to run it, i got these error
objc[1523]: Class CKPPTSubTest is implemented in both /System/Library/PrivateFrameworks/ChatKit.framework/ChatKit (0x1b6422ae0) and /Applications/MobileSMS.app/MobileSMS (0x10014a9a0). One of the two will be used. Which one is undefined. 2016-12-05 14:35:26.791863 Sticker[1524:1986390] +[NSString stringWithExternalString:]: unrecognized selector sent to class 0x1b7108398 2016-12-05 14:35:26.794165 Sticker[1524:1986390] \*\*\* Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '+[NSString stringWithExternalString:]: unrecognized selector sent to class 0x1b7108398' \*\*\* First throw call stack: (0x19203e1c0 0x190a7855c 0x1920451b8 0x192042278 0x191f3c59c 0x1000b69f8 0x1000b65f4 0x100153228 0x1000a9318 0x1000a8518 0x197e990b0 0x197e98c78 0x19875fc0c 0x192044160 0x191f37c3c 0x191f3c6ec 0x198863484 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x191f3c6ec 0x1987b4584 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x191f3c6ec 0x192042078 0x191f3c59c 0x192044160 0x191f37c3c 0x193be58bc 0x193be5728 0x193be5ad0 0x191fec278 0x191febbc0 0x191fe97c0 0x191f18048 0x19399e198 0x197f042fc 0x197eff034 0x19111ecc8 0x191120944 0x192c389d4 0x19a6a6158 0x19a6a5cc0 0x19a6a617c 0x192c1e6e4 0x190efc5b8) libc++abi.dylib: terminating with uncaught exception of type NSException Program ended with exit code: 0(lldb)
maybe you can help me a little bit