Refreshing an NSTableView with some columns using bindings, others not..

2012-06-14 Thread Robert Monaghan
Hi Everyone,

I have a reasonably mixed NSTableView object.. I have some columns bound to my 
NSArrayController, which drives an NSCell with a Checkbox. I have other Columns 
which are driven by the traditional delegate calls, so that I can add some 
logic to change the text color, depending upon the state of the objects in the 
NSArray.

What I am seeing, is that if I have some sort of activity that changes the 
state of the object, my checkbox is updated immediately by the 
NSArrayController. However, the delegate calls that are used to change the Text 
Color only occur if I click inside my UI.

Is there a way to make this update along side the bindings? Or am I going to 
have to create an IBOutlet to my TableView, and do a [tableView reloadData] 
everywhere that I touch any object in my NSArrayController? Should I subclass 
my NSArrayController and have it issue this command?

Thanks!

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


resolve alias on ios 4

2012-06-14 Thread Ariel Feinerman
Hi,

how to resolve alias on ios 4 or earlier? This is unusual one has not got
neither CoreServices nor bookmarks .

-- 
best regards
Ariel
___

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: Refreshing an NSTableView with some columns using bindings, others not..

2012-06-14 Thread Keary Suska
On Jun 14, 2012, at 5:14 AM, Robert Monaghan wrote:

> I have a reasonably mixed NSTableView object.. I have some columns bound to 
> my NSArrayController, which drives an NSCell with a Checkbox. I have other 
> Columns which are driven by the traditional delegate calls, so that I can add 
> some logic to change the text color, depending upon the state of the objects 
> in the NSArray.
> 
> What I am seeing, is that if I have some sort of activity that changes the 
> state of the object, my checkbox is updated immediately by the 
> NSArrayController. However, the delegate calls that are used to change the 
> Text Color only occur if I click inside my UI.
> 
> Is there a way to make this update along side the bindings? Or am I going to 
> have to create an IBOutlet to my TableView, and do a [tableView reloadData] 
> everywhere that I touch any object in my NSArrayController? Should I subclass 
> my NSArrayController and have it issue this command?

You will need to make such a call, although 
-reloadDataForRowIndexes:columnIndexes: would be preferred and have fewer side 
effects. How or when, however, may be tricky. Close to the event that caused 
the data change would be most robust I imagine...

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


___

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: resolve alias on ios 4

2012-06-14 Thread Mike Abdullah
How are you coming across an alias on iOS 4?

On 14 Jun 2012, at 05:00, Ariel Feinerman wrote:

> Hi,
> 
> how to resolve alias on ios 4 or earlier? This is unusual one has not got
> neither CoreServices nor bookmarks .
> 
> -- 
> best regards
> Ariel
> ___
> 
> 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/cocoadev%40mikeabdullah.net
> 
> This email sent to cocoa...@mikeabdullah.net


___

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


Demo Version

2012-06-14 Thread Richard Somers
The Mac App Store guidelines indicates that "Apps that are "beta", "demo", 
"trial", or "test" versions will be rejected".

So if potential customers need to go to my website to download a demo version 
then I might as well offer the retail version for sale on my website also. Why 
use the Mac App Store?

--Richard


___

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: Demo Version

2012-06-14 Thread Tim Schröder
.. because otherwise potential customers wouldn't find their way to your 
website? 

Tim

Am 14.06.2012 um 19:41 schrieb Richard Somers:

> The Mac App Store guidelines indicates that "Apps that are "beta", "demo", 
> "trial", or "test" versions will be rejected".
> 
> So if potential customers need to go to my website to download a demo version 
> then I might as well offer the retail version for sale on my website also. 
> Why use the Mac App Store?
> 
> --Richard
> 
> 
> ___
> 
> 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/tim%40timschroeder.net
> 
> This email sent to t...@timschroeder.net


___

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: [OT] Finite vs Infinite State Machines?

2012-06-14 Thread Dave


