Re: Refreshing NSArrayController after Undo/Redo

2010-03-23 Thread Joanna Carter
Hi folks

Now which one of you here hasn't read the docs fully and properly before asking 
a question?  :-)

Jerry Krinock dropped me a private line and suggested that the title for this 
thread should have been  "How to register Undo when syncing MOCs with 
mergeChangesFromContextDidSaveNotification:". Thank you Jerry, that was just 
the nudge I needed.

Regardless of any messing around with secondary MOCs in separate windows and 
controllers, the simple truth of the matter is:

The default implementation of Undo in a MOC only undoes *uncommitted* changes 
to that MOC. Once you've called save: on the MOC there is no (automatic) going 
back.

But, now I know what does and doesn't happen, I have a cunning plan...

I'll let you know when I get it sorted.

Joanna

--
Joanna Carter
Carter Consulting

___

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

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


Re: Details and the concepts related to the Nib Window

2010-03-23 Thread Chaitanya Pandit

> Also what does FilesOwner and First responder refers to.

File's owner as the name suggests is the owner of the file, for example if your 
nib file is a window controller, the file's owner would be an object of class 
NSWindowController or your custom subclass of NSWindowController.
> 
> Whenever we drag an object from the Interface builder to our Nib window
> (like we do for a controller object), it means that we are instantiating the
> object of a class or interface. But where actually can i see it being
> instantiated. 
> 
Implement the method awakeFromNib in any of the subclassed objects in your nib 
file, this method is called for each object in the nib file whenever the nib 
file is loaded, generally don't rely on the init method of these objects

> Also, when NSApplicationMain function is called from main.m file, what are
> the background stuff happening in the background.
> 

You may have to look up on NSRunLoop in the Threading Programming Guide

> I want to see these stuff so that I can modify things accordingly whenever
> needed.
> 


Thanks,

Chaitanya Pandit
Chief Architect
Expersis Software Inc.

On Mar 23, 2010, at 3:37 AM, Abhinav Tyagi 
wrote:___

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

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


Main thread crash

2010-03-23 Thread Arun
Hi All,
My app is crashing with the following crash log. Not sure where is the
problem.
In the stack trace below i am not finding any calls in my code ?

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x4250
Crashed Thread:  0

Thread 0 Crashed:
0   libobjc.A.dylib   0x93c9e684 objc_msgSend + 20
1   com.apple.AppKit   0x94dad0ae -[NSIBObjectData dealloc] + 53
2   com.apple.AppKit   0x952500bd
-[NSImageCell(NSPrivateAnimationSupport) _animationTimerCallback:] + 166
3   com.apple.Foundation   0x903aa1e3 __NSFireTimer + 147
4   com.apple.CoreFoundation   0x9242fb45 CFRunLoopRunSpecific + 4469
5   com.apple.CoreFoundation   0x9242fcf8 CFRunLoopRunInMode + 88
6   com.apple.HIToolbox   0x968a9480 RunCurrentEventLoopInMode + 283
7   com.apple.HIToolbox   0x968a9299 ReceiveNextEventCommon + 374
8   com.apple.HIToolbox   0x968a910d
BlockUntilNextEventMatchingListInMode + 106
9   com.apple.AppKit   0x94db53ed _DPSNextEvent + 657
10  com.apple.AppKit   0x94db4ca0 -[NSApplication
nextEventMatchingMask:untilDate:inMode:dequeue:] + 128
11  com.apple.AppKit   0x94dadcdb -[NSApplication run] + 795
12  com.apple.AppKit   0x94d7af14 NSApplicationMain + 574
13  com.yourcompany.Vi2   0x2949 main + 53 (main.mm:64)
14  com.yourcompany.Vi2   0x288e start + 54



Thanks
Arun KA
___

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

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


Re: Main thread crash

2010-03-23 Thread Scott Ribe
You've either over-released something that the timer refers to, so that it's
not there when the timer fires. Or you have left the timer running after it
should have been.

If it's not just that you, for instance, forgot to stop the timer when
closing a window or dealloc'ing a window controller, then you'll want to run
with NSZombies.

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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


Another IKImageView question: Copying a region

2010-03-23 Thread Brian Postow
I'm not sure if ImageKit is more correctly a cocoa thing, or a Quartz thing, so 
I'm asking this in both places. Sorry for the duplicate, If the question is 
inappropriate in one or the other list let me know and, well I guess I can't 
delete from a mailing, list, but I won't send more ImageKit questions I guess...

I'm trying to use the select and copy feature of the IKImageView. If all you 
want to do is have an app with an image, select a portion and copy it to the 
clipboard, it's easy. You set the copy menu pick to the first responder's 
copy:(id) method and magically everything works.

However, if you want something more complicated, like you want to copy as part 
of some other operation, I can't seem to find the method to do this. 

IKImageView doesn't seem to have a copy method, it doesn't seem to have a 
method that will even tell you the selected rectangle! 

I have gone through Hillegass' book, so I understand how the clipboard works, 
just not how to get the portion of the image out of the view...

Now, I'm starting to think that I made a mistake in basing my project on 
IKImageView, but it's what Preview is built on (or so I've read), so I figured 
it had to be stable... and anyway, now it's too late, I'm too deep in this to 
start over...

So, other than not using IKImageView, any suggestions on how to copy the select 
region to the clipboard manually? 

Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

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

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


Re: Three odd iPhone dev problems

2010-03-23 Thread Nava Carmon
I have a field with such a behavior in my application. I just colored the text 
in blue color, so it can be easily distinguished. Since I present texts in the 
table view, I invoke phone call when the user taps on the cell. For editing 
text table has to be in edit mode. But if you really want to see it underlined, 
check the following url:

http://stackoverflow.com/questions/964027/how-can-i-underline-part-of-the-text-like-iphone-sms

Hope it helps

On Mar 20, 2010, at 2:35 AM, William Squires wrote:

> Thanks! Now, is it possible to make a UIButton look like a UITextField whose 
> caption is underlined (to look like a link)?
> 
> On Mar 18, 2010, at 11:00 PM, Dave Carrigan wrote:
> 
>> 
>> On Mar 18, 2010, at 8:55 PM, William Squires wrote:
>> 
>>> 3) How do I get a UITextField that displays a telephone number to be able 
>>> for the user to click it to dial the number, but not so they can edit it in 
>>> place? Or is this a different control?
>> 
>> Maybe make it a custom button instead.
> 
> ___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/ncarmon%40mac.com
> 
> This email sent to ncar...@mac.com


Nava Carmon
ncar...@mac.com

"Think good and it will be good!"

___

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

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


Screen size in Dual monitor mode

2010-03-23 Thread Nikhil Khandelwal
Hi,

In my application I am working with Dual monitor and I want to capture the 
whole screen size. For this I am using NSScreen API to get the whole screen 
size however this is returning me only with the screen resolution for single 
monitor. So is there any way to get the size of combined screen in dual monitor 
mode.

Thanks,
Nikhil

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.
___

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

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


Re: Another IKImageView question: Copying a region

2010-03-23 Thread Brian Postow
Addition:  actually, I have found the copy(id) method, but when I call it, I get

 : CGBitmapContextCreate: unsupported parameter combination: 8 integer 
bits/component; 16 bits/pixel; 1-component color space; 
kCGImageAlphaPremultipliedLast; 2624 bytes/row.
Which obviously doesn't happen when I do a normal copy through the 
first-responder... I understand the error message, but I'm not sure where it's 
getting those parameters from...

Is there any way to trace through this and see how this is happening? A 
debugger won't help for obvious reasons, as well as the fact that I'm doing 
this in Mozilla, so a debugger isn't an option anyway...


Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

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

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


Re: Screen size in Dual monitor mode

2010-03-23 Thread Graham Cox
[NSScreen screens] with NSUnionRect() of all -frame properties.

--Graham


On 24/03/2010, at 1:27 AM, Nikhil Khandelwal wrote:

> In my application I am working with Dual monitor and I want to capture the 
> whole screen size. For this I am using NSScreen API to get the whole screen 
> size however this is returning me only with the screen resolution for single 
> monitor. So is there any way to get the size of combined screen in dual 
> monitor mode.

___

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

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


Re: Screen size in Dual monitor mode

2010-03-23 Thread Shawn Erickson
On Tue, Mar 23, 2010 at 7:27 AM, Nikhil Khandelwal
 wrote:

> In my application I am working with Dual monitor and I want to capture the 
> whole screen size. For this I am using NSScreen API to get the whole screen 
> size however this is returning me only with the screen resolution for single 
> monitor. So is there any way to get the size of combined screen in dual 
> monitor mode.

What do you mean dual monitor mode? You mean mirrored? Mac OS X
supports an arbitrary number of monitors connected to a system
(limited by hardware capabilities of course).

Also what do you mean by "whole screen size"? Don't forget a user can
arrange screens in various locations and orientations relative to each
other. As a result a union of all frames may be misleading/meaningless
because of large gaps where no monitor exists simply because of how
the user arranged the monitors.

-Shawn
___

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

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


Re: Details and the concepts related to the Nib Window

2010-03-23 Thread James Bucanek
Jon Pugh  wrote (Monday, 
March 22, 2010 11:22 PM -0700):



I presume he means via a breakpoint in the debugger.  Typically people put a
breakpoint in init and don't see it being hit because init isn't called,
initWithCoder is what is used when unarchiving objects from a nib, but that's
a tough one to break in.


Just for completeness:

o Generally, objects that IB understands (i.e. the objects in 
the Library) are instantiated using -initWithCoder:. This is how 
IB initializes the object with the properties that you've 
defined in IB.


o Custom subclasses of NSObject are instantiated with -init 
(this is so you don't have to make an object conform to NSCoding 
to use it in IB).


o Custom subclasses of NSView are instantiated with 
-initWithFrame: (to be consistent with NSView's designated 
constructor, and also to avoid the NSCoding requirement).



Typically, the first place your Interface Builder objects/delegates get called
is awakeFromNib.  That's the place to put a breakpoint where you can see the
things you created in Interface Builder.


Agreed!

--
James Bucanek

___

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

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


Re: Attempt to nest an NSCollectionView fails.

