Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7191041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T19:38:43+00:00 2026-05-28T19:38:43+00:00

With the help of the Developer Library, I am trying to work with the

  • 0

With the help of the Developer Library, I am trying to work with the EventKit and EventKitUI Frameworks. I’ve hit a very early roadblock. I have copied and pasted code from the library found here. I have added a view controller called ‘AddEventViewController’ a button to the Navigation Bar in my ViewController and I am using this code to invoke it.

- (IBAction)add:(id)sender {
AddEventViewController *addController = [[AddEventViewController alloc]
                                          init];
addController.delegate = self;
UINavigationController *navigationController = [[UINavigationController alloc]
                                                    initWithRootViewController:addController];
[self presentViewController:navigationController animated:YES completion: nil];

}

The error shows on line: addController.delegate = self;

This code is copied straight from the Library. I am using Xcode 4.2 and a Storyboard if that might help.

UPDATE:
This is AddEventViewController.h:

#import <UIKit/UIKit.h>

@interface AddEventViewController : UIViewController

@end

You’re going to tell me I created this ViewController incorrectly? Please explain why just not “how” if you’d be so nice?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T19:38:44+00:00Added an answer on May 28, 2026 at 7:38 pm

    I see how Apple’s example here has likely confused you here. First, download the full source for iPhoneCoreDataRecipes (or at least reference it while trying to understand this code).

    To really understand what’s going on here, you need to read on down to the section called “Dismissing a Presented View Controller” and then follow the link to “Use a Delegation to Communicate With Other Controllers.” (“a Delegation?” Very strange….)

    So here’s what’s going on. The presented view has a “delegate” which is the object it’s supposed to tell “interesting” things to. In this case, “interesting” things are “hey, I added a recipe!” To achieve this, the delegate implements a protocol, which just means it promises to implement some methods. In this case, the required method is recipeAddViewController:didAddRecipe:.

    AddViewController has a delegate property like this:

    @property(nonatomic, assign) id <RecipeAddDelegate> delegate;
    

    That just means that the delegate must conform to the named protocol. The delegate itself indicates that it does so in its interface:

    @interface RecipeListTableViewController : UITableViewController <RecipeAddDelegate, NSFetchedResultsControllerDelegate> {
    

    Note that this is marked assign for reasons @Yuras explains. But if you’re writing new code targeted at iOS 5, you should use weak instead of assign. weak properties are automatically set to nil if their referenced object is deallocated. It’s just safer that way. No dangling pointers.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need some help! Please. I am trying to develop a very very simple
I would really appreciate your help in this. I have been trying to get
I'm trying to help another developer who is using Netbeans. When he runs or
http://developer.apple.com/library/ios/#samplecode/Touches/Introduction/Intro.html I'm new to IOS development, and have been playing around with the IOS
I'm a developer and I suck at SQL:) Please help me out here. I'd
I’ve built a webform in Visual Web Developer Express 2008 to help me with
Is there guide out there that will help me, A .Net developer whose been
Help! I have an Axis web service that is being consumed by a C#
Versions Excel 2003 Windows XP SimaPro 7.3.0 Developer Version Using a Work computer but
I need help with CABasicAnimation. I am trying to move a NSView left by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.