quicklookBackgroundColor() ??

2015-07-31 Thread Eden Smallwood

On X.8, at a minimum, when a user views a QuickLook of a standard item, 
the text is black and the background is white.  ( Also, the QL Preview which is 
part of the Finder's Info window has the same traits, of course ).

But if the user chooses to FullScreen the QL window, then the 
background is black, and the text is white.  ( Also, on X.6, the standard 
background of a regular QL window was translucent black, and the text white.  
And it looked pretty cool, imho, I don't know why they dropped that… )

Admittedly, going fullscreen on a QL preview is a bit silly, but if 
Apple is going to do it then I need to do it too.


Q:  How does the QL plugin determine what color the background is ?
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Regarding these Olivia messages. Can we do something about the list security?

2015-07-31 Thread Michael David Crawford
Blue-Eyed Cass promised me what every man desired but few can obtain
mere hours after we friended each other on Facebook.

I live with my mother in Ghana.

I expect her really does, but the real tragedy of Blue-Eyed Cass is
not that she depletes lonely men of all they possess, but that she
does not really return our affection.

-- Mike

On 7/31/15, Graham Cox graham@bigpond.com wrote:

 On 30 Jul 2015, at 11:45 pm, Shane Stanley sstan...@myriad-com.com.au
 wrote:

 Olivia seems to get around.


 Maybe we should give her the benefit of the doubt. I sent her my credit card
 details and now she’s promised she’s going to come and visit once she’s
 sorted out the flights. You’ll all be sorry when I’m going out with my new
 sexy girlfriend! Ha!

 —Graham



 ___

 Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

 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:
 https://lists.apple.com/mailman/options/cocoa-dev/mdcrawford%40gmail.com

 This email sent to mdcrawf...@gmail.com


-- 
Michael David Crawford, Consulting Software Engineer
mdcrawf...@gmail.com
http://www.warplife.com/mdc/

Every Deity Hath the Insight to Foretell the Future
Yet G-d Almighty Himself Possesseth Not the Power to Undo the Past.

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

FSFileManager strange behaviour on OS X

2015-07-31 Thread Tim Fletcher
Hi All,

I have a Chose File dialog for the user to select a file (directory in this 
case). I retrieve the absolute path of the chosen directory. 
However, am not able to list the contents of the directory.

In a Swift playground this is a little demo I made

let fs = NSFileManager.defaultManager()

fs.isReadableFileAtPath(~/Documents)  // false
fs.isReadableFileAtPath(Documents)// true
fs.isReadableFileAtPath(/Users/tim/Documents) // false


If i print out fs.currentDirectoryPath dI do indeed get a weird path (assuming 
that this is the root of where the application has been built to and run from)

How may I access files/directories such as “/Users/tim/Documents”?

Many thanks
Tim




___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Init String with bytes

2015-07-31 Thread Jan E. Schotsman

Hello,

This has me puzzled: I am trying to initialize a Swift string with an  
NSData but the analyzer denies my approach.


let dataValue:NSData = …

let name = String( bytes:dataValue.bytes, length:dataValue.length,  
encoding:NSUTF8StringEncoding )


Analyzer complains: Cannot find an initializer for type 'String' that  
accepts an argument list of type '(bytes: UnsafePointerVoid, length:  
Int, encoding: UInt)'


But the NSString Reference says:

convenience init?(bytes bytes: UnsafePointerVoid, length length:  
Int,  encoding encoding: UInt )


Anyone?

Jan E.
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: FSFileManager strange behaviour on OS X

2015-07-31 Thread Tim Fletcher
Hi Jens,

Problem solved. 
 
 Is your application sandboxed?
 But even so, I thought that NSOpen/SavePanel granted a sandboxed app 
 permission to access the directory or file chosen by the user. (I’ve never 
 actually used that functionality in a sandboxed app, though.)
 

No, the app isn’t sandboxed. 

 
 Looks like the process running Swift playground code is sandboxed. So it 
 can’t access files outside its sandbox, which is that ‘weird path’ you saw.
 
However, you are correct that the playground is.

The issue was just me not paying close attention. On the NSURL returned, I was 
requesting .absoluteString, This obviously still contains the schema part of 
the path (“file://“). After using the correct attribute .path things have been 
working.

Your questions where very useful in solving this. 
Many thanks
Tim
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Init String with bytes

2015-07-31 Thread Charles Srstka
 On Jul 31, 2015, at 2:51 PM, Jens Alfke j...@mooseyard.com wrote:
 
 Your code should work if you change String(…) to NSString(…).

However, there’s no need to bother getting the bytes and length from the 
NSData, since there’s an initializer that takes just an NSData:

if let name = NSString(data: dataValue, encoding: NSUTF8StringEncoding) as? 
String {
// do something with name
}

Charles

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Init String with bytes

2015-07-31 Thread Jens Alfke

 On Jul 31, 2015, at 12:32 PM, Jan E. Schotsman jesc...@xs4all.nl wrote:
 
 But the NSString Reference says:
 convenience init?(bytes bytes: UnsafePointerVoid, length length: Int,  
 encoding encoding: UInt )

NSString ≠ String. It’s not toll-free bridging like you’re used to with CF. 
String and NSString are actually different classes, though there are automatic 
conversions between them, and some (but not all) NSString methods are shadowed 
in String.

Your code should work if you change String(…) to NSString(…).

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reusable Detail View Controller for UISplitViewController?

2015-07-31 Thread Steve Mykytyn
This seems too easy - seems to work great.  Can anyone point out a defect
with this approach?

I want to reuse the same view controller instance as the detail view
controller for a UISplitViewController - my experience is that constantly
instantiating view controllers can be sluggish.

Simply making the persistent view controller a child controller of the
newly instantiated detail view controller seems to work just fine, as in

// self.persistentDetailViewController is a view controller instantiated in
viewDidLoad.


- (void) addChildToDetailController {
[self.detailViewController
addChildViewController:self.persistentDetailViewController];

self.persistentDetailViewController.view.frame =
self.detailViewController.view.frame;
[self.detailViewController.view
addSubview:self.persistentDetailViewController.view];
[self.persistentDetailViewController
didMoveToParentViewController:self.detailViewController];
}


#pragma mark - Segues

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([[segue identifier] isEqualToString:@showDetail]) {
   NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
   NSDate *object = self.objects[indexPath.row];
self.detailViewController = (DetailViewController *)[[segue
destinationViewController] topViewController];
   [self.detailViewController setDetailItem:object];
   self.detailViewController.navigationItem.leftBarButtonItem =
self.splitViewController.displayModeButtonItem;
   self.detailViewController.navigationItem.leftItemsSupplementBackButton =
YES;
[self addChildToDetailController];
}
}
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: FSFileManager strange behaviour on OS X

2015-07-31 Thread Jens Alfke

 On Jul 31, 2015, at 11:46 AM, Tim Fletcher timothy.m.fletc...@gmail.com 
 wrote:
 
 I have a Chose File dialog for the user to select a file (directory in this 
 case). I retrieve the absolute path of the chosen directory. 
 However, am not able to list the contents of the directory.

Is your application sandboxed?
But even so, I thought that NSOpen/SavePanel granted a sandboxed app permission 
to access the directory or file chosen by the user. (I’ve never actually used 
that functionality in a sandboxed app, though.)

 fs.isReadableFileAtPath(/Users/tim/Documents) // false
 If i print out fs.currentDirectoryPath dI do indeed get a weird path 
 (assuming that this is the root of where the application has been built to 
 and run from)

Looks like the process running Swift playground code is sandboxed. So it can’t 
access files outside its sandbox, which is that ‘weird path’ you saw.

—Jens
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Swift NSOutlineView Illegal NSOutlineView data source

2015-07-31 Thread Raglan T. Tiger
sounds like the delegate isn't set so it don't know where to look for those or 
the delegate is set to the wrong object

-rags



 On Jul 31, 2015, at 4:17 PM, Rick Mann rm...@latencyzero.com wrote:
 
 But I still get this at run time:
 
 *** Illegal NSOutlineView data source (NSViewController: 0x608c6740).  
 Must implement outlineView:numberOfChildrenOfItem:, 
 outlineView:isItemExpandable:, outlineView:child:ofItem: and 
 outlineView:objectValueForTableColumn:byItem:

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Swift NSOutlineView Illegal NSOutlineView data source

2015-07-31 Thread Rick Mann
Yeah, it really does sound like that, doesn't it? You know what? I forgot to 
set the class name in the view controller in the storyboard. I'm an idiot.

Thanks!

 On Jul 31, 2015, at 15:24 , Raglan T. Tiger r...@crusaderrabbit.net wrote:
 
 sounds like the delegate isn't set so it don't know where to look for those 
 or the delegate is set to the wrong object
 
 -rags
 
 
 
 On Jul 31, 2015, at 4:17 PM, Rick Mann rm...@latencyzero.com wrote:
 
 But I still get this at run time:
 
 *** Illegal NSOutlineView data source (NSViewController: 0x608c6740).  
 Must implement outlineView:numberOfChildrenOfItem:, 
 outlineView:isItemExpandable:, outlineView:child:ofItem: and 
 outlineView:objectValueForTableColumn:byItem:
 


-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Swift NSOutlineView Illegal NSOutlineView data source

2015-07-31 Thread Quincey Morris

On Jul 31, 2015, at 15:17 , Rick Mann rm...@latencyzero.com wrote:
 
 I'm not sure why those methods are optional if they must be implemented, but 
 whatever.

Incidentally, they’re optional because a bindings-based table doesn’t use them, 
but still might have a data source because the methods that support 
drag-and-drop are data source methods, not delegate methods.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Regarding these Olivia messages. Can we do something about the list security?

2015-07-31 Thread Graham Cox

 On 30 Jul 2015, at 11:45 pm, Shane Stanley sstan...@myriad-com.com.au wrote:
 
 Olivia seems to get around.


Maybe we should give her the benefit of the doubt. I sent her my credit card 
details and now she’s promised she’s going to come and visit once she’s sorted 
out the flights. You’ll all be sorry when I’m going out with my new sexy 
girlfriend! Ha!

—Graham



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Swift NSOutlineView Illegal NSOutlineView data source

2015-07-31 Thread Rick Mann
Googling for this suggests the problem is old, and not confined to Xcode 7b4, 
but the proposed solutions (deleting and re-typing the methods) doesn't work 
for me. Has anyone found a better solution?

I have a simple NSOutlineView in source list mode, using an 
NSOutlineViewDataSource, in Swift 2. I've implemented …numberOfChildrenOfItem:, 
…child:ofItem:, …isItemExpandable:, and …viewForTableColumn:item:. I've even 
tried adding …objectValueForTableColumn:byItem:, which docs say is not 
necessary for view-based views.

But I still get this at run time:

*** Illegal NSOutlineView data source (NSViewController: 0x608c6740).  
Must implement outlineView:numberOfChildrenOfItem:, 
outlineView:isItemExpandable:, outlineView:child:ofItem: and 
outlineView:objectValueForTableColumn:byItem:

I'm not sure why those methods are optional if they must be implemented, but 
whatever.

Any suggestions on how to get it to behave? Thanks!

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: Swift NSOutlineView Illegal NSOutlineView data source

2015-07-31 Thread Rick Mann

 On Jul 31, 2015, at 15:33 , Quincey Morris 
 quinceymor...@rivergatesoftware.com wrote:
 
 Incidentally, they’re optional because a bindings-based table doesn’t use 
 them, but still might have a data source because the methods that support 
 drag-and-drop are data source methods, not delegate methods.

Yeah, I realized that. I usually use bindings for these things. I think the 
real solution is more Protocols, but it's fine.

-- 
Rick Mann
rm...@latencyzero.com



___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Re: NSManagedObject, NSString property retain vs copy

2015-07-31 Thread Jean-Daniel Dupas

 Le 30 juil. 2015 à 18:26, Fritz Anderson fri...@manoverboard.org a écrit :
 
 On 30 Jul 2015, at 11:03 AM, Trygve Inda cocoa...@xericdesign.com wrote:
 
 It seems Apple is using retain rather than copy for NSString properties in
 an NSManagedObject subclass.
 
 I was always under the impression that copy should be used for NSString, so
 why the retain??
 
 For an immutable string, -copy is implemented as a -retain. -copy is a guard 
 against the receiver’s relying on the unchanging contents of a string whose 
 contents can be changed. If the contents cannot in fact be changed, there’s 
 no point in allocating new memory and copying the bytes into it.
 
 It’s an implementation detail; what makes you believe it makes a difference?

If it is in the property declaration, it is not an implementation detail, it is 
part of the public API.

And as the receiver can’t guarantee that a passed NSString is not a 
NSMutableString under the hood, it should always declare property as copy, so 
the fact that some sample code (I guess this is what the op is talking about) 
use retain is dubious.


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com