• 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
A Better way to get a path from NSImage?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

A Better way to get a path from NSImage?


  • Subject: A Better way to get a path from NSImage?
  • From: Ryan Harter <email@hidden>
  • Date: Sun, 18 Feb 2007 04:44:16 +0100

I have two different methods in a class that need to share a variable. I think I need to use a global but am not sure, I'm still relatively new to this. I'm assuming there's a better way to do this, all I really need is to get the image path I place in an image view. I've eliminated the drag and drop, since I don't know how to get the image path, with an NSButton and NSOpenPanel. The code is as follows:

ConvertController.h:

#import <Cocoa/Cocoa.h>

extern NSString *artworkPath;

@interface ConvertController : NSObject
{...


ConvertController.m:

- (IBAction)addArtwork:(id)sender
{...

	NSString *artworkPath = [[oPanel filenames] objectAtIndex:0];
    image = [[NSImage alloc] initWithContentsOfFile:artworkPath];

...}

- (IBAction)convert:(id)sender
{...
	[valueArray addObject:artworkPath];
...}

So far all I get is a

ZeroLink: unknown symbol '_artworkPath'
Program received signal:  "SIGABRT".

and the program exits on launch. This started happening when I added the global *artworkPath, but I can't figure out how both methods can share this variable while retaining it's value.

Any suggestions??
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: A Better way to get a path from NSImage?
      • From: Andrew Farmer <email@hidden>
  • Prev by Date: NSOpenPanel instantly closing
  • Next by Date: Re: A Better way to get a path from NSImage?
  • Previous by thread: Re: NSOpenPanel instantly closing
  • Next by thread: Re: A Better way to get a path from NSImage?
  • Index(es):
    • Date
    • Thread