2010-03-23 Thread Kevin Perry
I'm not sure this is really a usage case that I'd expect to be well tested, 
since it seems a little out of the ordinary.

Anyway, which approach are you using for your prototype view? Is the view in 
the same nib, or have you factored it out into a separate nib, using the fact 
that NSCollectionViewItem became a subclass of NSViewController in Snow 
Leopard? If you're using the former, then the bindings may very well not be 
transferred correctly to each replicated view. Either switch to the Snow 
Leopard approach (highly recommended -- see the AppKit release notes for more 
details), or you can try overriding -newItemForRepresentedObject: and set up 
the bindings yourself.

-Kevin

On Mar 22, 2010, at 8:31 PM, Brian Krisler wrote:

> Hi,
> 
> I am trying to nest an NSCollectionView inside an existing collection view 
> and am not having much luck.  The example I am building runs without issue, 
> however the nested values do not appear.
> 
> I currently have two model classes:
> 
> @interface BlockModel : NSObject {
>   NSString *blockTitle;
>   NSMutableArray *blockItems;
> }
> @property (readwrite, retain) NSString *blockTitle;
> @property (readwrite, retain) NSMutableArray *blockItems;
> @end
> 
> and 
> 
> @interface BlockItem : NSObject {
>   NSString *itemName;
>   NSString *itemDescription;
> }
> @property (readwrite, retain) NSString *itemName;
> @property (readwrite, retain) NSString *itemDescription;
> @end
> 
> In my delegate, I have an NSMutableArray of blockModels.
> 
> Then in Interface Builder, I have an NSCollection view with a label and a 
> nested NSCollection view.  The label contains the BlockModel.blockTitle 
> (which displays correctly).
> 
> To get content into the nested view, I have an Array Controller with the 
> Content Array bound to the Collection View Item from the parent and a model 
> Key Path of: representedObject.blockItems
> 
> My nested collection view has its content bound to my Array Controller 
> arrangedObjects. And my array controller is configured to be an object 
> controller with the keys: itemName and itemDescription. I then have two 
> labels in my nested collection view bound to the nested collection view item 
> representedObject.itemName and representedObject.itemDescription.
> 
> When I execute my code, I can see a few blocks with the proper titles, 
> however the nest view is completely empty.
> 
> Is there a step that I am missing?
> 
> Thanks for any help.
> 
> Brian
> ___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/kperry%40apple.com
> 
> This email sent to kpe...@apple.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


applicationShouldTerminateAfterLastWindowClosed Document-based Project Help?

2010-03-23 Thread Bill Hernandez
I had posted this message at 
http://discussions.apple.com/thread.jspa?threadID=2374717&tstart=0

but thought I might have better luck here.

If I do the following:

( 1 ) create a NON-document based Cocoa Project:
( 2 ) add a button to the nib window, name it DONE
( 3 ) Control Click and Drag from DONE to the Window and select performClose: 
from the HUD
( 4 ) Run and click on DONE and applicationShouldTerminateAfterLastWindowClosed 
gets called, and the app quits just like it is supposed to. So this brief 
amount of code works GOOD ...

But if I try to get this to work with a Document based Project I cannot get 
applicationShouldTerminateAfterLastWindowClosed to trigger such that the 
application will quit.

I have tried creating an AppController Class (SubClass of NSController) then 
dragged it to the Nib Window, auto-created the AppController methods, and put 
the code there, and IB will not let me Control-Click-Drag from the File's Owner 
to the AppController instance in the Nib. The AppController won't highlight. So 
obviously I am doing something wrong...

//  TestNoDocAppDelegate.h
//  TestNoDoc
 
#import 
@interface TestNoDocAppDelegate : NSObject  {
NSWindow *window;
}
@property (assign) IBOutlet NSWindow *window;
@end


//  TestNoDocAppDelegate.m
//  TestNoDoc
 
#import "TestNoDocAppDelegate.h"
@implementation TestNoDocAppDelegate
@synthesize window;
 
- (void)applicationDidFinishLaunching:(NSNotification *)aNotification {
// Insert code here to initialize your application 
}
 
// If the user closes the last window in the application, make sure the 
application quits.
- (BOOL)applicationShouldTerminateAfterLastWindowClosed:(NSApplication *)sender 
{
NSLog(@"[4567] %@",@"applicationShouldTerminateAfterLastWindowClosed");
return YES;
}
@end


When I tried this awakeFromNib in MyDocument Class I still could not get 
applicationShouldTerminateAfterLastWindowClosed to trigger.

- (void) awakeFromNib
{
NSLog(@"[4001] %@",[NSApp delegate]);   // returned null
[NSApp setDelegate:self];
[[NSApp delegate] 
applicationShouldTerminateAfterLastWindowClosed:NSApp]; 
// this got called OK
 
NSLog(@"[4002] %@",[NSApp delegate]); 
// returned non-null value (whether it was good or not, I don't know. I 
assume it was.)
}


I am missing something with either not having the right class, or probably with 
the Nib Window connections.

I'd be grateful for some help.

Bill Hernandez
Plano, Texas

Steve Herman1 wrote:

So, instantiate a DocAppDelegate object in the MainMenu.xib instead. The File's 
Owner in that file represents the application so you can control drag from 
there to your delegate object.
.
.
I tried this and umpteen different combinations, and finally gave up. I know 
there's got to be a way to have the application respond to delegate methods, I 
just haven't found anything that shows how to get a document based project to 
respond to applicationShouldTerminateAfterLastWindowClosed.
.
.

PS - I tried creating my delegate object in MyDocument.xib and the 
control-dragging from the "Application" object to my delegate. That seems to 
work in IB and allowed me to make the connection, but when I built and ran the 
app it would crash when the last window closed... I'm not sure what the 
difference is between that object and the "File's Owner" or the "Application" 
object in in MainMenu.xib (both of which worked).
.
I ran into the same crashes. Maybe someone will come up with an answer... 

___

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

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


Re: Main thread crash

2010-03-23 Thread Arun
How does NSZombies help in resolving the crash?
Can anyone explain please.

-Arun

On Tue, Mar 23, 2010 at 7:10 PM, Scott Ribe wrote:

> You've either over-released something that the timer refers to, so that
> it's
> not there when the timer fires. Or you have left the timer running after it
> should have been.
>
> If it's not just that you, for instance, forgot to stop the timer when
> closing a window or dealloc'ing a window controller, then you'll want to
> run
> with NSZombies.
>
> --
> Scott Ribe
> scott_r...@killerbytes.com
> http://www.killerbytes.com/
> (303) 722-0567 voice
>
>
>
___

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

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


Re: Main thread crash

2010-03-23 Thread Kyle Sluder
On Tue, Mar 23, 2010 at 9:17 AM, Arun  wrote:
> How does NSZombies help in resolving the crash?

This document explains:
http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html#SECFOUNDATION

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

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


Re: Another IKImageView question: Copying a region

2010-03-23 Thread Kyle Sluder
Please don't cross-post. You've already posted this to quartz-dev.

--Kyle Sluder [not the moderator]

On Tue, Mar 23, 2010 at 6:45 AM, Brian Postow  wrote:
> I'm not sure if ImageKit is more correctly a cocoa thing, or a Quartz thing, 
> so I'm asking this in both places. Sorry for the duplicate, If the question 
> is inappropriate in one or the other list let me know and, well I guess I 
> can't delete from a mailing, list, but I won't send more ImageKit questions I 
> guess...
>
> I'm trying to use the select and copy feature of the IKImageView. If all you 
> want to do is have an app with an image, select a portion and copy it to the 
> clipboard, it's easy. You set the copy menu pick to the first responder's 
> copy:(id) method and magically everything works.
>
> However, if you want something more complicated, like you want to copy as 
> part of some other operation, I can't seem to find the method to do this.
>
> IKImageView doesn't seem to have a copy method, it doesn't seem to have a 
> method that will even tell you the selected rectangle!
>
> I have gone through Hillegass' book, so I understand how the clipboard works, 
> just not how to get the portion of the image out of the view...
>
> Now, I'm starting to think that I made a mistake in basing my project on 
> IKImageView, but it's what Preview is built on (or so I've read), so I 
> figured it had to be stable... and anyway, now it's too late, I'm too deep in 
> this to start over...
>
> So, other than not using IKImageView, any suggestions on how to copy the 
> select region to the clipboard manually?
>
> Brian Postow
> Senior Software Engineer
> Acordex Imaging Systems
>
> ___
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/kyle.sluder%40gmail.com
>
> This email sent to kyle.slu...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Main thread crash

2010-03-23 Thread Jeremy Pereira

On 23 Mar 2010, at 16:17, Arun wrote:

> How does NSZombies help in resolving the crash?
> Can anyone explain please.

http://developer.apple.com/mac/library/technotes/tn2004/tn2124.html#SECFOUNDATION

It was surprisingly hard to track down that link using Google.  In the end I 
got it with the following search term: nszombieenabled site:developer.apple.com



> 
> -Arun
> 
> On Tue, Mar 23, 2010 at 7:10 PM, Scott Ribe wrote:
> 
>> You've either over-released something that the timer refers to, so that
>> it's
>> not there when the timer fires. Or you have left the timer running after it
>> should have been.
>> 
>> If it's not just that you, for instance, forgot to stop the timer when
>> closing a window or dealloc'ing a window controller, then you'll want to
>> run
>> with NSZombies.
>> 
>> --
>> Scott Ribe
>> scott_r...@killerbytes.com
>> http://www.killerbytes.com/
>> (303) 722-0567 voice
>> 
>> 
>> 
> ___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/adc%40jeremyp.net
> 
> This email sent to a...@jeremyp.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Screen size in Dual monitor mode

2010-03-23 Thread Murat Konar
Shawn's right. Your screen area (made up of one or more screens) is  
likely to be non-rectangular, so the notion of a "whole screen size"  
is meaningless. There is no "whole screen", just a bunch of screens at  
arbitrary locations.


_murat

On Mar 23, 2010, at 8:07 AM, Shawn Erickson wrote:


On Tue, Mar 23, 2010 at 7:27 AM, Nikhil Khandelwal
 wrote:

