Re: spotlight importer extract file from zip archive

2012-07-25 Thread Gideon King
Cool, got it working thanks.

Gideon

On 26/07/2012, at 12:46 PM, Jens Alfke  wrote:

> 
> On Jul 25, 2012, at 6:57 PM, Gideon King  wrote:
> 
>> How can I get files from my zipped documents without having to run an NSTask?
> 
> Link against libz.dylib?
> 
> —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

Mission Control Hiding Window

2012-07-25 Thread Trygve Inda
I have a window that is the size of the display and has a z-order to put it
between the desktop picture and icons. I call:

setCollectionBehavior:NSWindowCollectionBehaviorCanJoinAllSpaces |
NSWindowCollectionBehaviorTransient | NSWindowCollectionBehaviorIgnoresCycle

This lets it move betwen spaces, but when I go to Mission Control, it hides
it completely.

Using NSWindowCollectionBehaviorManaged doesn't work as the window gets too
small and no longer covers the small desktop representations completely.

Using NSWindowCollectionBehaviorStationary doesn't work as then you can't
see anything in Mission Contral as it is covered up by my window. How can I
make this work?

This window needs to behave like a desktop picture.

Note that I can't use a real desktop picture as there is no way to set them
on a per-space basis.

Trygve



___

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: spotlight importer extract file from zip archive

2012-07-25 Thread Jens Alfke

On Jul 25, 2012, at 6:57 PM, Gideon King  wrote:

> How can I get files from my zipped documents without having to run an NSTask?

Link against libz.dylib?

—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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


spotlight importer extract file from zip archive

2012-07-25 Thread Gideon King
Hi, I am trying to create a spotlight importer, but my files that I want to 
index are zip files, and NSTask will not run from the mdimporter process, since 
it is not blocked by the sandbox. 

How can I get files from my zipped documents without having to run an NSTask?


Thanks

Gideon





___

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: Forcing Core Data to save attribute changed behind its back?

2012-07-25 Thread Kyle Sluder
On Wed, Jul 25, 2012, at 03:54 PM, Sean McBride wrote:
> On Tue, 24 Jul 2012 14:04:12 -0700, Quincey Morris said:
> >Another way of saying all this is that it may not be possible to
> >(reliably) inform Core Data that an attribute has changed without
> >changing the identity of the object that represents the value.
> 
> :(  And changing the identity means using a different object... h...
> I guess since my object is basically a fancy wrapper of NSMutableData, I
> could actually copy my object but not copy the composed NSData too...

I was going to recommend something similar.

The inability to express mutation of a heavyweight model object is a
serious shortcoming in KVC/KVO. Most of the time it works; objects
generate the right change notifications and observers pick them up. But
then some intermediate observer gets smart and says "aha, the old and
new values are pointer-equal! I don't need to forward this change
notification for my derived keys!" and the entire thing breaks down.

I've filed bugs asking for richer self-description of key types
(basically -isOrderedToManyRelationshipKey: and the like). Perhaps we
should also have -isMutableObjectKey:. Either that or the framework
should stop eliding forwarded change notifications just because the
values don't compare pointer-equal.

--Kyle Sluder
___

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: Forcing Core Data to save attribute changed behind its back?

2012-07-25 Thread Sean McBride
On Tue, 24 Jul 2012 14:04:12 -0700, Quincey Morris said:

>I believe the answer is that you're Doing It Wrong™. :)

I know. :)  I only do it in one place, and only because the attribute is a few 
hundred MB, which I don't want to be copying all the time.

