• 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
Re: A few (basic?) questions
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: A few (basic?) questions


  • Subject: Re: A few (basic?) questions
  • From: "John C. Randolph" <email@hidden>
  • Date: Tue, 12 Mar 2002 18:08:37 -0800

On Tuesday, March 12, 2002, at 05:59 PM, Chris Backas wrote:

Hello all,

I'm not entirely new to Cocoa, but I haven't delved very far below the surface as of yet, so the following questions shouldn't be too hard for most of you =)

1) Is there a way to obtain the icon that Finder would use for a given file type?

NSString *type = @"tiff" // for example..
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFileType:type];

My program will be creating files it retrieves from over the network, and I know their extension and/or MIME Type prior to retrieving them.
I'd like to represent the files with the Icon they would have if they were on the local system being viewed by the Finder.

2) Is there a supplied view that would be suited to displaying these icons?

NSImageView. It's on the IB palette with the sliders.

I don't need fancy things like arbitrary placement and sorting and whatnot, just kinda want them to be able to sit next to each other. I'm
thinking I'll have to write my first custom view to accomplish this, but I thought I'd check before reinventing the wheel.

3) Are there any examples of using the NSStepper? It seems like such a simple class, but to my surprise the documentation is very sparse. I understand all the properties mentioned, but how do I associate it with a
text field?

Connect it in IB like any other control.

Does it maintain an internal "current" value?

Yes.

What does it send to its target?

Any action method the target has.

-jcr



John C. Randolph <email@hidden> (408) 974-8819
Sr. Cocoa Software Engineer,
Apple Worldwide Developer Relations
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >A few (basic?) questions (From: Chris Backas <email@hidden>)

  • Prev by Date: Re: TextView resize
  • Next by Date: Re: NSImage & Multi-Page TIFF?
  • Previous by thread: A few (basic?) questions
  • Next by thread: Bundle, Wrappers, whatever
  • Index(es):
    • Date
    • Thread