In my application I am working with Dual monitor and I want to  
capture the whole screen size. For this I am using NSScreen API to  
get the whole screen size however this is returning me only with  
the screen resolution for single monitor. So is there any way to  
get the size of combined screen in dual monitor mode.


What do you mean dual monitor mode? You mean mirrored? Mac OS X
supports an arbitrary number of monitors connected to a system
(limited by hardware capabilities of course).

Also what do you mean by "whole screen size"? Don't forget a user can
arrange screens in various locations and orientations relative to each
other. As a result a union of all frames may be misleading/meaningless
because of large gaps where no monitor exists simply because of how
the user arranged the monitors.

-Shawn

___

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

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


Re: applicationShouldTerminateAfterLastWindowClosed Document-based Project Help?

2010-03-23 Thread Quincey Morris
On Mar 23, 2010, at 09:15, Bill Hernandez wrote:

> If I do the following:
> 
> ( 1 ) create a NON-document based Cocoa Project:
> ( 2 ) add a button to the nib window, name it DONE
> ( 3 ) Control Click and Drag from DONE to the Window and select performClose: 
> from the HUD
> ( 4 ) Run and click on DONE and 
> applicationShouldTerminateAfterLastWindowClosed gets called, and the app 
> quits just like it is supposed to. So this brief amount of code works GOOD ...
> 
> But if I try to get this to work with a Document based Project I cannot get 
> applicationShouldTerminateAfterLastWindowClosed to trigger such that the 
> application will quit.
> 
> I have tried creating an AppController Class (SubClass of NSController) then 
> dragged it to the Nib Window, auto-created the AppController methods, and put 
> the code there, and IB will not let me Control-Click-Drag from the File's 
> Owner to the AppController instance in the Nib. The AppController won't 
> highlight. So obviously I am doing something wrong...
> 
> [snip]
> 
> When I tried this awakeFromNib in MyDocument Class I still could not get 
> applicationShouldTerminateAfterLastWindowClosed to trigger.
> 
> [snip]

There's quite a lot of flailing going on here. If something goes wrong, 
randomly trying to solve a different problem isn't a great strategy.

You have an IB *usability* problem. That is, you tried to do something in IB 
and it didn't behave as expected. [As a consequence, your application has no 
delegate, and therefore -- of course -- the application delegate method 
applicationShouldTerminateAfterLastWindowClosed doesn't get called.]

So, back to IB. You don't say *which* nib you added your AppController instance 
to. My guess is that you're trying to do this in a document window nib (where 
File's Owner is of type NSDocument or NSWindowController) instead of the main 
menu nib. If that's not it, then what is the class of File's Owner? If you 
select File's Owner and display the Connections tab of the IB inspector, can 
you drag from the circle next to the 'delegate' outlet to your AppController 
object? To any object at all?

Also, this is not what you were asking about, and really none of my business, 
but why on earth do you want a document-based app to close after its last 
window closes? It denies the user the opportunity to open or create a new 
document.

Also, regarding your original non-document-based project, even if it was just a 
throw-away exercise, don't label your button "DONE". I mean this is torturing 
kittens, or worse. Mac buttons (except for "OK") aren't in uppercase, and the 
button label should say what it's going to do. "Quit" would have been perfect 
for this application, I suspect, and just as easy for you to type. :)


___

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

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


Re: Which iPhone Program?

2010-03-23 Thread Nava Carmon
We have same problem, since in order to get the application be installed on the 
device a certificate that allows creating mobile provisioning profiles should 
be copied from one machine to another, which it not so effective, especially 
when you have a couple of team members...

On Mar 16, 2010, at 6:48 AM, Scott Anguish wrote:

> 
> On Mar 14, 2010, at 9:21 AM, Don Quixote de la Mancha wrote:
> 
>> What I really need to know is how many developer seats each program
>> gets.  I need for three of us to be able to do our own builds, and for
>> us all to be able to install on our own machines.  My two QA people
>> are in other cities, so I can't do it for them.
>> 
>> On Sat, Mar 13, 2010 at 4:59 AM, Alexander Spohr  wrote:
>>> PS. I’d think all this info is on Apple’s site somewhere...
>> 
>> Actually it's not.  I looked pretty carefully before I wrote to the list.
> 
> At this point, I’d suggest contacting WWDR directly.
> 
> 
> Scott
> Moderator___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/ncarmon%40mac.com
> 
> This email sent to ncar...@mac.com


Nava Carmon
ncar...@mac.com

"Think good and it will be good!"

___

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

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


Re: applicationShouldTerminateAfterLastWindowClosed Document-based Project Help?

2010-03-23 Thread Bill Hernandez

On Mar 23, 2010, at 12:27 PM, Quincey Morris wrote:

> There's quite a lot of flailing going on here. If something goes wrong, 
> randomly trying to solve a different problem isn't a great strategy.

You are absolutely right on every one of your points, really on the money. I've 
been trying to learn Cocoa over the past three months, and every time I think I 
am making headway, I run into a problem and there's nobody locally to ask. I've 
bought several books on Cocoa, and have been trying to read them but my 
impatience gets the better of me, and I want to build stuff for which I am not 
equipped yet. I should do more reading and less coding...

> You have an IB *usability* problem. That is, you tried to do something in IB 
> and it didn't behave as expected. [As a consequence, your application has no 
> delegate, and therefore -- of course -- the application delegate method 
> applicationShouldTerminateAfterLastWindowClosed doesn't get called.]
> 
> So, back to IB. You don't say *which* nib you added your AppController 
> instance to. My guess is that you're trying to do this in a document window 
> nib (where File's Owner is of type NSDocument or NSWindowController) instead 
> of the main menu nib. If that's not it, then what is the class of File's 
> Owner? If you select File's Owner and display the Connections tab of the IB 
> inspector, can you drag from the circle next to the 'delegate' outlet to your 
> AppController object? To any object at all?

I had a severe misconception, which is that I didn't realize that I should be 
creating the AppController in the MainMenu nib. I honestly thought that 
MainMenu.xib was only for the menus. I had no clue that I should have put the 
AppController there, I was working with the NSDocument nib. Now it all makes 
sense. What an enlightening event...

> Also, this is not what you were asking about, and really none of my business, 
> but why on earth do you want a document-based app to close after its last 
> window closes? It denies the user the opportunity to open or create a new 
> document.

You are absolutely right ! The only reason for the 
applicationShouldTerminateAfterLastWindowClosed was to save me a step every 
time I used Build and Run and then closed a window. Instead of doing s CMD-Q, 
or clicking on the red Tasks button to get back to the project, I just started 
putting a Done button, it was just as a matter of convenience while I am trying 
to proceed on the learning curve. I had not even considered, or thought about 
the user yet. I am still in the totally confused stage, every time I think I am 
making headway, I realize I am not...


> Also, regarding your original non-document-based project, even if it was just 
> a throw-away exercise, don't label your button "DONE". I mean this is 
> torturing kittens, or worse. Mac buttons (except for "OK") aren't in 
> uppercase, and the button label should say what it's going to do. "Quit" 
> would have been perfect for this application, I suspect, and just as easy for 
> you to type. :)

You are right once again, I had actually written the message using Done, 
instead of DONE, the first time I posted it, but I was really trying to draw 
attention to the button so I changed it to DONE.

I had posted a number of questions on another forum, and never got much in the 
way of replies. Sometimes days would go by, and I could tell that many people 
had read the posts, but no replies were forthcoming. Sometimes it got pretty 
discouraging, and a couple of days ago I found out about this forum, and this 
was my first post.

Thank You very much for taking the time to provide your insights and help...

Bill Hernandez
Plano, Texas
http://www.journey-of-flight.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Which iPhone Program?

2010-03-23 Thread Luther Baker
I have the "company" license and can create multiple developer seats.

I don't think the core difference between company and enterprise is in how
many developer seats you create. Instead, I think the difference is in how
your application is distributed.

I understood an enterprise license to fit the need if you were writing an
'internal' application for 1000 technicians in the field using your app on
an iphone.

On the other hand, the company license allows a team of developers to create
certs, etc and deploy apps to the app store. With my company license, I can
login and add developers to my team and they, in turn, can login and have
certain things they can do on that team site.

My apologies if that is not what you were asking and if indeed, I have
misspoke.

-Luther



On Tue, Mar 23, 2010 at 12:30 PM, Nava Carmon  wrote:

> We have same problem, since in order to get the application be installed on
> the device a certificate that allows creating mobile provisioning profiles
> should be copied from one machine to another, which it not so effective,
> especially when you have a couple of team members...
>
> On Mar 16, 2010, at 6:48 AM, Scott Anguish wrote:
>
> >
> > On Mar 14, 2010, at 9:21 AM, Don Quixote de la Mancha wrote:
> >
> >> What I really need to know is how many developer seats each program
> >> gets.  I need for three of us to be able to do our own builds, and for
> >> us all to be able to install on our own machines.  My two QA people
> >> are in other cities, so I can't do it for them.
> >>
> >> On Sat, Mar 13, 2010 at 4:59 AM, Alexander Spohr 
> wrote:
> >>> PS. I’d think all this info is on Apple’s site somewhere...
> >>
> >> Actually it's not.  I looked pretty carefully before I wrote to the
> list.
> >
> > At this point, I’d suggest contacting WWDR directly.
> >
> >
> > Scott
> > Moderator___
> >
> > 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:
> > http://lists.apple.com/mailman/options/cocoa-dev/ncarmon%40mac.com
> >
> > This email sent to ncar...@mac.com
>
>
> Nava Carmon
> ncar...@mac.com
>
> "Think good and it will be good!"
>
> ___
>
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/lutherbaker%40gmail.com
>
> This email sent to lutherba...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


How to hide new objects in a NSTableView?

2010-03-23 Thread Joanna Carter
Hi folks

So, now I have worked out how to manage Undo and Redo for adding and removing 
new managed objects from an NSTableView, fed by an NSArrayController.

In the end, I had to use the same MOC for the "new object" sheet that I used 
for the main browsing form.

Now, the only thing left, that is slightly distracting, is that you can see the 
new object in the underlying table view, whilst it is being populated in the 
sheet.

I have tried adding a predicate to the array controller "objectID.isTemporaryID 
== NO" but it doesn't seem to get respected.

Any other ideas please?

Joanna