(The official Core Data recommendations for dealing with large BLOBs have 
always been very hand-wavy, with little-to-no framework support for their 
recommendations.  In 10.7 we now at least have the 'store in external record' 
option, but still no support for packages in NSPersistentDocument.  Despite me 
storing this large BLOB directly, performance is reasonable enough.  Besides, 
the app has shipped, and, barring migration, I can't change my model anyway.)

>For mutable values, you should either transfer ownership of the value
>to Core Data, or implement custom accessor methods to always perform a
>copy.

Which I always do for things like strings of few hundred bytes...

>Another way of saying all this is that it may not be possible to
>(reliably) inform Core Data that an attribute has changed without
>changing the identity of the object that represents the value.

:(  And changing the identity means using a different object... h... I 
guess since my object is basically a fancy wrapper of NSMutableData, I could 
actually copy my object but not copy the composed NSData too...

Cheers,

-- 

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com 
Mac Software Developer  Montréal, Québec, Canada

___

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: When does NSInputStream's -getBuffer:length: actually work?

2012-07-25 Thread Wim Lewis

On 25 Jul 2012, at 10:08 AM, Jens Alfke wrote:
> NSInputStream has a -getBuffer:length: method that lets you get the available 
> data from the stream without copying. This is great for performance, and I've 
> written my client code to take advantage of it if it's supported, but every 
> time I've tested, it isn't supported (i.e. just returns NO) so my code just 
> falls back to calling -read:maxLength: instead.
> 
> Does anyone know in what circumstances, or in what types of streams, this 
> method actually works?


It sort of works for streams reading from a memory buffer, IIRC. By "sort of", 
I mean it sometimes returns data and sometimes silently discards data. I now 
avoid NSStream/CFStream unless I'm dealing with an API that requires them--- 
they seem to be an unmaintained corner of the codebase.



___

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: When does NSInputStream's -getBuffer:length: actually work?

2012-07-25 Thread Thomas Davie

On 25 Jul 2012, at 18:08, Jens Alfke wrote:

> NSInputStream has a -getBuffer:length: method that lets you get the available 
> data from the stream without copying. This is great for performance, and I've 
> written my client code to take advantage of it if it's supported, but every 
> time I've tested, it isn't supported (i.e. just returns NO) so my code just 
> falls back to calling -read:maxLength: instead.
> 
> Does anyone know in what circumstances, or in what types of streams, this 
> method actually works?

I don't know for sure, but I would bet it's streams reading from files, which 
have become memory mapped.

Bob
___

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: What's the build number of 10.8?

2012-07-25 Thread Andy Lee
12A269

--Andy

On Jul 25, 2012, at 1:18 PM, Jens Alfke wrote:

> I have the developer GM seed of 10.8 from a few weeks ago. What's the build 
> number* of the version that shipped? Is it the same, or do I need to upgrade?
> 
> —Jens
> 
> * In the About This Mac panel, click where it says "Version 10.8" and you'll 
> see the build number.
> ___
> 
> 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/aglee%40mac.com
> 
> This email sent to ag...@mac.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: What's the build number of 10.8?

2012-07-25 Thread Lee Ann Rucker
I just got email that says

The final version of OS X Mountain Lion 10.8 was released today!  Your 12A269 
redemption code actually purchased the final version for you!  The last build 
we seeded, 12A269, is identical to the build that is being sold in the Mac App 
Store today. 

- Original Message -
From: "Jens Alfke" 
To: "Cocoa-Dev List" 
Sent: Wednesday, July 25, 2012 10:18:50 AM
Subject: What's the build number of 10.8?

I have the developer GM seed of 10.8 from a few weeks ago. What's the build 
number* of the version that shipped? Is it the same, or do I need to upgrade?

—Jens

* In the About This Mac panel, click where it says "Version 10.8" and you'll 
see the build number.
___

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/lrucker%40vmware.com

This email sent to lruc...@vmware.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: What's the build number of 10.8?

2012-07-25 Thread Shane Zatezalo
It was the same when I checked, 12A269.
 
 Shane

On Jul 25, 2012, at 1:18 PM, Jens Alfke wrote:

> I have the developer GM seed of 10.8 from a few weeks ago. What's the build 
> number* of the version that shipped? Is it the same, or do I need to upgrade?
> 
> —Jens
> 
> * In the About This Mac panel, click where it says "Version 10.8" and you'll 
> see the build number.
> ___
> 
> 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/lottadot%40gmail.com
> 
> This email sent to lotta...@gmail.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

What's the build number of 10.8?

2012-07-25 Thread Jens Alfke
I have the developer GM seed of 10.8 from a few weeks ago. What's the build 
number* of the version that shipped? Is it the same, or do I need to upgrade?

—Jens

* In the About This Mac panel, click where it says "Version 10.8" and you'll 
see the build number.
___

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

When does NSInputStream's -getBuffer:length: actually work?

2012-07-25 Thread Jens Alfke
NSInputStream has a -getBuffer:length: method that lets you get the available 
data from the stream without copying. This is great for performance, and I've 
written my client code to take advantage of it if it's supported, but every 
time I've tested, it isn't supported (i.e. just returns NO) so my code just 
falls back to calling -read:maxLength: instead.

Does anyone know in what circumstances, or in what types of streams, this 
method actually works?

—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: PDF Rendering on iPad's

2012-07-25 Thread Julius Oklamcak
Dave,

> I have a few questions about rendering PDFs and wondered if
> anyone here could help.

In my open source iOS PDF viewer (https://github.com/vfr/Reader) I employ
two techniques:

1) Show a low resolution image of the page below the CATiledLayer-based
zoom-able page view. These low resolution page images are generated on a
background thread and are also cached as PNGs for future use. This gives the
user something to see while CATiledLayer draws in the details on top of it.

2) Reduce the number (and increase the size) of tiles that CATiledLayer asks
to be drawn. I set the CATiledLayer's tile size to either 512 or 1024 pixels
depending on the device's screen size and scale (CATiledLayer limits the
tile size to 1024 pixels). If the screen scale is greater than 1.0, I set
the levelsOfDetailBias to 1 (any higher and CATiledLayer asks for many,
smaller tiles). I also return a small value for +fadeDuration (as returning
0.0 exposes a bug in CATiledLayer - sometimes a tile won't draw or flickers
in and out until you touch the screen). All of this is done in a
CATiledLayer subclass
(https://github.com/vfr/Reader/blob/master/Sources/ReaderContentTile.m)
which is used to back the PDF page content UIView.

You should also be aware that there is a bug in iOS 5.1.x where CATiledLayer
will ask for the same tile to be drawn 2 or 3 times.

If there is anything else, let me know...jo

___

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


PDF Rendering on iPad's

2012-07-25 Thread Dave

Hi All,

I have a few questions about rendering PDFs and wondered if anyone  
here could help.


I've inherited some code that tiles the PDF, I think this code was  
based on one of the Apple Sample Apps from a while back.


I'm rendering a PDF on an iPad, it's a magazine with lots of text and  
obviously we'd like to run as fast possible, one thing that gives an  
impression of "slowness" is the fact that it renders from bottom up,  
so my first question, is there anyway I can make to render top down?  
The idea is that when a user is presented with a page, that naturally  
start reading from the top down, and since it's just a blur when  
initially rendered it makes the experience less than pleasing.


The next thing is that I remember seeing some an article with some  
sample code somewhere that altered the rendering parameters depending  
on the type of iPad being used, e.g. iPad1, 2 or 3 (it probably  
handling iPhone too, but I don't need to do that), but I can't for  
the life of me find the exact article I read. I have found some code  
on StackOverflow but doesn't seem complete. So if anyone could point  
me to a some sample code that optimizes for the type of device or  
documentation that explains what needs to be done, I'd be really  
grateful.


Thanks in advance
Cheers
Dave


___

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: -mouseDragged: sent to view when dragging window

2012-07-25 Thread Graham Cox

On 25/07/2012, at 5:19 PM, Markus Spoettl wrote:

> I don't believe that getting -mouseDragged: without a prior -mouseDown: or 
> following -mouseUp: is intentional.


I tend to agree, but I have also observed the issue you're having as well.

Basically, if you didn't get a mouseDown:, you should ignore any mouseDragged: 
events. It seems there are situations where the mouseDragged gets dispatched 
erroneously.


--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


Re: -mouseDragged: sent to view when dragging window

2012-07-25 Thread Markus Spoettl

On 7/24/12 11:29 PM, Quincey Morris wrote:

My view reacts to -mouseDragged: but doesn't check if there's been a
-mouseDown: first because that's implicit. Did that change?


The Cocoa Event Handling Guide says "Mouse events are dispatched by
an NSWindow object to the NSView object over which the event occurred", so I
guess there's a lag/race condition that's putting your view under the mouse
pointer at the moment the event is generated.


It also states (a few times in different wording):



For each dragging sequence, the Application Kit sends a mouseDown: message to a 
responder object, then sends one or more mouseDragged: messages, and ends the 
sequence with a mouseUp: message.

<

While it doesn't spell it out, it's pretty clear they're talking about the same 
view/responder for all those events.



I think it's implicit that a mouseDown has occurred before a mouseDragged, but I
don't see anything that guarantees they're sent to the same view. In that case,
you should really set a state flag in mouseDown that's checked in mouseDragged.


When I click into a view and drag, it gets all dragging events, even if the 
cursor is dragged outside its frame. Also, views over which the cursor is 
dragged during this process, don't get a single -mouseDragged: message.


I don't believe that getting -mouseDragged: without a prior -mouseDown: or 
following -mouseUp: is intentional.


Regards
Markus
--
__
Markus Spoettl
___

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