Passing data between views tutorial – using a protocol & delegate in your iPhone app.

The first time I had to pass some data around between views I didn’t know how I was supposed to do it. I looked around a little bit and never found a good answer. Well I didn’t look hard enough and I ended up doing what a lot of others do. I stuck some variables in the app delegate and then I would set them and access them from different places in the app. I saw plenty of examples of other people doing this and suggesting it, usually with the condition that it wasn’t too much data.

final simulator shot

Do a quick search for passing data between views and you will see all kinds of answers about using the singleton method or using the app delegate.

I’m here to tell you don’t do it! That is not the best practice recommended by Apple. Instead use a protocol and delegate. It’s really pretty easy and is the way Apple recommends passing data between views on an iPhone.

This tutorial is fairly long, really it’s about as long as I am willing to make a tutorial. But the first 16 steps are really just setting up the app before we even dig into the meat and bones of passing the data. If you just want to see some code demonstrating how to pass the data between views, just skip on down to step 17 and have at it.

Here we go.

1.) Create a new Window-based Application, and name it DataTutorial.

2.) Before we get to doing anything with the data we need to set up our views so we have something to work with. Right click on Classes and select Add > New File…

Select UIViewController subclass and check the box that says With XIB for user interface.

Description of pic

Name the file FirstViewController.

Description of pic

It’s going to put the nib file (FirstViewController.xib) in the classes folder. I like to keep all the nib files in the Resources folder so I’ll be moving mine there.

3.) Now repeat step 2 and name the file SecondViewController. Here’s what we have at this point.

Description of pic

4.) We’re going to add a NavigationController to handle our views. Open up DataTutorialAppDelegate.h and add a UINavigationController. While we’re here let’s go ahead and add our FirstViewController too. You’ll also need to import the FirstViewController.

#import 
#import "FirstViewController.h"


@interface DataTutorialAppDelegate : NSObject  
{
    UIWindow				*window;
	UINavigationController	*navigationController;
	FirstViewController		*firstViewController;
}

@property (nonatomic, retain) IBOutlet UIWindow			*window;
@property (nonatomic, retain) UINavigationController	*navigationController;
@property (nonatomic, retain) FirstViewController		*firstViewController;

@end

5.) Now open up DataTutorialAppDelegate.m and synthesize the variables we just added to the header file.

#import "DataTutorialAppDelegate.h"

@implementation DataTutorialAppDelegate

@synthesize window;
@synthesize navigationController, firstViewController;

In our application:didFinishLaunchingWithOptions method we need to implement our navigationController, and add it to the window as a subview. Then we’re going to push our firstViewController into view.

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{    
	
	//    // Override point for customization after application launch.
	
	navigationController = [[UINavigationController alloc] init];
	[self.window addSubview:[self.navigationController view]];
	
	if(self.firstViewController == nil)
	{
		FirstViewController *viewTwo = [[FirstViewController alloc] initWithNibName:@"FirstViewController" bundle:[NSBundle mainBundle]];
		self.firstViewController = viewTwo;
		[viewTwo release];
	}
	[self.navigationController pushViewController:self.firstViewController animated:YES];
	
	
    [self.window makeKeyAndVisible];
    
    return YES;
}

That’s all we need to do in our App Delegate file you can save and close it.

6.) Before we do any coding in our first and second view controllers, let’s set up our views in Interface Builder. Open up FirstViewController.xib.

Add a UILabel and UITextField next to it. The label should read Favorite Color. Then add two UILabels below it. I also like to set a background color just to brighten things up.

Here’s what my first view looks like.

Description of pic

7.) Now do the same thing setting up our second view. In our second view the user should enter their second favorite color.

Here’s what mine looks like.

Description of pic

8.) We’re done with Interface Builder for the moment. We’ll need to come back later and connect out outlets, but for now save everything and go back to Xcode. You can click Build and Run at this point and confirm that our first view is getting loaded.

Description of pic

9.) Open up FirstViewController.h and let’s add our outlets and a SecondViewController. Don’t forget to import SecondViewController.h.

#import 
#import "SecondViewController.h"

@interface FirstViewController : UIViewController 
{

	SecondViewController	*secondViewController;
	
	IBOutlet UITextField	*favoriteColorTextField;
	IBOutlet UILabel		*favoriteColorLabel;
	IBOutlet UILabel		*secondFavoriteColorLabel;
	
}