On 14 Jun 2012, at 05:12, Graham Cox wrote:



On 14/06/2012, at 8:03 AM, Dave wrote:

In assembler this would be implemented is using an "Exchange  
Instruction" to alter the PC on the stack and cause it to return  
to the correct place once the ASync Task (usually an interrupt)  
had finished.



Ah, those were the days - push a calculated address on the stack  
and do a 'RET' to cause a jump to that address... thankfully such  
tricks are wholly unnecessary these days. In fact a simple  
switch...case statement does the same job in most cases.


I'm not sure of the answer to your question though, seems to me you  
could simply queue each task then the next executes as soon as the  
one ahead of it finishes.




The point is you can't queue B until the data from A has been  
obtained and that might take a long while. There are two ways to deal  
with it, either have a call back from the lower level that returns  
the data (in which case you have to specify an address/selector to go  
to when the data has been obtained sucessfully), OR you can invert  
the control and make the interface look as it is demand based, even  
though the data is being obtained as and when it is ready.


___

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: Demo Version

2012-06-14 Thread Kyle Sluder
On Jun 14, 2012, at 10:41 AM, Richard Somers wrote:

> The Mac App Store guidelines indicates that "Apps that are "beta", "demo", 
> "trial", or "test" versions will be rejected".
> 
> So if potential customers need to go to my website to download a demo version 
> then I might as well offer the retail version for sale on my website also. 
> Why use the Mac App Store?

Do we really need to rehash this business discussion every few weeks on this 
technical mailing list?

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


Authorization to copy a file -- is it really that complex?

2012-06-14 Thread Jens Alfke
I've managed to never have to deal with Authorization Services so far in my 
Cocoa career; until today. Basically I have an app that needs to install some 
helper tools that the user can run from a shell. (This is a lot like the way 
TextMate installs the 'mate' tool.) I'm giving a choice of install locations, 
but the typical one is going to be /usr/bin, so the app will need to authorize 
to do that.

Reading through the Authorization Services Programming Guide and 
BetterAuthorizationSample, this all looks really, really complicated. All I 
need to do is the GUI equivalent of "sudo ditto my_tool /usr/bin" — does this 
really take pages and pages of code involving AuthorizationRefs and IPC, and 
either setuid or invoking launchctl?!

—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: Authorization to copy a file -- is it really that complex?

2012-06-14 Thread Laurent Daudelin
Jens,

I understand your pain. I didn't want to go through it either and I finally 
found BLAuthentication which is a Objective-C wrapper class around the 
Authorization Services. It's a bit outdated but still works fine for me. It's 
hard to find a copy somewhere but here is a link:

http://blog.laurent.etiemble.com/index.php?post/2005/12/05/36

-Laurent.
-- 
Laurent Daudelin
AIM/iChat/Skype:LaurentDaudelin 
http://www.nemesys-soft.com/
Logiciels Nemesys Software  
laur...@nemesys-soft.com

On Jun 14, 2012, at 13:39, Jens Alfke wrote:

> I've managed to never have to deal with Authorization Services so far in my 
> Cocoa career; until today. Basically I have an app that needs to install some 
> helper tools that the user can run from a shell. (This is a lot like the way 
> TextMate installs the 'mate' tool.) I'm giving a choice of install locations, 
> but the typical one is going to be /usr/bin, so the app will need to 
> authorize to do that.
> 
> Reading through the Authorization Services Programming Guide and 
> BetterAuthorizationSample, this all looks really, really complicated. All I 
> need to do is the GUI equivalent of "sudo ditto my_tool /usr/bin" — does this 
> really take pages and pages of code involving AuthorizationRefs and IPC, and 
> either setuid or invoking launchctl?!
> 
> —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: Authorization to copy a file -- is it really that complex?

2012-06-14 Thread Jens Alfke
Actually I just discovered the listing "Calling A Privileged Installer", which 
looks like exactly what I want — a page or so of code to run an 
already-existing system command with root privileges. I think all I need to do 
is change the command from "id -un" to "ln -s ...".