--
Joanna Carter
Carter Consulting

___

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

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


[MEET] Toronto Cocoaheads / tacow - April 13

2010-03-23 Thread Karl Moskowski
The next meeting of tacow/Toronto CocoaHeads will be held on Tuesday, April 13 
at 6:30 PM at Ryerson University. Note that this meeting is one week later than 
our regular date.

We'll be meeting in the Ryerson comp. sci. department's new Digital Media Zone 
(DMZ) at Yonge & Dundas. Up-to-date agenda & directions are available at:
http://groups.google.com/group/tacow/browse_thread/thread/625e7517bd14073d

See you then! 


Karl Moskowski 
Voodoo Ergonomics Inc. 



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

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

Re: How to hide new objects in a NSTableView?

2010-03-23 Thread Kyle Sluder
On Tue, Mar 23, 2010 at 11:27 AM, Joanna Carter
 wrote:
> In the end, I had to use the same MOC for the "new object" sheet that I used 
> for the main browsing form.

This isn't the recommended approach. It's recommended that you use a
scratch MOC for your data entry sheet, so that the object insertion is
seen as an atomic operation in the main MOC.

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

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


Re: How to hide new objects in a NSTableView?

2010-03-23 Thread Joanna Carter
Hi Kyle

> This isn't the recommended approach. It's recommended that you use a
> scratch MOC for your data entry sheet, so that the object insertion is
> seen as an atomic operation in the main MOC.

Yes, I would agree and that is, in fact, what I was doing but that then meant 
that I couldn't Undo the addition or editing of an object as an atomic 
operation.

From my research, the mergeChangesFromContextDidSaveNotification: method, that 
has to be called on the main MOC, doesn't play nicely with the MOC's undo 
manager.

So, I am now left thinking the only way around this is to insert an editing 
object in a secondary MOC, then, upon saving, insert a second object in the 
main MOC, copy the properties over from the editing object to the object in the 
main MOC, before rolling back the inserted object in the secondary MOC.

Wow!!! that is a whole load of hassle.

Joanna

--
Joanna Carter
Carter Consulting

___

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

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


Re: Merge changes between two Managed Object Contexts

2010-03-23 Thread Ben Trumbull
If you saved the temporary MOC, then all you have to do is call 
-[NSManagedObjectContext mergeChangesFromContextDidSaveNotification:] on the 
main MOC with the save notification from the temporary MOC.

It's moving unsaved changes around that's cumbersome.

- Ben


> Thank you Joanna, that was very helpful.  So, from your experience, 
> mergeChangesFromContextDidSaveNotification: will not pick up adding a new 
> object, just editing an existing one?  It seems like the real pain point is 
> having to re-create the new object in the second managedObjectContext and 
> copy all it's properties.
> 
> Austin
> 
> On Mar 21, 2010, at 6:48 PM, Joanna Carter wrote:
> 
>> Hi Austin
>> 
>>> I've got a Core Data project and I have a window controlled by an 
>>> NSWindowController that is used to add or edit an NSManagedObject.  I 
>>> wanted to create a separate Managed Object Context in the 
>>> NSWindowController so that the changes made to the object aren't seen by 
>>> the UI below and so I can just throw away the changes if the user clicks 
>>> "Cancel".  If the user clicks "Save' I wanted to merge the changes from the 
>>> temporary MOC to the main MOC being used by the rest of the application.
>>> 
>>> What is the best way to merge those changes back to the main MOC?  Do I 
>>> have to recreate the object in the main MOC as is done in this example: 
>>> http://www.timisted.net/blog/archive/multiple-managed-object-contexts-with-core-data?
>>>   Or, can I use - (void)refreshObject:(NSManagedObject *)object 
>>> mergeChanges:(BOOL)flag to merge the changes?  If i use 
>>> refreshObject:mergeChanges, can I pass it my NSManagedObject from the 
>>> temporary MOC and do I need to call save: on the temporary MOC before doing 
>>> that?


___

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

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


Re: find panel buttons not enabling

2010-03-23 Thread kvic...@pobox.com
i have now verified (via an extremely trivial cocoa application) that 
the buttons in a Find panel are not enabled if the first responder is 
an NSTextView that appears in a sheet (which is the key window). note 
that the find functions (e.g., find next/previous, use selection for 
find) all work properly.


can anyone tell me if this is by design (e.g., some manifestation of 
the HIG) or if this is a bug?


this is  built on and for 10.6.2.

in any case, can anyone suggest some way to get the Find panel 
buttons to be enabled if the first responder is an NSTextView in a 
sheet.


thanx,
ken


At 12:23 PM -0700 3/19/10, kvic...@pobox.com wrote:
if i have an NSTextView in a sheet and open the find panel, the 
buttons remain disabled. however, the find commands from the menu 
work fine. is the find panel not supposed to work if the key window 
is a sheet? or is this a known bug? any suggestions as to how to get 
the buttons to be properly enabled?


this is on built on and for 10.6.2.

thanx,
ken


___

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

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


NSTextStorage insertion point

2010-03-23 Thread Ben
Hi list.

I've got an NSTextView subclass which implements the NSTextStorage delegate 
method -textStorageWillProcessEditing:. In that method I do syntax highlighting 
and also replace certain substrings with text attachments (a bit like Xcode's 
autocomplete placeholders).

The problem is that the insertion point is always moved to the end of the text 
view each time this method is invoked. It seems to happen whenever I modify the 
attributes of the text, not when I modify the text contents.

Storing the insertion point and restoring it at the end of 
-textStorageWillProcessEditing or in -textStorageDidProcessEditing still result 
in the insertion point being moved to the end sometime later. There are other 
threads online with this problem, but they are old and have no solutions.

Does anyone have any suggestions on how to avoid or work around this problem?

- Ben___

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

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


Re: CoreData database sharing and migration

2010-03-23 Thread Ben Trumbull

On Mar 22, 2010, at 4:06 AM, Steve Steinitz wrote:

> On 18/3/10, Ben Trumbull wrote:
> 
>> there wasn't a good solution for multiple machines simultaneously
>> accessing an SQLite db file (or most other incrementally updated
>> binary file formats).  By "good" I mean a solution that worked
>> reliably and didn't make other more important things work less well.
> 
> I'm curious about the reliability issues you saw.  Also, by less well do you 
> mean slower?

Because the different NFS clients have file caches with differing amounts of 
staleness, and the SQLite db is updated incrementally, it's possible for an NFS 
client to think it has the latest blocks, and then derive material from one and 
write it into another (it is after all a b-tree).  The written blocks have 
implicit dependencies on all the other active blocks in the database, so having 
stale data is bad.

>> For nearly all Mac OS X customers (sadly not you) achieving a near
>> 100x performance boost when accessing database files on an AFP or SMB
>> mount (like their home directory in educational deployments) is pretty
>> huge.
> 
> I agree.  But wouldn't those same educational institutions be prime 
> candidates for multiple machine access?

No.  The restriction is multiple physical machines using the same database 
files simultaneously (open).  While AFP will allow multiple logins to the same 
account when configured with an advanced setting, in general, AFP servers 
actually prevent users from multiple simultaneous logins to the same account.

>> To address both sets of problems on all network FS, we enforce a
>> single exclusive lock on the server for the duration the application
>> has the database open.  Closing the database connection (or logging
>> out) allows another machine to take its turn.
> 
> Could my application close the database connection and re-open it to work 
> around the problem?  How would I do that?  I suppose once I got it going I'd 
> have to retry saves, fetches etc.

In theory, one could, but in practice that won't be very manageable without 
architectural changes.  Something along the lines of open the remote 
connection, pull down interesting data and save it to a local file, and close 
the remote connection.  Given your current deployment set up provides adequate 
performance, and all you need is a bug fix, I'm not sure this would be very 
helpful.

>> You'll get the 10.5 performance characteristics, however.
> 
> Again, the 10.5 performance over gigabit ethernet is almost unbelievably 
> fast.  I may know why.  Despite your helpful explanations I'm still not 
> exactly clear on the relationship between caching and locking, but I wonder 
> if the speed we are seeing is helped by the fact that the entire database 
> fits into the Synology NAS's 128meg cache?

That probably doesn't hurt.

> In another message in this thread, you made a tantalizing statement:
> 
>> Each machine can have its own database and they can share their results
>> with NSDistributedNotification or some other IPC/networking protocol. You 
>> can hook into the NSManagedObjectContextDidSaveNotification to track
>> when one of the peers has committed changes locally.
> 
> Let me guess how that would work: before saving, the peer would create a 
> notification containing the inserted, updated and deleted objects as recorded 
> in the MOC.  The receiving machine would attempt to make those changes on its 
> own database.  Some questions:
> 
>Would that really be feasible?

yes, but as you observe, it's more tractable for simple data records than 
complex graphs with common merge conflicts

>Would it be a problem that each machine would have having different 
> primary keys?

yes

>How would the receiving machine identify the local objects that changed 
> remotely?

typically this is done with a UUID & a fetch.  Since each database on each 
client is different, the stores themselves have different UUIDs, and any 
encoded NSManagedObjectID URI will note which store the objectID came from, so 
you could also map them the objectID URIs to the local value directly.

>Could relationships (indeed the object graph itself) feasibly be 
> maintained?

yes.  Updates to to-many relationships require the use of a (additions, 
subtractions) pair instead of simply setting the new contents.

>How would relationships between the remote objects be identified?  
> Hand-parsing?

Either by UUID or objectID URI.

>Has anyone done it that you know of?

yes.  I'm aware of 4 solutions, however, I would only recommend 1 as 
appropriate for the general (skill, time, pain threshold) and it avoids complex 
relationship graphs.  Basic data record replication over DO.

>Is there sample code?


no.  The only real trick in converting the didSave notification into something 
appropriate for DO to consume is to copy it and replace the NSManagedObjects 
with a dictionary that has a UUID instead of an object ID, the attribute 
values, and the relationship 

Remove/Disable NSPredicate from NSMutableSet?

2010-03-23 Thread Robert Monaghan
Hi Everyone,

How does one remove a NSPredicate from an NSMutableSet?
I want to reuse the NSMutableSet for another purpose, but I have to strip out 
the Predicate that I assigned.
Passing "filterUsingPredicate:nil" causes an exception. Is there a way to do 
this? Or should I generate another NSMutableSet?

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

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