@property (nonatomic, retain) SecondViewController	*secondViewController;
@property (nonatomic, retain) IBOutlet UITextField	*favoriteColorTextField;
@property (nonatomic, retain) IBOutlet UILabel		*favoriteColorLabel;
@property (nonatomic, retain) IBOutlet UILabel		*secondFavoriteColorLabel;

@end

10.) Next open up the implementation file (FirstViewController.m). Import SecondViewController.h and synthesize our variable that we added to the header file.

#import "FirstViewController.h"
#import "SecondViewController.h"


@implementation FirstViewController


@synthesize secondViewController, favoriteColorTextField, favoriteColorLabel, secondFavoriteColorLabel;

11.) We need a way to dismiss the keyboard when a user is done typing in the textField. We’ll use the method textFieldShouldReturn:theTextField for this.

// dismisses the keyboard when a user selects the return key
- (BOOL) textFieldShouldReturn: (UITextField *) theTextField
{
	[theTextField resignFirstResponder];
	
	return YES;
}

Later we’ll need to remember to add our view controller as a delegate for the textField when we get back in Interface Builder.

12.) We need a method that will push the next view into place. Let’s call this one goToViewTwo.



- (void) goToViewTwo
{
	if(self.secondViewController == nil)
	{
		SecondViewController *viewTwo = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
		self.secondViewController = viewTwo;
		[viewTwo release];
	}
	[self.navigationController pushViewController:self.secondViewController animated:YES];
	
}

13.) Finally we need someway to navigate to our second view. We’re going to do that with a UIBarButtonItem that we’ll add to the UINavigationBar. This goes in the viewDidLoad method of FirstViewController.m and this button will call our goToViewTwo method.

- (void)viewDidLoad 
{
    [super viewDidLoad];
	
	UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStyleBordered target:self action:@selector(goToViewTwo)];
	self.navigationItem.rightBarButtonItem = nextButton;

}

I’m not taking the time to explain a lot of this since really the subject of this tutorial is passing data. If you don’t understand some of what we’re doing to set things up so far you can go through some of the other tutorials.

Now if you click Build and Run you can see our button in the navigation bar and go between the two views.

Description of pic

14.) We still need to add our outlets and variables to SecondViewController and hook everything up so let’s go ahead and take care of that.

Here’s the header file(SecondViewController.h).

#import 


@interface SecondViewController : UIViewController 
{
	
	IBOutlet UITextField *secondFavoriteColorTextField;
	IBOutlet UILabel	 *favoriteColorLabel;
	IBOutlet UILabel	 *secondFavoriteColorLabel;	
	
}

@property (nonatomic, retain) IBOutlet UITextField	*secondFavoriteColorTextField;
@property (nonatomic, retain) IBOutlet UILabel		*favoriteColorLabel;
@property (nonatomic, retain) IBOutlet UILabel		*secondFavoriteColorLabel;

@end

In the implementation file (SecondViewController.m) we need to synthesize our variables,

#import "SecondViewController.h"


@implementation SecondViewController

@synthesize secondFavoriteColorTextField, favoriteColorLabel, secondFavoriteColorLabel;

and add the method to dismiss the keyboard.

// dismisses the keyboard when a user selects the return key
- (BOOL) textFieldShouldReturn: (UITextField *) theTextField
{
	[theTextField resignFirstResponder];
	
	return YES;
}

15.) Now let’s open Interface Builder and connect it all.

Connect out textField and the labels to appropriate outlets. If you need help with this see the Interface Builder Tutorial.

Description of pic

Do the same thing for both views.

Description of pic

We also need to set the delegate for the textFields to File’s Owner so that the keyboard will go away when a user hits the returns key. You can do this by control clicking on a textField and dragging to File’s Owner, then select delegate.

16.) Okay after all that we are done setting the app up and you can Build and Run if you want. Everything works fine but we aren’t passing the data yet. It’s finally time to dig into that.

The first thing we will do is pass the data forward from our FirstViewController to our SecondViewController. In order to do this SecondViewController needs an NSString to hold the data passed to it. Add the string to the header file.

#import 

@interface SecondViewController : UIViewController 
{
	