Let me know if I'm barking up the wrong tree…

—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: Authorization to copy a file -- is it really that complex?

2012-06-14 Thread Jean-Daniel Dupas

Le 14 juin 2012 à 22:39, Jens Alfke a écrit :

> I've managed to never have to deal with Authorization Services so far in my 
> Cocoa career; until today. Basically I have an app that needs to install some 
> helper tools that the user can run from a shell. (This is a lot like the way 
> TextMate installs the 'mate' tool.) I'm giving a choice of install locations, 
> but the typical one is going to be /usr/bin, so the app will need to 
> authorize to do that.
> 
> Reading through the Authorization Services Programming Guide and 
> BetterAuthorizationSample, this all looks really, really complicated. All I 
> need to do is the GUI equivalent of "sudo ditto my_tool /usr/bin" — does this 
> really take pages and pages of code involving AuthorizationRefs and IPC, and 
> either setuid or invoking launchctl?!
> 
> —Jens

You can ask the Finder to do it using Apple Events. I find it convenient as it 
takes care of the authorization for you.

Alternatively, you can use the authopen tool with NSTask to open the file, and 
then perform the copy yourself (see man authopen). It will also take care of 
the authorization for you, and will provide a pipe to write in the file.

-- Jean-Daniel





___

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: Authorization to copy a file -- is it really that complex?

2012-06-14 Thread Charlie Dickman
Laurent,

Thanks so much for the links! For me wrapper packages are by far the best tool 
for understanding Apple's APIs. I used SSCrypto to learn how to use openSSL.

On Jun 14, 2012, at 4:56 PM, Laurent Daudelin wrote:

> Jens,
> 
> I understand your pain. I didn't want to go through it either and I finally 
> found BLAuthentication which is a Objective-C wrapper class around the 
> Authorization Services. It's a bit outdated but still works fine for me. It's 
> hard to find a copy somewhere but here is a link:
> 
> http://blog.laurent.etiemble.com/index.php?post/2005/12/05/36
> 
> -Laurent.
> -- 
> Laurent Daudelin
> AIM/iChat/Skype:LaurentDaudelin   
> http://www.nemesys-soft.com/
> Logiciels Nemesys Software
> laur...@nemesys-soft.com
> 
> On Jun 14, 2012, at 13:39, Jens Alfke wrote:
> 
>> I've managed to never have to deal with Authorization Services so far in my 
>> Cocoa career; until today. Basically I have an app that needs to install 
>> some helper tools that the user can run from a shell. (This is a lot like 
>> the way TextMate installs the 'mate' tool.) I'm giving a choice of install 
>> locations, but the typical one is going to be /usr/bin, so the app will need 
>> to authorize to do that.
>> 
>> Reading through the Authorization Services Programming Guide and 
>> BetterAuthorizationSample, this all looks really, really complicated. All I 
>> need to do is the GUI equivalent of "sudo ditto my_tool /usr/bin" — does 
>> this really take pages and pages of code involving AuthorizationRefs and 
>> IPC, and either setuid or invoking launchctl?!
>> 
>> —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/3tothe4th%40comcast.net
> 
> This email sent to 3tothe...@comcast.net

Charlie Dickman
3tothe...@comcast.net




___

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

More PDFView mysteries...

2012-06-14 Thread Matthew Weinstein
Dear Cocoa-Devs,
I have an app that works perfectly on snow leopard, it consists of a split view 
with a pdfview on top, and another view on the bottom. On lion however the 
pdfview is blank until I resize the window or splitview. I've tried throwing 
various things at the window in the windowControllerDidLoadNib: section 
[myPDFView display]... [myWindow setNeedsDisplay: YES]...

It almost feels like the windowControllerDidLoadNib is happening too quickly 
(or something). BTW this splitview is in a tabview... If I manually tab to 
something else and back, it refreshes, if I do it programattically at the end 
of the ...didLoadNib: method, nothing, doesn't work.

