• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Stumped: How to call a function defined in a Framework?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Stumped: How to call a function defined in a Framework?


  • Subject: Stumped: How to call a function defined in a Framework?
  • From: JK <email@hidden>
  • Date: Thu, 4 Dec 2008 23:38:32 -0800

Hello fellow X-Code users,

I'm having a problem calling a function in a Framework; the compiler complains about an undeclared type. I must be doing something wrong, but I have no idea what...

Here are the steps to repeat the problem:

1. Start XCode 3.1.2 (I am running Leopard 10.5.5)
2. Create a new Cocoa Document-Based application project.
3. In the file "MyDocument.m", add the line "SecuritySessionId mySession;" to the "init" method, so that it looks like:


- (id)init
{
    SecuritySessionId mySession;
    self = [super init];
    if (self) {

// Add your subclass-specific initialization here.
// If an error occurs here, send a [self release] message and return nil.


    }
    return self;
}

4. Also in "MyDocument.m", add the line "#import <Security/ Security.h>" immediately after the line "#import "MyDocument.h"".

5. Add the "Security.framework" to the "Other Frameworks" folder in the "Groups & Files" list in the project window.

6. Build the project.

The compiler complains with the following message:

error: 'SecuritySessionId' undeclared (first use in this function)

My question: What else is necessary to make this compile correctly?

I have never been able to build a project that references functions in Frameworks that are not included in the default project.

Thanks in advance for any help you can provide,
JK
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Stumped: How to call a function defined in a Framework?
      • From: Michael Nickerson <email@hidden>
    • Re: Stumped: How to call a function defined in a Framework?
      • From: Chris Espinosa <email@hidden>
  • Prev by Date: Re: Any reason to avoid GCC-4.2 for Leopard and later targeted code?
  • Next by Date: Re: Stumped: How to call a function defined in a Framework?
  • Previous by thread: Re: pass parameters to main() from Xcode?
  • Next by thread: Re: Stumped: How to call a function defined in a Framework?
  • Index(es):
    • Date
    • Thread