Re: Remove/Disable NSPredicate from NSMutableSet?

2010-03-23 Thread Dave DeLong
filterUsingPredicate: modifies the container in place.  Unless you created a 
copy of the set/array before filtering, you can't go back to how it was before. 
 Cocoa doesn't have versioned collections.

Dave

On Mar 23, 2010, at 2:27 PM, Robert Monaghan wrote:

> How does one remove a NSPredicate from an NSMutableSet?
> I want to reuse the NSMutableSet for another purpose, but I have to strip out 
> the Predicate that I assigned.
> Passing "filterUsingPredicate:nil" causes an exception. Is there a way to do 
> this? Or should I generate another NSMutableSet?


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

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

ANN: Accessorizer 1.7 update includes delegate detection, sets @property attribute to assign

2010-03-23 Thread Kevin Callahan

ANNOUNCEMENT:

Accessorizer 1.7
http://www.kevincallahan.org/software/accessorizer.html

What's new in version V 1.7

• Added switch for "Assign delegates".  When ON,  Accessorizer will 
automatically select the assign property attribute
   and if overriding via @dynamic (or creating your own getter/setter) and 
generating explicit accessors, 
  Accessorizer will choose the simple return delegate in the getter and assign 
delegate in the setter.  

• Added new Service for generating stubs from method prototype declarations

• Added keyed-archiving support for the following types: 

CGPoint 
CGSize 
CGRect 
CGFloat
CGAffineTransform 
UIEdgeInsets 

• Changed algorithm for detecting IBOutlets for NSView classes

• Fixed issue when Detect IBOutlet is ON and certain TYPES are passed in such 
as NSURLConnection

NEW QuickStart Guide: 
http://www.kevincallahan.org/AccessorizerDocuments/Accessorizer-QuickStartGuide.pdf

Videos and Tutorials:
http://www.kevincallahan.org/software/accessorizerVideos.html___

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

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


Standard input/output in Objective-C

2010-03-23 Thread Mikael Wämundson
First: Yes, I've been looking around on the net to find an answer ;)

I really like the C++ method of using cin/cout in the iostream.h when 
communicating via the standard input/output (i.e. the Terminal). 

When doing this in Objective-C it gets, to me, very complicated. Seems I'm 
going wrong some way.

My first attempt is of course to just use the cin/cout methods by importing 
iostream.h, but when looking for the header file I find it deeply buried 
(/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/stream)
 and I don't succeed in importing it.
My conclusion from this is: I'm not supposed to use cin/cout in an Objective-C 
application???

Second attempt is to use Objective-C methods like:

NSFileHandle *fileHandle = [NSFileHandle fileHandleWithStandardInput];
NSData *inputData;
NSString *inputString;

Person *aPerson = [[Person alloc] init];

printf("Type the persons first name: ");
inputData = [fileHandle availableData];
inputString = [[NSString alloc] initWithData: inputData 
encoding:NSUTF8StringEncoding];
[aPerson setPersonsFirstName: inputString];

 Feels complicated. My conclusion: I'm making it more complicated than it 
should be???

Happy for feedback!

/Mikael___

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

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


Re: Standard input/output in Objective-C

2010-03-23 Thread Brian Postow

On Mar 23, 2010, at 5:44 PM, Mikael Wämundson wrote:

> First: Yes, I've been looking around on the net to find an answer ;)
> 
> I really like the C++ method of using cin/cout in the iostream.h when 
> communicating via the standard input/output (i.e. the Terminal). 
> 
> When doing this in Objective-C it gets, to me, very complicated. Seems I'm 
> going wrong some way.
> 
> My first attempt is of course to just use the cin/cout methods by importing 
> iostream.h, but when looking for the header file I find it deeply buried 
> (/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/stream)
>  and I don't succeed in importing it.
> My conclusion from this is: I'm not supposed to use cin/cout in an 
> Objective-C application???


Did you try using an objective-C++ program? in Xcode, if you make all of your 
.m files into .mm files, it should automatically compile as objective-c++ and 
then cin and cout may work...

Also, you shouldn't need to do more than

#include  
like normal... the compiler should know where to find it.


Brian Postow
Senior Software Engineer
Acordex Imaging Systems

___

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

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


Re: Standard input/output in Objective-C

2010-03-23 Thread Nick Zitzmann

On Mar 23, 2010, at 3:44 PM, Mikael Wämundson wrote:

> My first attempt is of course to just use the cin/cout methods by importing 
> iostream.h, but when looking for the header file I find it deeply buried 
> (/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/stream)
>  and I don't succeed in importing it.
> My conclusion from this is: I'm not supposed to use cin/cout in an 
> Objective-C application???

Wrong. You can use C++ in ObjC++ source. The header you are looking for is 
 and it is part of the standard set of headers installed somewhere in 
/usr/include. Ignore the headers in the kernel framework unless you're making a 
kernel extension, because the kernel framework is only to be used for making 
kernel extensions. Kernel extensions use a stripped-down version of C++.

To turn an ObjC source file into an ObjC++ source file, change its extension 
from .m to .mm.

> Feels complicated. My conclusion: I'm making it more complicated than it 
> should be???

If you feel more comfortable using stdout/stdin or cout/cin, then go ahead and 
use them instead.

Nick Zitzmann


___

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

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


Re: Standard input/output in Objective-C

2010-03-23 Thread Mikael Wämundson
Thnx!

Just changing the suffix to .mm and rebuilding worked and the library was 
found! Great!

/Mikael

23 mar 2010 kl. 22.56 skrev Brian Postow:

> 
> On Mar 23, 2010, at 5:44 PM, Mikael Wämundson wrote:
> 
>> First: Yes, I've been looking around on the net to find an answer ;)
>> 
>> I really like the C++ method of using cin/cout in the iostream.h when 
>> communicating via the standard input/output (i.e. the Terminal). 
>> 
>> When doing this in Objective-C it gets, to me, very complicated. Seems I'm 
>> going wrong some way.
>> 
>> My first attempt is of course to just use the cin/cout methods by importing 
>> iostream.h, but when looking for the header file I find it deeply buried 
>> (/Developer/SDKs/MacOSX10.6.sdk/System/Library/Frameworks/Kernel.framework/Versions/A/Headers/IOKit/stream)
>>  and I don't succeed in importing it.
>> My conclusion from this is: I'm not supposed to use cin/cout in an 
>> Objective-C application???
> 
> 
> Did you try using an objective-C++ program? in Xcode, if you make all of your 
> .m files into .mm files, it should automatically compile as objective-c++ and 
> then cin and cout may work...
> 
> Also, you shouldn't need to do more than
> 
> #include  
> like normal... the compiler should know where to find it.
> 
> 
> Brian Postow
> Senior Software Engineer
> Acordex Imaging Systems
> 
> 

___

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

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


Re: Standard input/output in Objective-C

2010-03-23 Thread Jens Alfke


On Mar 23, 2010, at 2:44 PM, Mikael Wämundson wrote:


inputData = [fileHandle availableData];
inputString = [[NSString alloc] initWithData: inputData  
encoding:NSUTF8StringEncoding];

[aPerson setPersonsFirstName: inputString];


You could just call fgets and then convert the resulting C string to  
an NSString.


I think the reason there isn't anything "Cocoa-like" for this is that  
hardly anyone uses Objective-C to write interactive console tools.


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

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


Re: Which iPhone Program?

2010-03-23 Thread Don Quixote de la Mancha
Luther,

On Tue, Mar 23, 2010 at 11:25 AM, Luther Baker  wrote:
> I have the "company" license and can create multiple developer seats.

> On the other hand, the company license allows a team of developers to create
> certs, etc and deploy apps to the app store. With my company license, I can
> login and add developers to my team and they, in turn, can login and have
> certain things they can do on that team site.
>
> My apologies if that is not what you were asking and if indeed, I have
> misspoke.

That is precisely what I wanted to know.  So thank you - I'll get my
Company application submitted today.

I'm going to file a Radar bug asking that Apple make it more explicit
about what each iPhone Program type includes.

Don Quixote
-- 
Don Quixote de la Mancha
quix...@dulcineatech.com
http://www.dulcineatech.com

   Dulcinea Technologies Corporation: Software of Elegance and Beauty.
___

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

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


How to eliminate field editor from NSTextField?

2010-03-23 Thread Tron Thomas
I have an NSTextField control that will display a context menu when someone 
right clicks on it.  The context menu contains an item that can allow for 
editing of the control's text.  The expectation is that once the edit if 
complete the control will revert to its default behavior in terms of displaying 
its own context menu.

However, this desired behavior after the edit has completed is not achieved 
because, when editing of the control begins, a field editor is assigned to the 
control and the editing takes place in that field editor.  Once editing is 
complete, the field editor remains sitting on top of the control and any right 
clicks from the mouse are now set to the field editor which displays its own 
context menu for editing text rather than the context menu for the NSTextField.

Methods related to changing the first responder for the window are ineffective 
because they do not change the location of the field editor.

What can be done to eliminate the field editor when text editing has completed 
so the NSTextField can revert to its normal behavior until further editing is 
required?

___

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

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


Re: Screen size in Dual monitor mode

2010-03-23 Thread Graham Cox

On 24/03/2010, at 2:07 AM, Shawn Erickson wrote:

> As a result a union of all frames may be misleading/meaningless
> because of large gaps where no monitor exists simply because of how
> the user arranged the monitors.


While the user can arrange them more or less as they wish, there won't be gaps 
in that all the rectangles have to touch somewhere (though touching at a corner 
is permitted and leaves a large gap in a different sense). The union will give 
you the 'extent' of the available monitor area though not necessarily of course 
were there are actual displayable pixels.

The OP needs to clarify what he wants to do - it certainly seems dangerous to 
talk about 'dual monitor mode' when there's no such thing and trying to treat 
multiple monitors as a single one.

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

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


Re: Remove/Disable NSPredicate from NSMutableSet?

2010-03-23 Thread Graham Cox

On 24/03/2010, at 7:27 AM, Robert Monaghan wrote:

