Re: Help Linking To A Framework
Re: Help Linking To A Framework
- Subject: Re: Help Linking To A Framework
- From: Matt Neuburg <email@hidden>
- Date: Wed, 06 Sep 2006 13:02:07 -0700
- Thread-topic: Help Linking To A Framework
On Wed, 6 Sep 2006 16:48:30 +0100, "digital.pardoe"
<email@hidden> said:
>Hi,
>
>I am writing a small menu bar based application. Everything is going
>well so far but I have a small problem. When the menu bar item is
>clicked on and an action selected any windows that may appear open
>behind other application windows. I have got around this by
>programmatically opening all windows and using;
>
>[NSApp activateIgnoringOtherApps:YES];
>
>Beforehand. For automatic updates I use the Sparkle engine and the
>same disappearing act occurs when 'Check For Updates...' is selected
>from the menu. The main issue I am struggling with is calling the;
>
>- (IBAction)checkForUpdates:sender;
>
> From 'SUUpdater.h' (inside 'Sparkle.framework' linked in application
>bundle) programmatically from the particular menu item.
>
>I have successfully linked the header file using;
>
>#include <Sparkle/SUUpdater.h>
>
>But;
>
>- (IBAction)menuItem:(id)sender
>{
> [NSApp activateIgnoringOtherApps:YES];
> [SUUpdater checkForUpdates];
>}
>
>Does not operate correctly, during compilation the compiler states
>that 'SUUpdater' may not respond to the action, and if I try to click
>the menu item the application crashes.
>
>I wish to get more involved in Mac development and not being able to
>do this is a hurdle.
>
>Can anyone help me to do this correctly?
I'm looking at SUUpdater.h and sure enough, it does not respond to
"checkForUpdates". (There is no method by that name.) So that's one mistake.
Furthermore, to call it in this way:
[SUUpdater checkForUpdates];
...it would need to be a class method. But SUUpdater.h has no class methods.
So that's two mistakes.
So this has nothing to do with linking or frameworks; the cause of the
problem would seem to be that you don't know ObjectiveC (I deduce that
because if you did know ObjectiveC you would know, by looking at the header
file, the name of the method you want to call and how to call it). A very
fine way to learn ObjectiveC is this online book:
<http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/index.
html>
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden