1

I have two VC: StepThreeViewController and QuoteViewController. I am trying to pass data back from QuoteViewController to StepThreeViewController by using a Delegate b/c once I have the data, I want to pop/dismiss the QuoteViewController and pass the data into StepThreViewController.

I'm getting an error that the Delegate Protocol is not found! I followed a youtube tutorial and read a lot of comments on StackOverflow but can not seem to find the error!

I also made sure that my #import of header files were there.

the GitHub to my code is found here: https://github.com/aspirasean/BoxRocket.git

Thanks!

Ricky
  • 10,485
  • 6
  • 36
  • 49
Aspirasean
  • 151
  • 2
  • 9
  • I think you might upload wrongly to Github. I only see .h and .m file. There is no project file nor storyboard file. – Ricky Jun 10 '14 at 01:53
  • @Ricky the project is now uploaded on my git repository but to prevent it from crashing you'll need to enter your own Parse API key in the AppDelegate.m. Thanks for the assist. – Aspirasean Jun 10 '14 at 02:09
  • @Ricky I have it passing "heightField" but I put that as a place holder. I am ultimately trying to pass back "int quote" from the QuoteViewController and display it in the 'quoteLabel' in the StepThreeViewController. – Aspirasean Jun 10 '14 at 02:21

1 Answers1

2

I think under QuoteViewController.hyou have imported "StepThreeViewController.h" which might not be needed. I have commented out that line and it can compile without any error.

#import <UIKit/UIKit.h>
//#import "StepThreeViewController.h"
#import "MBProgressHUD.h"

In case if you need to use StepThreeViewController in QuoteViewController, you might want to take a look at this post: Cannot find protocol declaration

Update:

Under StepThreeViewController.h you should have:-

 @property (nonatomic, strong)  QuoteViewController *controller;

Then in viewDidLoad, you should

self.controller.delegate=self;

You will have to make the StepThreeViewController to be the delegate of the QuoteViewController in order for the delegate method to work.

To learn more about the delegate in Objective-C, you may visit: How do I create delegates in Objective-C?

Community
  • 1
  • 1
Ricky
  • 10,485
  • 6
  • 36
  • 49
  • you know, that worked! I'll need to now figure out if the data actually passed back. Thanks for the help! – Aspirasean Jun 10 '14 at 02:31
  • now the method i've created in the StepThreeViewController is not being called when in QuoteViewController I am calling [self.delegate transferQuote:@"STRING"]; any ideas? – Aspirasean Jun 10 '14 at 02:46