> How does one remove a NSPredicate from an NSMutableSet?
> I want to reuse the NSMutableSet for another purpose, but I have to strip out 
> the Predicate that I assigned.
> Passing "filterUsingPredicate:nil" causes an exception. Is there a way to do 
> this? Or should I generate another NSMutableSet?


I think you're labouring under a misapprehension.

NSMutableSet doesn't 'have a' predicate. You can apply a predicate to a set 
(mutable or not) to return a new set whose members match the predicate. Once 
done, the set is a set - it has no memory of the predicate that was used to 
create it, nor the original unfiltered set.

So you can re-use the set if you want, but it's usually cleaner and easier just 
to create a new set for a new purpose.

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

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


Re: How to eliminate field editor from NSTextField?

2010-03-23 Thread Kyle Sluder
On Tue, Mar 23, 2010 at 4:17 PM, Tron Thomas  wrote:
> However, this desired behavior after the edit has completed is not achieved 
> because, when editing of the control begins, a field editor is assigned to 
> the control and the editing takes place in that field editor.  Once editing 
> is complete, the field editor remains sitting on top of the control and any 
> right clicks from the mouse are now set to the field editor which displays 
> its own context menu for editing text rather than the context menu for the 
> NSTextField.

That's because you never end editing.

> Methods related to changing the first responder for the window are 
> ineffective because they do not change the location of the field editor.

You end editing by sending the window -makeFirstResponder: with itself
as an argument. For example: [theWindow setFirstResponder:theWindow].
This might fail if the field editor's value is invalid (for example,
you have bound the text field to a key-value validated property, or
you have attached a formatter to the field).

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

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


Re: NSTextStorage insertion point

2010-03-23 Thread Gideon King
I had this problem too, and in the end, I found a solution which was to make 
sure I had completed my updates of the text, and in my 
textStorageDidProcessEditing: method, I add the following:

[[NSRunLoop currentRunLoop] performSelector:@selector(updateSelectedRange:) 
target:self.editingView 
argument:NSStringFromRange(NSMakeRange(ts.newCaratLocation, 0)) order:0 
modes:[NSArray arrayWithObject:NSDefaultRunLoopMode]];

Where I have this method on the view:

- (void)updateSelectedRange:(NSString *)rangeString {
[self setSelectedRange:NSRangeFromString(rangeString)];
}

I found that I had to do it this way because calling it directly from the 
textStorageDidProcessEditing: method didn't work, and performWith...afterDelay 
didn't move the cursor to where you wanted it when you were typing fast. I also 
found that I needed to get it to update its typing attributes based on the new 
selection.

Hope this helps.

Regards

Gideon

On 24/03/2010, at 6:04 AM, Ben wrote:

> Hi list.
> 
> I've got an NSTextView subclass which implements the NSTextStorage delegate 
> method -textStorageWillProcessEditing:. In that method I do syntax 
> highlighting and also replace certain substrings with text attachments (a bit 
> like Xcode's autocomplete placeholders).
> 
> The problem is that the insertion point is always moved to the end of the 
> text view each time this method is invoked. It seems to happen whenever I 
> modify the attributes of the text, not when I modify the text contents.
> 
> Storing the insertion point and restoring it at the end of 
> -textStorageWillProcessEditing or in -textStorageDidProcessEditing still 
> result in the insertion point being moved to the end sometime later. There 
> are other threads online with this problem, but they are old and have no 
> solutions.
> 
> Does anyone have any suggestions on how to avoid or work around this problem?
> 

___

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

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


Re: How to eliminate field editor from NSTextField?

2010-03-23 Thread Tron Thomas
I tried that, and it did not work.  The field editor remains sitting on top of 
the NSTextField.

On Mar 23, 2010, at 16:39 o'clock, Kyle Sluder wrote:

> On Tue, Mar 23, 2010 at 4:17 PM, Tron Thomas  wrote:
>> However, this desired behavior after the edit has completed is not achieved 
>> because, when editing of the control begins, a field editor is assigned to 
>> the control and the editing takes place in that field editor.  Once editing 
>> is complete, the field editor remains sitting on top of the control and any 
>> right clicks from the mouse are now set to the field editor which displays 
>> its own context menu for editing text rather than the context menu for the 
>> NSTextField.
> 
> That's because you never end editing.
> 
>> Methods related to changing the first responder for the window are 
>> ineffective because they do not change the location of the field editor.
> 
> You end editing by sending the window -makeFirstResponder: with itself
> as an argument. For example: [theWindow setFirstResponder:theWindow].
> This might fail if the field editor's value is invalid (for example,
> you have bound the text field to a key-value validated property, or
> you have attached a formatter to the field).
> 
> --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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: How to eliminate field editor from NSTextField?

2010-03-23 Thread Kyle Sluder
On Tue, Mar 23, 2010 at 4:52 PM, Tron Thomas  wrote:
> I tried that, and it did not work.  The field editor remains sitting on top 
> of the NSTextField.

As I said, there are reasons views might refuse to resign first
responder (in which case -makeFirstResponder: returns NO). Have you
checked the conditions I've mentioned?

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

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


re-ordering the layers of NSView's subviews

2010-03-23 Thread Dave Carpeneto

Hi all - I've got the following situation:

* A 'parent' NSView, which in turn has a number of subviews