Ideas? Anyone else having pdfview lion problems.

Matthew Weinstein
Professor of Science Education
Education Program
U.W. - Tacoma
253 692-4787

matth...@u.washington.edu

Campus Box: 358435
1900 Commerce Street
Tacoma, WA  98402-3100
Office:  (253) 692-4787
FAX: (253) 692-5612






___

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: [OT] Finite vs Infinite State Machines?

2012-06-14 Thread Graham Cox

On 15/06/2012, at 3:56 AM, Dave wrote:

> 
> On 14 Jun 2012, at 05:12, Graham Cox wrote:
> 
>> 
>> On 14/06/2012, at 8:03 AM, Dave wrote:
>> 
>>> In assembler this would be implemented is using an "Exchange Instruction" 
>>> to alter the PC on the stack and cause it to return to the correct place 
>>> once the ASync Task (usually an interrupt) had finished.
>> 
>> 
>> Ah, those were the days - push a calculated address on the stack and do a 
>> 'RET' to cause a jump to that address... thankfully such tricks are wholly 
>> unnecessary these days. In fact a simple switch...case statement does the 
>> same job in most cases.
>> 
>> I'm not sure of the answer to your question though, seems to me you could 
>> simply queue each task then the next executes as soon as the one ahead of it 
>> finishes.
>> 
> 
> The point is you can't queue B until the data from A has been obtained and 
> that might take a long while. There are two ways to deal with it, either have 
> a call back from the lower level that returns the data (in which case you 
> have to specify an address/selector to go to when the data has been obtained 
> sucessfully), OR you can invert the control and make the interface look as it 
> is demand based, even though the data is being obtained as and when it is 
> ready.


I can't really see the problem here. You can still queue the tasks, even if the 
queued task doesn't have the data available when it's queued - the data will be 
available by the time it comes to run, so it can just ask for it then. It's 
really simple to create demand-based data providers in Cocoa using informal or 
formal protocols, delegation, or passing a predefined selector/target as you 
suggest. Or using NSInvocation. There are many solutions, there's probably no 
One True Way™ but certainly you have the tools at your disposal - there are 
plenty of solid reliable solutions that require no particular tricks, and 
certainly nothing skanky of the sort you were reminiscing about!

--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: Demo Version

2012-06-14 Thread Preston Sumner
On Jun 14, 2012, at 11:41 AM, Richard Somers wrote:

> The Mac App Store guidelines indicates that "Apps that are "beta", "demo", 
> "trial", or "test" versions will be rejected".
> 
> So if potential customers need to go to my website to download a demo version 
> then I might as well offer the retail version for sale on my website also. 
> Why use the Mac App Store?

This question is entirely up to you to answer.

Preston
___

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: More PDFView mysteries...

2012-06-14 Thread Graham Cox

On 15/06/2012, at 8:15 AM, Matthew Weinstein wrote:

> It almost feels like the windowControllerDidLoadNib is happening too quickly 
> (or something).


Note what that method literally tells you - the window controller loaded the 
nib. That doesn't mean that the actual window was instantiated yet (with all 
its views). A window controller lazily loads the window when it is actually 
required, which is a bit later. You can use the controller's windowDidLoad 
method to find out when that has happened.

The probable reason this is different on Lion is because NSDocument is a very 
different beast on Lion. It is often invoked on a background thread and various 
interface-less document objects are made to support Versions and Autosaving. 
It's a rather complex situation on Lion which *appears* to assume a very great 
deal about how your app has subclassed NSDocument. For example, when browsing 
Versions, each version you see is an actual instance of your NSDocument 
subclass complete with its window - it's not just the snapshot image you might 
have thought. Scary stuff.

--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: Demo Version

2012-06-14 Thread koko

On Jun 14, 2012, at 6:06 PM, Preston Sumner wrote:

>> Why use the Mac App Store?

Apple needs its 30 points!

-koko

___

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: More PDFView mysteries...