	IBOutlet UITextField *secondFavoriteColorTextField;
	IBOutlet UILabel	 *favoriteColorLabel;
	IBOutlet UILabel	 *secondFavoriteColorLabel;	
	
	NSString			 *favoriteColorString;
}

@property (nonatomic, retain) IBOutlet UITextField	*secondFavoriteColorTextField;
@property (nonatomic, retain) IBOutlet UILabel		*favoriteColorLabel;
@property (nonatomic, retain) IBOutlet UILabel		*secondFavoriteColorLabel;

@property (copy) NSString	*favoriteColorString;

@end

Then open up the implementation file and synthesize our string.

#import "SecondViewController.h"


@implementation SecondViewController

@synthesize secondFavoriteColorTextField, favoriteColorLabel, secondFavoriteColorLabel;
@synthesize favoriteColorString;

While we have the file open let’s go ahead and set our favorite color label to the string that is being sent. This label is going to show us the color that a user enters into the text field in the first screen. The FirstViewController is going to set the text from the text field into the string in SecondViewController and that string is then going to be set into the label on the screen.

We’re going to do this in the viewWillAppear method which we need to implement.

- (void) viewWillAppear:(BOOL)animated
{
	favoriteColorLabel.text = favoriteColorString;	
}

17.) Now we need to go back into FirstViewController.m and set the string in our second controller. A good place to do this in the goToViewTwo method because we already have a reference to our secondViewController.

- (void) goToViewTwo
{
	if(self.secondViewController == nil)
	{
		SecondViewController *viewTwo = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
		self.secondViewController = viewTwo;
		[viewTwo release];
	}

	secondViewController.favoriteColorString = [[NSString alloc] initWithFormat:@"Your favorite color is %@", favoriteColorTextField.text];
	[self.navigationController pushViewController:self.secondViewController animated:YES];
	
}

While we’re at it let’s set our favorite color label with the text in the textField. We’ll do that in the method textFieldDidEndEditing:textField which we need to implement.

- (void)textFieldDidEndEditing:(UITextField *)textField
{
	favoriteColorLabel.text = [[NSString alloc] initWithFormat:@"Your favorite color is %@", favoriteColorTextField.text];
}

We are now passing the data from the first view to the second. Try it out, hit Build and Run and enter a color into the text field in our first view. Then go to the second view by using the next button and you’ll see the color you entered in the first label.

Description of pic

Passing the data forward was fairly easy, but what about passing the data backwards?

18.) In order to pass the data backwards we are going to use a protocol and delegate.

What happens is we set up our protocol in SecondViewController. The protocol specifies that any other class adopting the protocol needs to implement the methods the protocol defines.

We set up the protocol in the header file like this. The name of the protocol is whatever you want it to be.

#import 

@protocol PassSecondColor 
@required
- (void) setSecondFavoriteColor:(NSString *)secondFavoriteColor;
@end

Then we need to define an instance variable for the delegate. It uses type id because it’s type is not actually known at compile time. Let’s also set it’s property.

Here’s the complete header file when we are done.

#import 

@protocol PassSecondColor 
@required
- (void) setSecondFavoriteColor:(NSString *)secondFavoriteColor;
@end

@interface SecondViewController : UIViewController 
{
	
	IBOutlet UITextField *secondFavoriteColorTextField;
	IBOutlet UILabel	 *favoriteColorLabel;
	IBOutlet UILabel	 *secondFavoriteColorLabel;	
	
	NSString			 *favoriteColorString;

	id  delegate;

}

@property (nonatomic, retain) IBOutlet UITextField	*secondFavoriteColorTextField;
@property (nonatomic, retain) IBOutlet UILabel		*favoriteColorLabel;
@property (nonatomic, retain) IBOutlet UILabel		*secondFavoriteColorLabel;

@property (copy) NSString	*favoriteColorString;

@property (retain) id delegate;

@end

19.) In our implementation class (SecondViewController.m) we first need to synthesize our delegate instance variable we just added to the header.

#import "SecondViewController.h"


@implementation SecondViewController

@synthesize secondFavoriteColorTextField, favoriteColorLabel, secondFavoriteColorLabel;
@synthesize favoriteColorString;
@synthesize delegate;

We are also going to set our label for second favorite color while we’re here. Let’s implement the method textFieldDidEndEditing:textField and let’s set our label with the text entered into the text box. This doesn’t have anything to do with passing the data, but it helps make things complete.