* These subviews have been added via the [NSView addSubview:newView 
positioned:NSWindowAbove relativeTo:nil] method (so each time a user 
adds a subview it's @ the top of the viewing list)


* The subviews are not opaque, have layers, and sometimes overlap

My issue: when the user clicks on a subview I'd like that subview to 
become the 'top' subview, but I cannot see how this is possible (apart 
from deleting & re-adding the subview to the parent). Any ideas on how I 
can do this ?


FWIW, what I'm wanting is similar to overlapping icons in a finder 
window (click an exposed corner of an icon that covered by another icon 
& the icon clicked is magically brought to the top of the list).


Any insight appreciated. Thanks all - 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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: re-ordering the layers of NSView's subviews

2010-03-23 Thread Graham Cox

On 24/03/2010, at 11:30 AM, Dave Carpeneto wrote:

> Hi all - I've got the following situation:
> 
> * A 'parent' NSView, which in turn has a number of subviews
> 
> * These subviews have been added via the [NSView addSubview:newView 
> positioned:NSWindowAbove relativeTo:nil] method (so each time a user adds a 
> subview it's @ the top of the viewing list)
> 
> * The subviews are not opaque, have layers, and sometimes overlap
> 
> My issue: when the user clicks on a subview I'd like that subview to become 
> the 'top' subview, but I cannot see how this is possible (apart from deleting 
> & re-adding the subview to the parent). Any ideas on how I can do this ?
> 
> FWIW, what I'm wanting is similar to overlapping icons in a finder window 
> (click an exposed corner of an icon that covered by another icon & the icon 
> clicked is magically brought to the top of the list).


This NSView method may help:

- (void)sortSubviewsUsingFunction:(NSComparisonResult (*)(id, id, void 
*))compare context:(void *)context


BUT BUT BUT BUT BUT...

Using views for what you're doing is not going to scale. Views are too 
heavyweight and you'll rapidly hit performance issues. In addition, views are 
not really designed for the task at hand here, and there is only limited 
support for overlapping sibling views.

You should probably look to just using CALayers or rolling your own lightweight 
object that exists within a single view.

There are also ready-made 3rd party view subclasses out there that might do 
what you want if you need something like a Finder-like icon view.

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

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


Trouble forking my project

2010-03-23 Thread Graham Cox
I'm having a problem making settings in a new target apply in my code. I'm sure 
this is really simple and I'm missing something obvious.

The point is to permit me to release bugfixes to my existing codebase while 
moving it forward in a more radical way for future versions. I duplicated my 
existing main target and added a user-defined setting to the new target which 
value is simply 'YES'. In some parts of my code I conditionalise based on 
#ifdef this new setting.

The problem I'm having is that the condition is never true - it compiles as if 
the setting isn't defined. I did a clean build and new target settings such as 
the product name are correctly honoured. Why can't my code "see" my added 
define?

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

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


Re: re-ordering the layers of NSView's subviews

2010-03-23 Thread Dave Carpeneto

Graham Cox wrote:

On 24/03/2010, at 11:30 AM, Dave Carpeneto wrote:

  

Hi all - I've got the following situation:

* A 'parent' NSView, which in turn has a number of subviews

* These subviews have been added via the [NSView addSubview:newView 
positioned:NSWindowAbove relativeTo:nil] method (so each time a user adds a 
subview it's @ the top of the viewing list)

* The subviews are not opaque, have layers, and sometimes overlap

My issue: when the user clicks on a subview I'd like that subview to become the 
'top' subview, but I cannot see how this is possible (apart from deleting & 
re-adding the subview to the parent). Any ideas on how I can do this ?

FWIW, what I'm wanting is similar to overlapping icons in a finder window (click an 
exposed corner of an icon that covered by another icon & the icon clicked is 
magically brought to the top of the list).




This NSView method may help:

- (void)sortSubviewsUsingFunction:(NSComparisonResult (*)(id, id, void 
*))compare context:(void *)context
  
DAC> Thank you :-) !  Did not realize that the 'positioned' attribute 
was simply a way to manipulate the order of the entries in the subviews 
NSArray. This looks to be cool.


BUT BUT BUT BUT BUT...

Using views for what you're doing is not going to scale. Views are too 
heavyweight and you'll rapidly hit performance issues. In addition, views are 
not really designed for the task at hand here, and there is only limited 
support for overlapping sibling views.
  
DAC> Yeah, from what I can see everyone is recommending I do something 
other than what I'm doing (it kinda looks like a lot of stuff regarding 
overlapping subviews may be unsupported), however @ this point I haven't 
seen any perf issues, and everything works fine (of course now that I've 
said this 10.6.3 is gonna break everything I'm working on ;-) )

You should probably look to just using CALayers or rolling your own lightweight 
object that exists within a single view.

There are also ready-made 3rd party view subclasses out there that might do 
what you want if you need something like a Finder-like icon view.

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

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


Appropriate list for GameKit questions?

2010-03-23 Thread Michael Rogers
I'm having a few questions about GameKit -- is this an appropriate list for the 
subject?  [There's nothing on lists.apple.com that specifically addresses this 
...]

Michael
--
Dr. Michael Rogers
Angel Flight Pilot & Damfino
Assistant Professor, Computer Science & Information Systems
Northwest Missouri State University
Cell:  309-825-6454;  Work:  660-562-1551;  IM:  mprog...@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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Appropriate list for GameKit questions?

2010-03-23 Thread Fritz Anderson
On 23 Mar 2010, at 8:13 PM, Michael Rogers wrote:

> I'm having a few questions about GameKit -- is this an appropriate list for 
> the subject?  [There's nothing on lists.apple.com that specifically addresses 
> this ...]

The best forum — if you're willing to sign up as an iPhone developer — is 
Apple's developer forums. iPhone > Application Frameworks > Peer to Peer 
Connectivity.

— F

___

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

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


Re: Appropriate list for GameKit questions?

2010-03-23 Thread Roland King

Fritz Anderson wrote:

On 23 Mar 2010, at 8:13 PM, Michael Rogers wrote:



I'm having a few questions about GameKit -- is this an appropriate list for the 
subject?  [There's nothing on lists.apple.com that specifically addresses this 
...]



The best forum — if you're willing to sign up as an iPhone developer — is Apple's 
developer forums. iPhone > Application Frameworks > Peer to Peer Connectivity.

— F



Depends a bit on the question .. GameKit questions are cocoa questions, 
you may not find many people who've used it here. I find the apple dev 
forums .. a bit hit and miss, mostly miss.

___

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

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


Re: Trouble forking my project

2010-03-23 Thread Greg Parker
On Mar 23, 2010, at 5:48 PM, Graham Cox wrote:
> I'm having a problem making settings in a new target apply in my code. I'm 
> sure this is really simple and I'm missing something obvious.
> 
> The point is to permit me to release bugfixes to my existing codebase while 
> moving it forward in a more radical way for future versions. I duplicated my 
> existing main target and added a user-defined setting to the new target which 
> value is simply 'YES'. In some parts of my code I conditionalise based on 
> #ifdef this new setting.
> 
> The problem I'm having is that the condition is never true - it compiles as 
> if the setting isn't defined. I did a clean build and new target settings 
> such as the product name are correctly honoured. Why can't my code "see" my 
> added define?

In Xcode, you don't want a "User-Defined Setting". Try manipulating the 
"Preprocessor Macros" setting instead.


-- 
Greg Parker gpar...@apple.com Runtime Wrangler


___

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

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


Re: Trouble forking my project

2010-03-23 Thread Fritz Anderson
On 23 Mar 2010, at 7:48 PM, Graham Cox wrote:

> I'm having a problem making settings in a new target apply in my code. I'm 
> sure this is really simple and I'm missing something obvious.
> 
> The point is to permit me to release bugfixes to my existing codebase while 
> moving it forward in a more radical way for future versions. I duplicated my 
> existing main target and added a user-defined setting to the new target which 
> value is simply 'YES'. In some parts of my code I conditionalise based on 
> #ifdef this new setting.
> 
> The problem I'm having is that the condition is never true - it compiles as 
> if the setting isn't defined. I did a clean build and new target settings 
> such as the product name are correctly honoured. Why can't my code "see" my 
> added define?

By "user-defined setting," do you mean you added a build variable of your own? 
Xcode wouldn't know to translate that into a compiler directive; build 
variables have a life (sometimes) as environment variables for the build tools, 
and to direct how Xcode sets compiler switches. They aren't compiler switches 
(still less preprocessor macros) themselves.

Or are you using the settings labeled /Preprocessor Macros( Not Used In 
Precompiled Headers)?/? Those would get into your compilations to be testable 
with #ifdef. In that case, take your question to xcode-users and post a sample 
compiler invocation from your build transcript.

— F

___

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

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


Re: How to hide new objects in a NSTableView?

2010-03-23 Thread Jerry Krinock

On 2010 Mar 23, at 12:13, Joanna Carter wrote:

> So, I am now left thinking the only way around this is to insert an editing 
> object in a secondary MOC, then, upon saving, insert a second object in the 
> main MOC, copy the properties over from the editing object to the object in 
> the main MOC, before rolling back the inserted object in the secondary MOC.
> 
> Wow!!! that is a whole load of hassle.

I believe this is the standard approach, and with dictionaryWithValuesForKeys:, 
it's not too bad.  This thread has some advice from Mr. Trumbull on the topic --

http://www.cocoabuilder.com/archive/cocoa/225972-copying-managed-objects-from-app-to-doc-mocontext.html

___

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

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


Toolbar customizer crashes on Leopard when using menu delegate

2010-03-23 Thread Markus Spoettl
Hello,

  I've been running into a strange crash for a toolbar customizer that happens 
only on Leopard and works fine on Snow Leopard. 

My toolbar contains an item hosting a NSPopUpButton which has a menu. That menu 
contains regular items and a sub-menu which has its delegate assigned to the 
File's Owner because it's dynamic and needs to be rebuilt each time it is 
displayed. I have found out that the mere fact the delegate is set causes a 
crash when the toolbar customizer is created (through "Customize Toolbar…"). 

Ultimately the whole thing goes down badly inside AppKit (I'm pasting the stack 
below if someone wants to take a look at it). In the process of digging into 
this issue I also found that setting the delegate causes the entire nib to be 
loaded again - probably to resolve the delegate, kind of recursive. 

Well, I just thought this would be interesting for the list, since it's working 
completely fine on Snow Leopard but not on Leopard (Deployment Target of this 
project is 10.5). Unless of course this was foreseeable in which case I'd like 
to hear about it.

Regards
Markus


Thread 0 Crashed:
0   libobjc.A.dylib 0x9173e699 objc_msgSend + 41
1   com.apple.AppKit0x947cb9fa -[NSMenu encodeWithCoder:] + 
444
2   com.apple.Foundation0x9526138d _encodeObject + 621
3   com.apple.AppKit0x947cd08f -[NSMenuItem 
encodeWithCoder:] + 1563
4   com.apple.Foundation0x9526138d _encodeObject + 621
5   com.apple.Foundation0x952d1bdd -[NSKeyedArchiver 
_encodeArrayOfObjects:forKey:] + 541
6   com.apple.Foundation0x952815a7 -[NSArray(NSArray) 
encodeWithCoder:] + 615
7   com.apple.Foundation0x9526138d _encodeObject + 621
8   com.apple.AppKit0x947cb916 -[NSMenu encodeWithCoder:] + 
216
9   com.apple.Foundation0x9526138d _encodeObject + 621
10  com.apple.AppKit0x9481e547 -[NSPopUpButtonCell 
encodeWithCoder:] + 269
11  com.apple.Foundation0x9526138d _encodeObject + 621
12  com.apple.AppKit0x94503809 -[NSControl 
encodeWithCoder:] + 349
13  com.apple.Foundation0x9526138d _encodeObject + 621
14  com.apple.Foundation0x95260b08 +[NSKeyedArchiver 
archivedDataWithRootObject:] + 184
15  com.apple.AppKit0x948f91b9 -[NSToolbarItem 
_copyOfCustomView] + 47
16  com.apple.AppKit0x948f9278 -[NSToolbarItem 
copyWithZone:] + 141
17  com.apple.CoreFoundation0x934e2f9a -[NSObject copy] + 42
18  com.apple.AppKit0x9449585a -[NSToolbar 
_newItemFromItemIdentifier:requireImmediateLoad:willBeInsertedIntoToolbar:] + 
306
19  com.apple.AppKit0x94495649 -[NSToolbar 
_insertNewItemWithItemIdentifier:atIndex:notifyDelegate:notifyView:notifyFamilyAndUpdateDefaults:]
 + 86
20  com.apple.AppKit0x944ee904 -[NSToolbar 
_appendNewItemWithItemIdentifier:notifyDelegate:notifyView:notifyFamilyAndUpdateDefaults:]
 + 104
21  com.apple.AppKit0x94497227 -[NSToolbar 
_setCurrentItemsToItemIdentifiers:notifyDelegate:notifyView:notifyFamilyAndUpdateDefaults:]
 + 336
22  com.apple.AppKit0x948f18eb -[NSToolbar 
_loadInitialItemIdentifiers:requireImmediateLoad:] + 138
23  com.apple.AppKit0x948f7e93 -[NSToolbarConfigPanel 
_loadDefaultSetImageRep] + 861
24  com.apple.AppKit0x948f6d6b -[NSToolbarConfigPanel 
_loadData] + 500
25  com.apple.AppKit0x948f674d -[NSToolbarConfigPanel 
initForToolbar:withWidth:] + 269
26  com.apple.AppKit0x948f1e45 -[NSToolbar 
_runCustomizationPanel] + 214
27  com.apple.AppKit0x943d7e8f -[NSApplication 
sendAction:to:from:] + 112
28  com.apple.AppKit0x94486b64 -[NSMenu 
performActionForItemAtIndex:] + 493
29  com.apple.AppKit0x94486869 -[NSCarbonMenuImpl 
performActionWithHighlightingForItemAtIndex:] + 220
30  com.apple.AppKit0x944634ba AppKitMenuEventHandler + 6608
31  com.apple.HIToolbox 0x93e0813d 
DispatchEventToHandlers(EventTargetRec*, OpaqueEventRef*, HandlerCallRec*) + 
1181
32  com.apple.HIToolbox 0x93e0757b 
SendEventToEventTargetInternal(OpaqueEventRef*, OpaqueEventTargetRef*, 
HandlerCallRec*) + 405
33  com.apple.HIToolbox 0x93e23ecc SendEventToEventTarget + 52
34  com.apple.HIToolbox 0x93e581e7 SendHICommandEvent(unsigned 
long, HICommand const*, unsigned long, unsigned long, unsigned char, 
OpaqueEventTargetRef*, OpaqueEventTargetRef*, OpaqueEventRef**) + 411
35  com.apple.HIToolbox 0x93e7e959 
SendMenuCommandWithContextAndModifiers + 59
36  com.apple.HIToolbox 0x93e7e914 SendMenuItemSelectedEvent + 
134
37  com.apple.HIToolbox 0x93e7e82a

Re: Trouble forking my project

2010-03-23 Thread Graham Cox

On 24/03/2010, at 12:43 PM, Greg Parker wrote:

> In Xcode, you don't want a "User-Defined Setting". Try manipulating the 
> "Preprocessor Macros" setting instead.


Ah, thank-you, that works no problem.


On a related note, is there a simple way to conditionalise parts of nibs? 
Specifically, I have additional menu items in MainMenu.xib that apply only to 
the forked build and should be removed from the maintenance builds. Having 
separate complete nibs is one way, but for just a menu item or two doubles the 
maintenance overhead during the crossover period from the current codebase to 
the more radical one.

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

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


NSTreeController, NSBrowser image setting

2010-03-23 Thread Tony Romano
I'm using a NSTreeController and bindings to contain the data for a NSBrowser.  
Data from my objects is being displayed fine.  I want to add an image to the 
entries in the browser.  From what I gather, I need to implement the 
willDisplayCell delegate method.  The question I have is how do I get MY object 
stored for the node being displayed. The documents state you cannot use the 
itemAt* methods if you did not use a data source, which I didn't.  I did find 
on the Internet someone else who had a similar problem and the solution they 
found was call this method [item representedObject].  It's not clear what the 
receiver 'item' is.  In addition, neither samples ComplexBrowser nor 
SimpleBrowser use a treecontroller.  Note I am not using core data, my object 
is my own structure.

Thanks in advance for the help,
-Tony




___

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

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


Re: NSTreeController, NSBrowser image setting

2010-03-23 Thread Ken Thomases
On Mar 23, 2010, at 9:22 PM, Tony Romano wrote:

> I'm using a NSTreeController and bindings to contain the data for a 
> NSBrowser.  Data from my objects is being displayed fine.  I want to add an 
> image to the entries in the browser.  From what I gather, I need to implement 
> the willDisplayCell delegate method.  The question I have is how do I get MY 
> object stored for the node being displayed. The documents state you cannot 
> use the itemAt* methods if you did not use a data source, which I didn't.  I 
> did find on the Internet someone else who had a similar problem and the 
> solution they found was call this method [item representedObject].  It's not 
> clear what the receiver 'item' is.

NSTreeController uses its own objects as the items.  In Leopard and later, they 
are NSTreeNode instances.  Prior to that, they were completely opaque objects.

See 
.

Regards,
Ken

___

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

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


performFindPanelAction: in WebView

2010-03-23 Thread Gerriet M. Denkmann
The documentation says about performFindPanelAction: in WebView: "An action 
method that opens the Find menu and Find panel."

In my app though, the only thing it does is beeping (Jump to Selection works, 
all other MenuItems are gray).

The following code:
id d = [ NSApp targetForAction: 
@selector(performFindPanelAction:) ];
NSLog(@"%s targetFor performFindPanelAction: is 
%@",__FUNCTION__,d);

id f = [ theWindow firstResponder ];
for(;;)
{
NSLog(@"%s f %@",__FUNCTION__,f);
if ( f == nil ) break;
f = [ f nextResponder ];
};
results in: 
03  targetFor performFindPanelAction: is 
04  f 
04  f 
05  f 
06  f 
07  f 
07  f 
08  f 
09  f 
11  f 
12  f 
13  f 
13  f (null)

So it seems, that my nib has the right connections.

What am I missing? 
10.6.2


Kind regards,

Gerriet.

___

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

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


Automating Photoshop CS4?

2010-03-23 Thread jyoung79
Just curious if there's any way to automate Adobe Photoshop CS4 with 
Cocoa/Objective-C?  I'm new to this language.  I know I can call NSAppleScript, 
but was just curious if there's another way to control the application?

Thanks.

Jay
___

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

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


Re: Automating Photoshop CS4?

2010-03-23 Thread Jesper Storm Bache
You'll want to use AppleScript.
There are two Adobe forums that you may want to use in addition to this general 
Cocoa forum:
http://forums.adobe.com/community/photoshop/photoshop_scripting
and (if you need to write your own plug-in):
http://forums.adobe.com/community/photoshop/photoshop_sdk

Besides Apple Script, maybe UI automation (via the accessibility interface) is 
a possibility, but (again) I would recommend going with the AppleScript 
solution.

Jesper Storm Bache

On Mar 23, 2010, at 7:10 AM,  wrote:

> Just curious if there's any way to automate Adobe Photoshop CS4 with 
> Cocoa/Objective-C?  I'm new to this language.  I know I can call 
> NSAppleScript, but was just curious if there's another way to control the 
> application?
> 
> Thanks.
> 
> Jay
> ___
> 
> 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:
> http://lists.apple.com/mailman/options/cocoa-dev/jsbache%40adobe.com
> 
> This email sent to jsba...@adobe.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: performFindPanelAction: in WebView

2010-03-23 Thread Jeff Johnson
Hi Gerriet.

You're missing this, unfortunately:

https://trac.webkit.org/browser/trunk/WebKit/mac/WebView/WebHTMLView.mm

https://bugs.webkit.org/show_bug.cgi?id=3640

I think it's a rite of passage in using WebKit to discover this. ;-) Yes, the 
documentation has failed to mention anything for the past 5 years. Those 
responsible have been sacked. Or not.

-Jeff


On Mar 23, 2010, at 10:54 PM, Gerriet M. Denkmann wrote:

> The documentation says about performFindPanelAction: in WebView: "An action 
> method that opens the Find menu and Find panel."
> 
> In my app though, the only thing it does is beeping (Jump to Selection works, 
> all other MenuItems are gray).
> 
> The following code:
>   id d = [ NSApp targetForAction: 
> @selector(performFindPanelAction:) ];
>   NSLog(@"%s targetFor performFindPanelAction: is 
> %@",__FUNCTION__,d);
> 
>   id f = [ theWindow firstResponder ];
>   for(;;)
>   {
>   NSLog(@"%s f %@",__FUNCTION__,f);
>   if ( f == nil ) break;
>   f = [ f nextResponder ];
>   };
> results in: 
> 03  targetFor performFindPanelAction: is 
> 04  f 
> 04  f 
> 05  f 
> 06  f 
> 07  f 
> 07  f 
> 08  f 
> 09  f 
> 11  f 
> 12  f 
> 13  f 
> 13  f (null)
> 
> So it seems, that my nib has the right connections.
> 
> What am I missing? 
> 10.6.2

___

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

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


Re: Automating Photoshop CS4?

2010-03-23 Thread colors
Depending on how ambitious you are

It is conceivable that you could build spidermonkey into your application and 
automate PhotoShop via javascript.  You might even be able to find a way to 
make webkit run the javascript for you.

Rich Collyer

On Mar 23, 2010, at 9:31 PM, Jesper Storm Bache wrote:

> You'll want to use AppleScript.
> There are two Adobe forums that you may want to use in addition to this 
> general Cocoa forum:
>   http://forums.adobe.com/community/photoshop/photoshop_scripting
> and (if you need to write your own plug-in):
>   http://forums.adobe.com/community/photoshop/photoshop_sdk
> 
> Besides Apple Script, maybe UI automation (via the accessibility interface) 
> is a possibility, but (again) I would recommend going with the AppleScript 
> solution.
> 
> Jesper Storm Bache
> 
> On Mar 23, 2010, at 7:10 AM,  wrote:
> 
>> Just curious if there's any way to automate Adobe Photoshop CS4 with 
>> Cocoa/Objective-C?  I'm new to this language.  I know I can call 
>> NSAppleScript, but was just curious if there's another way to control the 
>> application?
>> 
>> Thanks.
>> 
>> Jay
>> ___
>> 
>> 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:
>> http://lists.apple.com/mailman/options/cocoa-dev/jsbache%40adobe.com
>> 
>> This email sent to jsba...@adobe.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:
> http://lists.apple.com/mailman/options/cocoa-dev/iseecolors%40sbcglobal.net
> 
> This email sent to iseecol...@sbcglobal.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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: Trouble forking my project

2010-03-23 Thread Michael Ash
On Tue, Mar 23, 2010 at 8:48 PM, Graham Cox  wrote:
> I'm having a problem making settings in a new target apply in my code. I'm 
> sure this is really simple and I'm missing something obvious.
>
> The point is to permit me to release bugfixes to my existing codebase while 
> moving it forward in a more radical way for future versions. I duplicated my 
> existing main target and added a user-defined setting to the new target which 
> value is simply 'YES'. In some parts of my code I conditionalise based on 
> #ifdef this new setting.
>
> The problem I'm having is that the condition is never true - it compiles as 
> if the setting isn't defined. I did a clean build and new target settings 
> such as the product name are correctly honoured. Why can't my code "see" my 
> added define?

You'll be much, much better off creating a branch in your version
control system to handle the bugfixes, rather than attempting to use
conditional compilation like this.

Mike
___

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

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


Re: Trouble forking my project

2010-03-23 Thread Eli Bach

On Mar 23, 2010, at 6:48 PM, Graham Cox wrote:

> I'm having a problem making settings in a new target apply in my code. I'm 
> sure this is really simple and I'm missing something obvious.
> 
> The point is to permit me to release bugfixes to my existing codebase while 
> moving it forward in a more radical way for future versions. I duplicated my 
> existing main target and added a user-defined setting to the new target which 
> value is simply 'YES'. In some parts of my code I conditionalise based on 
> #ifdef this new setting.
> 
> The problem I'm having is that the condition is never true - it compiles as 
> if the setting isn't defined. I did a clean build and new target settings 
> such as the product name are correctly honoured. Why can't my code "see" my 
> added define?
> 
> --Graham

Graham,

I can only suggest with the utmost conviction that you actually fork the code 
base, [as in, have completely separate 'bug fix' and 'radical change' 
branches].  Either your radical changes will leak into your bug fix version, or 
you won't be able to do some change because it will get too complicated to do 
while maintaining the bug fix version.

And if you don't have your code in a version control system that supports 
branching [and no, CVS does NOT count], you go to your bedroom and think about 
that while I go and make a switch to punish you with.  If you're a one or 
two-man shop, you can use Perforce for free [with free cli and gui tools to go 
with the server], and Subversion has gotten better at tracking/merging 
branches, and the youngun's have a hankerin for git...

Eli

___

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

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