2012-06-14 Thread Matthew Weinstein
That is a problem; I think this is a pdfkit bug, and I need to register it 
(slowly figuring these things out). What I did to isolate the problem was 
create a project with a window in which I just dropped a pdfview and 
pdfthumbview on (didn't even bother to change the sizing. Hardcoded an URL to a 
pdf; created a PDFDocument init'd with the url and then did [mypdfview 
setDocument: myURL]. All of that in the windowcontrollerDidLoadNib method.

same problem. pdfviews can't be set in the init'd in the 
windowControllerDidLoadNib; but I think the problem is bigger.

I relocated the load code so it was activated by a button rather than the 
windowController: same problem. There's a definite pdfview problem...

Solutions?


On Jun 14, 2012, at 5:08 PM, Graham Cox wrote:

> 
> On 15/06/2012, at 8:15 AM, Matthew Weinstein wrote:
> 
>> It almost feels like the windowControllerDidLoadNib is happening too quickly 
>> (or something).
> 
> 
> Note what that method literally tells you - the window controller loaded the 
> nib. That doesn't mean that the actual window was instantiated yet (with all 
> its views). A window controller lazily loads the window when it is actually 
> required, which is a bit later. You can use the controller's windowDidLoad 
> method to find out when that has happened.
> 
> The probable reason this is different on Lion is because NSDocument is a very 
> different beast on Lion. It is often invoked on a background thread and 
> various interface-less document objects are made to support Versions and 
> Autosaving. It's a rather complex situation on Lion which *appears* to assume 
> a very great deal about how your app has subclassed NSDocument. For example, 
> when browsing Versions, each version you see is an actual instance of your 
> NSDocument subclass complete with its window - it's not just the snapshot 
> image you might have thought. Scary stuff.
> 
> --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: More PDFView mysteries...

2012-06-14 Thread Kyle Sluder
On Jun 14, 2012, at 5:08 PM, Graham Cox  wrote:

> 
> On 15/06/2012, at 8:15 AM, Matthew Weinstein wrote:
> 
>> It almost feels like the windowControllerDidLoadNib is happening too quickly 
>> (or something).
> 
> 
> Note what that method literally tells you - the window controller loaded the 
> nib. That doesn't mean that the actual window was instantiated yet (with all 
> its views). A window controller lazily loads the window when it is actually 
> required, which is a bit later. You can use the controller's windowDidLoad 
> method to find out when that has happened.

You seem to be attributing more magic to NSWindowController than it actually 
possesses.

NSWindowController loads and instantiates its nib in response to -window being 
called while self.window==nil. After it has instantiated the nib (which is 
synonymous with "loading" it), it invokes -windowControllerDidLoadNib.

In other words, the window has indeed been unarchived from nib and assigned to 
the window controller's window outlet by the time -windowControllerDidLoadNib 
is invoked.

> 
> The probable reason this is different on Lion is because NSDocument is a very 
> different beast on Lion. It is often invoked on a background thread and 
> various interface-less document objects are made to support Versions and 
> Autosaving. It's a rather complex situation on Lion which *appears* to assume 
> a very great deal about how your app has subclassed NSDocument. For example, 
> when browsing Versions, each version you see is an actual instance of your 
> NSDocument subclass complete with its window - it's not just the snapshot 
> image you might have thought. Scary stuff.

This is true, but -makeWindowControllers is still invoked on the main thread, 
and obviously can only be called after your document has been instantiated (but 
possibly before the background read operation has signaled succes or failure; I 
can't recall if any guarantees are made about that).

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


How to override [NSTextField paste:]

2012-06-14 Thread Graham Cox
Is there a way to override the -paste: method of NSTextField, other than 
subclassing?

I have a situation where I want to handle paste for several related text entry 
fields at once. I have implemented -paste: in the controller for these, but of 
course it goes to first responder which is the text field itself (or its 
editor) which isn't what I want. Subclassing the field is an option, but 
because of the Field Editor, I'm not sure it's what is really needed.

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