- (void)textFieldDidEndEditing:(UITextField *)textField
{
	secondFavoriteColorLabel.text = [[NSString alloc] initWithFormat:@"Your second favorite color is %@", secondFavoriteColorTextField.text];
}

Now we need to call our method defined in the protocol and implemented in FirstViewController. We’ll do this in a method we need to implement named viewWillDisappear:animated.

- (void) viewWillDisappear:(BOOL) animated
{
	[[self delegate] setSecondFavoriteColor:secondFavoriteColorTextField.text];
}

What happens is when we go back and add code to FirstViewController we’ll make it a delegate of our protocol. So the first part

[[self delegate]

points us to our delegate, FirstViewController in this case and then the second part

setSecondFavoriteColor:secondFavoriteColorTextField.text];

just calls the method and passes the data.

20.) Okay we’re done with SecondViewController, so save and close it. We need to do some work in FirstViewController. Open up the header file (FirstViewController.h).

The first thing we’ll do is add a string to hold the data being passed just like we did for secondViewController. Then we need to set our class to adopt the protocol we defined in SecondViewController. We named the protocol PassSecondColor and we add it the same way we would add a delegate to the class.

#import 
#import "SecondViewController.h"

@interface FirstViewController : UIViewController 
{

	SecondViewController	*secondViewController;
	
	IBOutlet UITextField	*favoriteColorTextField;
	IBOutlet UILabel		*favoriteColorLabel;
	IBOutlet UILabel		*secondFavoriteColorLabel;
	
	NSString				*secondFavoriteColorString;
	
}

@property (nonatomic, retain) SecondViewController	*secondViewController;
@property (nonatomic, retain) IBOutlet UITextField	*favoriteColorTextField;
@property (nonatomic, retain) IBOutlet UILabel		*favoriteColorLabel;
@property (nonatomic, retain) IBOutlet UILabel		*secondFavoriteColorLabel;

@property (copy) NSString	*secondFavoriteColorString;

@end

21.) That’s it for the header file, now open up the implementation file. Remember since this file is adopting the protocol we defined it needs to implement the method defined in the protocol. This method is setSecondFavoriteColor:secondFavoriteColor. So add this method implementation to our file.

- (void) setSecondFavoriteColor:(NSString *)secondFavoriteColor
{
	secondFavoriteColorString = secondFavoriteColor;
}

Before we forget let’s synthesize our string that holds the data.

#import "FirstViewController.h"
#import "SecondViewController.h"


@implementation FirstViewController


@synthesize secondViewController, favoriteColorTextField, favoriteColorLabel, secondFavoriteColorLabel;
@synthesize secondFavoriteColorString;

We need to set the second favorite color label sometime when the view is going to appear. We’ll do this in viewWillAppear:animated which we’ll have to implement.

- (void)viewWillAppear:(BOOL)animated
{
	secondFavoriteColorLabel.text = [[NSString alloc] initWithFormat:@"Your second favorite color is %@", secondFavoriteColorString];
}

We have one last thing to do and that’s actually tell SecondViewController that FirstViewController will be it’s delegate. We’ll do this in goToViewTwo where we already have an reference to SecondViewController.

- (void) goToViewTwo
{
	if(self.secondViewController == nil)
	{
		SecondViewController *viewTwo = [[SecondViewController alloc] initWithNibName:@"SecondViewController" bundle:[NSBundle mainBundle]];
		self.secondViewController = viewTwo;
		[viewTwo release];
	}

	secondViewController.favoriteColorString = [[NSString alloc] initWithFormat:@"Your favorite color is %@", favoriteColorTextField.text];
	[secondViewController setDelegate:self];

	[self.navigationController pushViewController:self.secondViewController animated:YES];
	
}

22.) That’s it save everything, click Build and Run and see it in action.

Description of pic

Well that was a fairly long one, but there you have it, passing data between views using a protocol and delegate.

As always here’s the code.



This entry was posted in Data and tagged , , , , , , , , , , . Bookmark the permalink.

