Basic link of framework

The Growl forums have moved to Google Groups, this forum is read only.
luciocosmo
Harmless
Posts: 5
Joined: Wed Oct 07, 2009 7:19 am

Basic link of framework

Postby luciocosmo » Wed Oct 07, 2009 7:26 am

Hi.

I feel quite stupid for asking, but this is it.

I downloaded and extracted the first samplecode found "RemindMeApp".
The xcode project refers to a framework path that's not the latest.

Downloaded the Growl SDK 1.0.
Copied with sudo the Growl.framework to /System/Library/Frameworks/

The Growl framework appears now not-red in the xcode list.

Build.

it says that #import <Growl/Growl.h> cannot be found:

Code: Select all

RemindMeApp.h:10:24: error: Growl/Growl.h: No such file or directory


The same happened when at first we tried with our app.

What's so wrong with the framework "installation" ?


Thanks.

p.s. is there an official "cocoa usage sample" of growl, complete with project and source ?

User avatar
boredzo
Cocoaforge Admin
Posts: 796
Joined: Mon Dec 06, 2004 7:49 am
Contact:

Re: Basic link of framework

Postby boredzo » Wed Oct 07, 2009 11:03 am

luciocosmo wrote:Downloaded the Growl SDK 1.0.


Where from? That's really old.

Copied with sudo the Growl.framework to /System/Library/Frameworks/


That is not the correct place to put it.

You need to copy the framework into your project directory, and have Xcode copy it into your application. Our Cocoa tutorial gives details.

luciocosmo
Harmless
Posts: 5
Joined: Wed Oct 07, 2009 7:19 am

Re: Basic link of framework

Postby luciocosmo » Wed Oct 07, 2009 12:18 pm

boredzo wrote:
luciocosmo wrote:Downloaded the Growl SDK 1.0.


Where from? That's really old.

Copied with sudo the Growl.framework to /System/Library/Frameworks/


That is not the correct place to put it.

You need to copy the framework into your project directory, and have Xcode copy it into your application. Our Cocoa tutorial gives details.


You're right. Copied to the project directory it was build at first time ! Why ? I wanted to share the folder among projects, anyway if this solves the problem I can go on.

Still the project doesn't work at runtime. The code is the following:

Code: Select all


//
//  RemindMeApp.m
//  RemindMe
//
//  Created by Siavash Ghamaty on 9/25/08.
//  Copyright 2008 __MyCompanyName__. All rights reserved.
//

#import "RemindMeApp.h"

NSString *const kStartButtonTitle   = @"START";
NSString *const kStopButtonTitle   = @"STOP";

@implementation RemindMeApp

- (void)awakeFromNib
{
   [GrowlApplicationBridge setGrowlDelegate:self];
}

- (void) updateTimer
{
   if( [secondsInput intValue] > 0 ) {
      [secondsInput setStringValue: [NSString stringWithFormat: @"%d", [secondsInput intValue]-1 ] ];
      if( [secondsInput intValue] == 0 ) {
         
         // Creating growl notification
         [GrowlApplicationBridge
          notifyWithTitle:@"A reminder from RemindMe App"
          description:@"Your timer has fired"
          notificationName:@"StandardReminder"
          iconData: nil
          priority:1
          isSticky:NO
          clickContext:@"test"];

      }
   }
   
}

- (void) invalidateTimer
{
   if( [timer isValid] ) {
      [timer invalidate];
   }
   
}
      
- (IBAction) startOrStopGrowlTimer: (id) sender
{   
   // Toggle the button title
   NSString *buttonTitle = ( [startStopButton title] == kStopButtonTitle ) ? kStartButtonTitle : kStopButtonTitle;
   
   // Using button title to invalidate timer or schedule one
   if( buttonTitle == kStopButtonTitle ) {
      timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTimer) userInfo:nil repeats:YES];      
   } else {
      [self invalidateTimer];
   }
   
   [startStopButton setTitle:buttonTitle];
   
}



#pragma mark ---   Growl Delegate Methods   ---

- (void) growlNotificationWasClicked:(id)clickContext
{
   [self activateIgnoringOtherApps:YES];
}

- (NSDictionary *) registrationDictionaryForGrowl
{
   NSArray *notifications = [NSArray arrayWithObject: @"StandardReminder"];
   NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys:
         notifications, GROWL_NOTIFICATIONS_ALL,
         notifications, GROWL_NOTIFICATIONS_DEFAULT, nil];
   
   return dict;
}

@end



I mean, it's quite simple, and implements all what the doc says.
In my code i checked "growl installed" and it's YES, "growl running" and it's NO


... and i feel very very stupid now.

I updated growl and I did not restart the machine... or press start on it.
All happened at the same time and I got confused.

I'll notify our app as soon as it is ready.

Thanks a lot.


Return to “Growl”

Who is online

Users browsing this forum: No registered users