• 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: QLPreviewPanel (how to supply default application url?)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: QLPreviewPanel (how to supply default application url?)


  • Subject: Re: QLPreviewPanel (how to supply default application url?)
  • From: sqwarqDev <email@hidden>
  • Date: Mon, 30 May 2016 18:08:06 +0700

> On 30 May 2016, at 17:42, email@hidden wrote:
>
> Did you include the code?
>

There’s only two methods for the datasource. Mine look like this:


#pragma mark - QLPreviewPanelDataSource

- (NSInteger)numberOfPreviewItemsInPreviewPanel:(QLPreviewPanel *)panel
{
    return [_arrayController selectedObjects].count; // returns ‘1'
}

- (id <QLPreviewItem>)previewPanel:(QLPreviewPanel *)panel previewItemAtIndex:(NSInteger)index
{
    NSArray *pathArray = [[_arrayController selectedObjects] valueForKey:@"Path"];
    NSString *pathString = pathArray[0];
    NSURL *previewPath = [[NSURL URLWithString:pathString] absoluteURL];
    return previewPath; //returns ‘Users/phil/Documents/sample.txt'
}



Best


Phil




> Sent from my iPhone
>
>> On May 30, 2016, at 7:20 PM, sqwarqDev <email@hidden <mailto:email@hidden>> wrote:
>>
>> Hoping someone can get me over the final hurdle…
>>
>> I have an NSTableView and I want the user to be able to hit the space bar to invoke a QuickLook preview of the selected item. These items are not custom objects, just regular text files.
>>
>> I’m following the sample code provided by Apple in QuickLookDownloader as my guide (see: https://developer.apple.com/library/mac/samplecode/QuickLookDownloader/Introduction/Intro.html)
>>
>> I’ve got everything up and running in the sense of, yes, I can hit the space bar, a preview panel pops up and shows my item’s title and an icon (the wrong icon, but that’s not my worry, yet). What it doesn’t show is a preview of the text file.
>>
>> In the log I see this message:
>>
>> [QL] LSCopyDefaultApplicationURLForURL  for /Users/phil/Documents/sample.txt returned error Error Domain=NSOSStatusErrorDomain Code=-50 "paramErr: error in user parameter list”
>>
>> My question is where in my code do I provide this parameter? I don’t see it given in any of the methods in the QuickLookDownloader source.
>>
>>
>> TIA
>>
>>
>> Best
>>
>>
>> Phil
>>
>> _______________________________________________
>>
>> Cocoa-dev mailing list (email@hidden)
>>
>> Please 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 <mailto:email@hidden>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: [SOLVED} QLPreviewPanel (how to supply default application url?)
      • From: sqwarqDev <email@hidden>
References: 
 >Simplest way to generate audio tones? (From: Graham Cox <email@hidden>)
 >Re: Simplest way to generate audio tones? (From: Jens Alfke <email@hidden>)
 >QLPreviewPanel (how to supply default application url?) (From: sqwarqDev <email@hidden>)
 >Re: QLPreviewPanel (how to supply default application url?) (From: email@hidden)

  • Prev by Date: Re: QLPreviewPanel (how to supply default application url?)
  • Next by Date: Re: [SOLVED} QLPreviewPanel (how to supply default application url?)
  • Previous by thread: Re: QLPreviewPanel (how to supply default application url?)
  • Next by thread: Re: [SOLVED} QLPreviewPanel (how to supply default application url?)
  • Index(es):
    • Date
    • Thread