52 Responses to Passing data between views tutorial – using a protocol & delegate in your iPhone app.

  1. Pingback: Passing Data Between Views in Tab Bar Applications - iPhone Dev SDK Forum

  2. fdnj says:

    Nice topic – respect !

  3. Yahwe says:

    How much is a link to your site? My site http://yahwe.ru/

  4. PolpravHalf says:

    Здраствуйте)
    Не желаете обменяться ссылками?

  5. Pingback: XCode Question - Accessing Text Box From Another View Controller - iPhone Dev SDK Forum

  6. Pingback: Pass data from DetailView to Tableview? - iPhone Dev SDK Forum

  7. Alex says:

    Great work!!! Thank you.

  8. bob says:

    Hi, I have done this tutorial and it’s great. However, if I have three windows (first view controller, second view controller, and third), where the first and second view controllers have UINavigation bars, how do you establish the first window to be the main window. I ask because every time I run the project the second window appears first and I have to press back to get to the first window, as well my data doesn’t seem to pass to the third window when I input info into text fields of the second window.

    • bob says:

      Scratch the no passing of info from second to third…I just messed a line up…however, the rest still applies.

      • Kent says:

        Check in your app delegate method didFinishLaunchingWithOptions. You must be setting the second view controller instead of the first if the second view always comes up first. Also the third view controller should have a navigation bar also in order to get back from it.

        You might want to check out using a Tab Bar app instead, I say this without nothing much of anything at all about your app so I could be wrong. Just a guess.

        I haven’t forgotten about your search with core data issue, I’m working something up for that.

        Good luck!

      • Kent says:

        Bob, don’t know if you’re still around or still needing help, but check out the latest tutorials on using Core Data with a Tab Bar App, I think it will provide everything you need.

  9. Rita says:

    Really great work!
    Thank you….

  10. Adam says:

    THE MOST USEFUL, CLEARLY PRESENTED, AND HELPFUL TUTORIAL I’VE RUN ACROSS YET, HANDS DOWN!!!!!

    A thousand thanks for your work, HUGE break through after a year plus of learning how to program for iOS.

  11. Melissa says:

    This was awesome, just want i needed

  12. David says:

    You have several lines that have been cut. Like
    The action when you added the Next-button. What should the action be?

    • Kent says:

      Sorry about that, I’ll try to fix it when I get a chance. The action called is the goToViewTwo action. The viewDidLoad method should look like this.


      - (void)viewDidLoad
      {
      [super viewDidLoad];

      UIBarButtonItem *nextButton = [[UIBarButtonItem alloc] initWithTitle:@"Next" style:UIBarButtonItemStyleBordered target:self action:@selector(goToViewTwo)];
      self.navigationItem.rightBarButtonItem = nextButton;
      }

  13. Jack says:

    Nice code! Just a question about memory management though. It appears that you haven’t released the NSString and when I do the data does not pass backward. I get an error that it is deallocated. If not deallocated, won’t there be a memory leak in the app?

    • Kent says:

      Good question. I am admittedly very slack in my tutorials when it comes to memory management. The tutorials tend to be very specific in nature and I often blow off the memory management and just focus on the task at hand. Terrible habit on my part.

      Where are you releasing the strings? I am able to release them in the appropriate dealloc method with no ill effects.

      • Jack says:

        I tried releasing them in the the dealloc method in each controller and then each separately. I also tried deallocating in (view)didUnload. I either received an error that the object sent was deallocated or it was just (null).
        Maybe there is something else going on if it is working for you. I will try some more debugging to see just where the problem is.

  14. Pingback: Cannot find protocol declaration NSObject | Technical support, Computer, programming issue, issue tracking, quality assurance

  15. Brian says:

    Great tutorial. Great style of writing.. to the point, no fluff and interesting! Thanks

  16. Vijesh says:

    Thanks for the tutorial. Appreciate explaining in detail.

  17. Esteban says:

    After a lot of surfing for an elegant way of passing data between classes, finding this tutorial was GOLD! Very nicely laid out and explained. Thanks heaps !

  18. Bob says:

    Thank you! You are my hero! I searched all over the web and your tutorial helped me out immensely.

  19. Help Seeker says:

    Hi there, I have a situation. In one of my classes i needed to make three web service calls in a row. the service implementation is done in separate class which behaves in correct manner for a call . Hope you might note that my saying of correct manner for the call not for all the three class. the second one fires up before the first one get finished it connection, same for the third call to. After the lookup at many tutorials i made up my mind to set protocol. But for ending up with this i need few more guidance, I hope you are clear with my requirement.
    Thanks in Advance

  20. klaas visser says:

    Thanks so much for explaining this so clearly. Searched all over the place but nobody seems to know how it really should be done.. Thumbs up!

  21. Richard Schaefer says:

    Great tutorial!!!

    One question: Can I pass an object/class that I created in my application instead of a string? If not then can I pass multiple values in the protocol? My second view needs to return either a Building object or the four properties of the selected Building object.

    Thanks!!!!

  22. Joe says:

    Does this work without the use of UINavController or does the data passing work simply because of the navbar archetecture? Also when setting the delegate in the textfields to lower the keyboard that too is not connected in anyway to passing the data right? It is simply used because the example involves the keyboard i would imagine. Do i understand these parts correctly?

  23. calebhc says:

    Awesome tutorial! Thanks for the help. :)

  24. Jamie Smith says:

    Thanks for the great tutorial. However, I have been trying to implement this code into my program but having trouble. I have it all working except the last part with the
    – (void) goToViewTwo method. Would anyone be able to help me on this?

  25. Tiquelou says:

    Thanks so much for this lovely tutorial! :)

  26. Felipe says:

    If instead a viewController i have a popup View Which receive a Nsstring, i followed the steps listed above, but in the class of type view, the method ViewWillDisappear, doesn’t exist, how can i solve this?

    Tanks!

  27. Alan says:

    Hi Kent,

    Thank you so much for this tutorial. I have the string successfully sending to the second controller and I was delighted! However I am days now trying to send a core data object to the second controller. Basically I have 2 table view controllers, first and second. The first one holds the parent entity and when I click on one of them it brings me into the second controller where upon I fetch all the children for this parent. I need to send the parent object over to the second controller but the contents are always null, both in the first and second controller. I first alloc the
    “parentObj” in my first controller by alloclating it with “initwithentity” and I then set it like so (secondviewcontroller.parentobj = etc….). But if I do an NSLog in the first controller for parentObj, it is null. I have all my core data set up correctly throughout the application so I dont think there is anything wrong there. Do you know where I am going wrong? Much appreciated if you could shed some light! Alan

  28. qasim ali khan says:

    Great work man!

  29. Pingback: UIPopoverController subtleties… | Sonic's Adventures in iOS

  30. Matej says:

    Thank you man … very nice.

  31. Guy says:

    Hi,

    thanks for your clear explanation, it clarified a few areas for me.

    I am actually trying to pass data between 2 views that aren’t linked sequentially.

    I enter the app, a TabBarController is then displayed. It has 2 navigationcontrollers linked to it and each of these are hooked up to a tableviewcontroller.

    i.e.

    TabBarController
    – NavigationController called View1
    – TableViewController1 – displays data from a CoreData Object – based upon the filter supplied from TableViewController2

    – NavigationController called View2
    – TableViewcontroller2 – defines the filters to be applied to the CoreData Object in TableViewController1

    To achieve this I need to pass data (the filters selected by the user) from TableViewController2 to TableViewController1 – so that the appropriate data can be displayed from the CoreData Object in the tableviewcontroller1.

    Please could you tell me if you have a tutorial on this somewhere.

    Many thanks,
    Guy

  32. Steve says:

    Hi

    Thanks for this simple solution, spent two days trying numerous offerings

    was able to implement your clear explanation within 20 mins

    Thanks again

    Steve

  33. Pingback: xcode trouble passing 3 nsstring values between views | BlogoSfera

  34. Sundeep says:

    Best tutorial I’ve seen on delegates. Thanks!

  35. Pingback: xcode trouble passing 3 nsstring values between views

  36. Joris says:

    Hi!

    much appreciation for this simple and clear explanation. everything makes sense to me when I read it, but it does not work for me..

    I think it doesn’t work because i’m not passing the text from a textfield, but I’m trying to pass a string. when I apply your method in my app, and I test is by NSLogging the result, it says null, so nothing seems to be passed. do you have any idea what I’m doing wrong?

    Thanks again,

    Joris

  37. Jesse Oresnik says:

    Nice tutorial. One minor suggestion – when you show the code for steps #16 and on, please highlight the code that you’re adding. It will make the tutorial a lot easier to follow (especially for beginners).

  38. joey says:

    thank you!!!

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>