Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8203675
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:38:25+00:00 2026-06-07T07:38:25+00:00

Background I’m learning Objective-C and Cocoa, and I thought creating simple programs to answer

  • 0

Background

I’m learning Objective-C and Cocoa, and I thought creating simple programs to answer my needs would be a nice thing. I already have a solid .NET C# background, some Python knowledge, and a little of C.

One of my “simple first app” I tried to do is a simple QuickLook plug-in for Arduino‘s sketch files. I thought it would be a simple task to accomplish since these files are plain text C-like scripts, the only “different” thing is they have a .pde extension.

I uploaded the project on GitHub at ArduinoQuickLook as a reference (the first commit contains a vanilla Xcode 4.1 QuickLook plugin-project).

What I found

Looking around the net I found these resources:

  • QLStephen
  • QLColorCode
  • Introduction to Quick Look Programming Guide

What are my problems

  1. Both of them use GeneratePreviewForURL.m and GenerateThumbnailForURL.m files, but when I created the project in Xcode 4.1 it created GeneratePreviewForURL.c and GenerateThumbnailForURL.c (note .c instead of .m).

  2. Both QLStephen and QLColorCode use #import <Foundation/Foundation.h> in their GeneratePreviewForURL.m and GenerateThumbnailForURL.m files, but if I try to #import it it yields to many errors. (Maybe because my files are .c instead of .m?)

  3. It’s not clear to me how I declare which files my plug-in will handle, I understood I need to change ArduinoQuickLook/ArduinoQuickLook-Info.plist (row 14) but what I have to write there? Something like cc.arduino.pde?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T07:38:26+00:00Added an answer on June 7, 2026 at 7:38 am

    This tutorial on creating a Quicklook plugin explains things nicely, but to summarise:

    Point 1 and 2 are related – for some strange reason the Quicklook plugin template only contains .c files – as such, importing the Obj-C Foundation.h header causes errors.

    You should just be able to rename the files from .c to .m and it will work as expected.

    It’s not clear to me how I declare which files my plug-in will handle

    You need to do two things – one is say which UTI (Uniform Type Identifier) your plugin handles (e.g cc.arduino.pde), by changing the line you mention:

    <array>
        <dict>
            <key>CFBundleTypeRole</key>
            <string>QLGenerator</string>
            <key>LSItemContentTypes</key>
            <array>
                <string>cc.arduino.pde</string>
            </array>
        </dict>
    </array>
    

    …but you also have to describe that UTI (mostly so it can map the file-extension to that UTI)

    There are two slightly different ways to declare UTI’s, [as “Declaring New Uniform Type Identifiers”] describes:

    Your UTI declarations must be either imported or exported:

    • An exported UTI declaration means that the type is available for use by all other parties. For example, an application that uses a proprietary document format should declare it as an exported UTI.
    • An imported UTI declaration is used to declare a type that the bundle does not own, but would like to see available on the system. For example, say a video-editing program creates files using a proprietary format whose UTI is declared in its application bundle. If you are writing an application or plugin that can read such files, you must make sure that the system knows about the proprietary UTI, even if the actual video-editing application is not available. To do so, your application should redeclare the UTI in its own bundle but mark it as an imported declaration.

    For a Quicklook plugin, you probably want an “imported” UTI declaration, in which you would add something like this to your Info.plist:

    <key>UTImportedTypeDeclarations</key>
    <array>
        <dict>
            <key>UTTypeIdentifier</key>
            <string>cc.arduino.pde</string>
            <key>UTTypeReferenceURL</key>
            <string>http://www.example.com</string>
            <key>UTTypeDescription</key>
            <string>Arduino PDE file</string>
            <key>UTTypeConformsTo</key>
            <array>
                <string>public.c-source</string>
                <string>public.text</string>
            </array>
            <key>UTTypeTagSpecification</key>
            <dict>
                <key>public.filename-extension</key>
                <array>
                    <string>pde</string>
                </array>
            </dict>
        </dict>
    </array>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Background: I would like to dismiss a modalView that I have presented earlier and
Background Developing a simple web application (Eclipse + JBoss + Apache Tomcat) to generate
Background I am writing and using a very simple CGI-based (Perl) content management tool
Background & Objective: I have a UISplitViewController based iPad app - till now it
Background I'm trying to implement a simple web server part as a web interface
Background: What I need to accomplish is to remove any records in a collection
Background: We're building an application that allows our customers to supply data in a
Background: I'm using the (fantastic) Vim plugin python-mode , which includes the pep8 linter.
Background - I am using paramiko to put files on a bunch of remote
Background : I'm trying to convert some JavaScript code which uses the the Crossfilter

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.