KVO and lazy loading

2008-10-21 Thread Ashley Clark
I'm pretty sure I've got this worked out and it seems to be working,  
BUT I thought that before and when I turned on Auto Arrange Content on  
my NSArrayController's this bug popped up. So I wanted to make sure  
I'm doing this right.



I'm lazily initializing objects that are being read from a database,  
similar to CoreData faulting. In my RMDatabaseObject class I've  
implemented a willAccessValueForKey: method that reads in data from  
the database if necessary. This method is being called at the  
beginning of my willChangeValueForKey: and  
willChangeValueForKey:withSetMutation:usingObjects: methods.


Originally, for every property that was being set through the  
willAccessValue method I was calling the willChange/didChange methods  
and it seemed to work well. At least until I turned on auto-arrange  
content on some array controllers. After that I started getting  
exceptions stating that observer's were being removed more times than  
they had been added on seemingly random key paths.


I finally found a comment by mmalc and seconded by Ronzilla at http://theocacao.com/comment/4423 
 that seems to indicate that one should NEVER post change  
notifications when doing this sort of lazy-loading.


So, after all that, my question is this, is this correct? Or will I  
run up against something else later if I'm not issuing change  
notifications during my initial database row loading?



Ashley
___

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 [EMAIL PROTECTED]


- (id)initWithBundle:(NSBundle *)bundle

2008-10-21 Thread Adam Penny

Hi there,

In a preference pane subclass, should the above method be treated as a  
replacement for the init method used in normal app controllers i.e.  
allocating any other objects that might be needed in the controller?


Thanks,

Adam
___

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 [EMAIL PROTECTED]


[JOB]: Software Engineer

2008-10-21 Thread Michael Paluszek

Software Engineer

The primary task of this job is to support our VisualCommander product http://www.psatellite.com/vc/ 
. Candidate will help our aerospace engineers implement control  
systems, simulations, and displays in VisualCommander for our NASA and  
DoD projects.


Requirements:

Bachelor's degree in Computer Science or equivalent experience.
Experience writing software in C/C++ and with multithreaded systems.

Desirable:

Experience with Objective-C and the Cocoa framework on MacOS X.
Experience with OpenGL.

Candidates must be U.S. citizens or U.S. permanent residents.  
Relocation to Princeton, NJ is not required. We offer a casual work  
environment and excellent opportunities to learn and grow on the job.  
This a full-time positions with benefits.


Send your resumé to Mike Paluszek [EMAIL PROTECTED]

--
Michael Paluszek
Princeton Satellite Systems
33 Witherspoon Street
Princeton, NJ 08542-3207
Phone (609) 279-9606
Fax (609) 279-9607
[EMAIL PROTECTED]
www.psatellite.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 [EMAIL PROTECTED]


Bind an NSRect

2008-10-21 Thread gMail.com
I would like to bind 4 NSTextFields with each of the 4 values of a NSRect
mViewFrame. So when I change a value, my view resizes automatically.
I am already able to bind the 4 float values, one by one, origins and size,
but this way I have to add 4 redundant float values and write 8 methods (4
set and 4 get) in order to go from/to the float values to the NSRect value.
For example:

- (void)setMHeight:(float)value
{
mViewFrame.size.height = mHeight = value;
}

- (float)mHeight
{
return mViewFrame.size.height;
}

I presume that binding should make me save time and glue code, so I think
that there should be a faster way to bind an NSRect and have at least one
method defined as

- (void)setMViewFrame:(NSRect)frame
{
mViewFrame.size.height = frame;
[self setNeedsDisplay:YES];
}

Any Suggestion? If there is a way, what should I set on the IB exactly?

Best Regards
-- 
LL


___

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 [EMAIL PROTECTED]


Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Andy Lee

On Oct 20, 2008, at 5:07 PM, Sean McBride wrote:

In 10.5, NSTableView handles many keypresses automatically: up arrow,
down arrow, page up, page down, home, end, and even 'type select'.

I also need to (robustly!) support the 'delete' key.


I just noticed this (thanks to a reference to Opacity on another  
discussion thread):



For Opacity, I put together a subclass of NSTableView that adds a  
few more features-specifically for handling keyboard presses.  
LTKeyPressTableView adds enter or return to edit a row, delete to  
delete the current row, and hooks to intercept left and right key  
presses.


It's a lightweight subclass that (at a glance) seems to take the same  
approach as you did, but abstracts the behavior into delegate methods.


Thought it might be worth looking at if only to compare notes.

--Andy

___

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 [EMAIL PROTECTED]


Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Dalzhim Dalzhim
Well the concept is pretty simple.  When an instance of NSResponder doesn't
handle a specific event, it is passed up on the responder chain.  Instead of
subclassing NSTableView or NSOutlineView, it is only necessary to insert a
new NSResponder instance in the responder chain, after the table view or the
outline view so that it handles this case.

Inserting a responder in the responder chain is pretty easy.  Once you have
instantiated your responder, simply set it's nextResponder to the
nextResponder of the table view and then set the table view's next responder
to your own responder.  And there you go, it has been inserted in the linked
list.


-Dalzhim


2008/10/20 Corbin Dunn <[EMAIL PROTECTED]>

>
> On Oct 20, 2008, at 2:49 PM, Dalzhim Dalzhim wrote:
>
> This following episode of Late Night Cocoa gives a solution to this precise
> problem of implementing the delete functionality on TableViews and
> OutlineViews without having to subclass it.
>
>
> http://www.mac-developer-network.com/podcasts/latenightcocoa/episode9/index.html
>
> Hope it helps :)
>
>
> Can you elaborate on what the episode recommends? (Sorry, I don't have time
> to listen through the 40 mins).
>
> I recommend subclassing; and, in many ways, that is a fine solution.
>
> Sean:
>
> I assume NSOutlineView is the same?
>
>
> Yes, it is.
>
>
>>
> - so will this actually work with custom keybindings?  Or is there just
>> no good way to support that?
>
>
> I don't think so, since it is hardcoding the key. You might get some
> mileage from calling -interpretKeyEvents: yourself, but it may have side
> effects.
>
>
>> - did I miss a constant for the backward delete char (an analogue to
>> NSDeleteCharacter)?  I'm using 0xf728, discovered via gdb. :(
>>
>>
> NSDeleteFunctionKey
>
> -corbin
>
>
>
> Cheers,
>>
>> --
>> 
>> Sean McBride, B. Eng [EMAIL PROTECTED]
>> Rogue Researchwww.rogue-research.com
>> Mac Software Developer  Montréal, Québec, Canada
>>
>>
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/dalzhim.mlist%40gmail.com
>>
>> This email sent to [EMAIL PROTECTED]
>>
>
>
>
___

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 [EMAIL PROTECTED]


Re: How to draw a Recessed Button Shadow

2008-10-21 Thread Dalzhim Dalzhim
Hello Rob,

I have already tried the methods you mention and they draw the gray opaque
background that I want to get rid of so that I can make the highlight a
different color, as well as drawing the arrow images.  Although the gray
opaque background is the same as when you put the mouse over the filters in
XCode's documentation rather than when a filter is selected.  You'll notice
the rollover style doesn't have any shadow while the selected filter does
have a shadow.  This is the one that I wish to reproduce.

regards


-Dalzhim

2008/10/20 Rob Keniger <[EMAIL PROTECTED]>

>
> On 21/10/2008, at 4:34 AM, Dalzhim Dalzhim wrote:
>
>  I am currently trying to subclass NSPopUpButton while keeping
>> compatibility
>> with Mac OS 10.4 in order to add the possibility of choosing the color of
>> the highlight when the mouse is placed over the button, including gradient
>> fills.  The problem is that neither NSPopUpButton or NSPopUpButtonCell
>> seem
>> to provide public methods to draw the border of the button or the image
>> with
>> the arrows.  Only the title of the button can be drawed using a public
>> method while handling the rest of the drawing in a subclass.
>>
>
>
> NSPopupButtonCell is a subclass of NSMenuItemCell, which is itself a
> subclass of NSButtonCell. This means that it inherits all the methods of
> those classes. Have a look at:
>
> - (void)drawBezelWithFrame:(NSRect)frame inView:(NSView *)controlView
> - (void)drawBorderAndBackgroundWithFrame:(NSRect)cellFrame inView:(NSView
> *)controlView
>
> and friends.
>
> --
> Rob Keniger
>
>
>
> ___
>
> 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/dalzhim.mlist%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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 [EMAIL PROTECTED]


Toolbar buttons and isEnabled binding

2008-10-21 Thread Chris Idou

I seem to be getting erratic behaviour from toolbar button isEnabled bindings. 
In some scenarios they don't seem to work correctly.

I've tried putting the exact same binding criteria on some regular buttons just 
to see what happens, and they seem to work correctly when the toolbar buttons 
don't.

Has anyone else noticed this?





  
___

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 [EMAIL PROTECTED]


Re: Core Data saving / Leopard / The temporary directory at ...

2008-10-21 Thread chaitanya pandit
Well i'm not a core data pro. but here is what i have observed with  
core data. If you create an entity and delete it after saving, the  
deleted entity will be shown in the

"[[[self managedObjectContext] deletedObjects]allObjects]" array.
But if you delete the entity immediately after creation without a save  
in between, it won't get added to the deletedObjects array.
Might have to consider this if you are doing some cleanup using the  
deleted entities.
Also did you try manually removing the child's relation to it's parent  
before delete?

HTH,
Chaitanya

On 21-Oct-08, at 4:56 AM, Jonathan Freeman wrote:


Hello all,

I've got an odd saving issue that one of my beta users just found. I  
can replicate this on 10.5.5, and it's basically one cannot save a  
Core Data document with a specific series of events. I've done the  
google route and found a few other developers seeing this with no  
resolve. Any insight into this would be great and here's the  
following error in the logs:


The temporary directory at "/private/var/folders/HA/HA4yqX 
+JH9mzFyLKrp721TI/TemporaryItems/(A Document Being Saved By  
)" could not be deleted.


This will save and Parent has to many relationship to Child,  
inverse. Child has relationship to Parent, inverse:

1. File New
2. Create Parent entity
3. File Save
3. Create Child entity
4. Create another Child entity
5. Create yet another Child entity
6. File Save
7. Delete a Child entity
8. File Save

This will NOT save:
1. File New
2. Create Parent entity
3. File Save
4. Create Child entity
5. Create another Child entity
6. Create yet another Child entity
7. Delete a Child entity
8. File Save (will not save, throws the error)

I've looked at the Managed Object Context with F-script and do not  
see any orphan relationships or entities. Everything appears to  
behave correctly.


Thanks so much for your time,
Jonathan Freeman



__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.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/chaitanya%40expersis.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: - (id)initWithBundle:(NSBundle *)bundle

2008-10-21 Thread Nick Zitzmann


On Oct 21, 2008, at 3:59 AM, Adam Penny wrote:

In a preference pane subclass, should the above method be treated as  
a replacement for the init method used in normal app controllers  
i.e. allocating any other objects that might be needed in the  
controller?



I think so, even though it doesn't say whether or not it is the  
designated initializer in the documentation...


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 [EMAIL PROTECTED]


Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Corbin Dunn

On Oct 21, 2008, at 6:44 AM, Dalzhim Dalzhim wrote:
Well the concept is pretty simple.  When an instance of NSResponder  
doesn't handle a specific event, it is passed up on the responder  
chain.  Instead of subclassing NSTableView or NSOutlineView, it is  
only necessary to insert a new NSResponder instance in the responder  
chain, after the table view or the outline view so that it handles  
this case.


Inserting a responder in the responder chain is pretty easy.  Once  
you have instantiated your responder, simply set it's nextResponder  
to the nextResponder of the table view and then set the table view's  
next responder to your own responder.  And there you go, it has been  
inserted in the linked list.




Yes -- but I don't know how that is any easier; this approach still  
requires you to subclass. One might as well keep the logic in the same  
place (the table view).


Also, Andy said:

It's a lightweight subclass that (at a glance) seems to take the  
same approach as you did, but abstracts the behavior into delegate  
methods.


I agree; a delegate/datasource abstraction is a good idea, but please,  
don't use the names recommended in that posting  
(ie:deleteSelectionFromTableView:). Instead, make it specific to your  
subclass, ie: myTableView:deleteRows: (etc.). Using the generic  
"tableView" name could conflict with NSTableView delegate methods that  
may get added in a later version of the OS.


thanks!

-corbin


___

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 [EMAIL PROTECTED]


Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Sean McBride
On 10/21/08 9:44 AM, Dalzhim Dalzhim said:

>Well the concept is pretty simple.  When an instance of NSResponder doesn't
>handle a specific event, it is passed up on the responder chain.  Instead of
>subclassing NSTableView or NSOutlineView, it is only necessary to insert a
>new NSResponder instance in the responder chain, after the table view or the
>outline view so that it handles this case.
>
>Inserting a responder in the responder chain is pretty easy.  Once you have
>instantiated your responder, simply set it's nextResponder to the
>nextResponder of the table view and then set the table view's next responder
>to your own responder.  And there you go, it has been inserted in the linked
>list.

A clever solution, but it means you have to always set up some other
object to do what NSTableView should do itself.  If your app has tens of
tableviews, it seems nicer to subclass and fix NSTableView, then just
use your subclass everywhere.  I guess the best solution always depends
on one's situation.

Thanks to all,

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


CalendarStore eventPredicateWithStartDate question

2008-10-21 Thread Dale Jensen
In attempting to read events from the CalendarStore for a specific  
calendar and expansive time period, I'm using:


eventPredicateWithStartDate:endDate:calendars:

The existance of, and documentation for, this other implementation:

eventPredicateWithStartDate:endDate:UID:calendars:

implies that the first call would only return one instance of a  
recurring event, but it does not.  If I have a weekly event and my  
time period is two years, I get 104 events back, all with the same UID  
(different dates, though, of course.)


I realize that I can filter the events myself manually, but is there  
an better way to go about this?  All I really want to get back are the  
unique events over the time period, and if you had a reasonably  
complicated calendar with dozens of recurring events, this call could  
easily start to return thousands of objects, which seems a little  
inefficient.


Thanks!


dale

--
Dale Jensen, CEO
Ntractive, LLC
[EMAIL PROTECTED]
http://www.ntractive.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 [EMAIL PROTECTED]


Putting an image on a CALayer

2008-10-21 Thread DKJ
I'd like to put an image stored in a JPEG file onto a CALayer. It  
seems that I do this by assigning a  CGImageRef to its contents  
property. But how do I get a CGImageRef from a file? Do I make an  
NSData object from the file and do something with that?


dkj
___

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 [EMAIL PROTECTED]


Re: @property and HeaderDoc

2008-10-21 Thread Sean McBride
On 10/20/08 5:38 PM, Jerry Krinock said:

>Has anyone thought about making HeaderDoc support @property
>declarations?  Besides a new Xcode menu script to generate the
>HeaderDoc comment, I believe that the HeaderDoc generator tool would
>also need some code added to parse the declaration itself.

It is my impression that few people are still using HeaderDoc.  doxygen
supports Obj-C 2 @property declarations.

--

Sean McBride, B. Eng [EMAIL PROTECTED]
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread Alex Heinz
You could use [[NSImage alloc] initWithContentsOfFile:], and then draw  
the NSImage to the CALayer.


HTH,
Alex

On Oct 21, 2008, at 11:46 AM, DKJ wrote:

I'd like to put an image stored in a JPEG file onto a CALayer. It  
seems that I do this by assigning a  CGImageRef to its contents  
property. But how do I get a CGImageRef from a file? Do I make an  
NSData object from the file and do something with that?


dkj
___

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/aheinz2%40johnshopkins.edu

This email sent to [EMAIL PROTECTED]

___

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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread Jean-Daniel Dupas


Le 21 oct. 08 à 17:46, DKJ a écrit :

I'd like to put an image stored in a JPEG file onto a CALayer. It  
seems that I do this by assigning a  CGImageRef to its contents  
property. But how do I get a CGImageRef from a file? Do I make an  
NSData object from the file and do something with that?


dkj


You use ImageIO Framework. See CGImageSource reference.



___

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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread Josh Abernathy

Scott Stevenson uses an NSImage category with:

- (CGImageRef)cgImage
{
// I'm open to better ideas. :)

NSData* data = [self TIFFRepresentation];
return CreateCGImageFromData(data);
}

So create an NSImage and use that.

On Oct 21, 2008, at 11:46 AM, DKJ wrote:

I'd like to put an image stored in a JPEG file onto a CALayer. It  
seems that I do this by assigning a  CGImageRef to its contents  
property. But how do I get a CGImageRef from a file? Do I make an  
NSData object from the file and do something with that?


dkj
___

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/joshaber%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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 [EMAIL PROTECTED]


Re: Properly supporting 'delete' key presses in NSTableView

2008-10-21 Thread Dalzhim Dalzhim
Well you can easily create a NSTableView category in which you handle the
integration of a NSResponder which handles the delete key into the responder
chain. This way you won't have to fix this in every single subclass of
NSTableView that might appear in the future, wherever it comes from (system
components or home-made components).

Besides, if you do not wish to create a new element in the responder chain,
you can simply add this functionality to one of the elements already present
in the responder chain such as a controller.


-Dalzhim


2008/10/21 Sean McBride <[EMAIL PROTECTED]>

>
> A clever solution, but it means you have to always set up some other
> object to do what NSTableView should do itself.  If your app has tens of
> tableviews, it seems nicer to subclass and fix NSTableView, then just
> use your subclass everywhere.  I guess the best solution always depends
> on one's situation.
>
> Thanks to all,
>
> --
> 
> Sean McBride, B. Eng [EMAIL PROTECTED]
> Rogue Researchwww.rogue-research.com
> Mac Software Developer  Montréal, Québec, Canada
>
>
>
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread DKJ

On 21 Oct, 2008, at 08:51, Alex Heinz wrote:

then draw the NSImage to the CALayer




This is the bit I'm not sure how to do. I see a CALayer contents  
property, but I can't assign an NSImage to 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 [EMAIL PROTECTED]


looking for reference to a dictionary

2008-10-21 Thread Stefan Wolfrum

Hi all,

I have an array. Each array entry is a dictionary. Each dictionary has  
two key/value pairs (all are strings).


Now I get from somewhere else the value (a string) corresponding to  
one of the keys. It's exactly the same string, content-wise (not  
address-wise).
What I need: a reference/pointer to THAT dictionary inside the array  
which contains this string as the value of the key (I know what key it  
is).


How would I do that?

My knowledge is: to get an array's entry I just have the  
objectAtIndex: method. But then I'd need the index where the  
dictionary I'm looking for is. How would I get the index without, of  
course, iterating through all the array's entries and looking at every  
dictionary and comparing my given value with all the values inside the  
dictionaries?


Thanks a LOT guys!!
Stefan.

___

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 [EMAIL PROTECTED]


Re: looking for reference to a dictionary

2008-10-21 Thread Alex Heinz
You can't. Iterating through the array is the only way, unless the  
dictionaries are organized in some special way. Out of curiosity, why  
not just use a single dictionary, instead of an array of dictionaries?


HTH,
Alex

On Oct 21, 2008, at 12:08 PM, Stefan Wolfrum wrote:


Hi all,

I have an array. Each array entry is a dictionary. Each dictionary  
has two key/value pairs (all are strings).


Now I get from somewhere else the value (a string) corresponding to  
one of the keys. It's exactly the same string, content-wise (not  
address-wise).
What I need: a reference/pointer to THAT dictionary inside the array  
which contains this string as the value of the key (I know what key  
it is).


How would I do that?

My knowledge is: to get an array's entry I just have the  
objectAtIndex: method. But then I'd need the index where the  
dictionary I'm looking for is. How would I get the index without, of  
course, iterating through all the array's entries and looking at  
every dictionary and comparing my given value with all the values  
inside the dictionaries?


Thanks a LOT guys!!
Stefan.

___

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/aheinz2%40johnshopkins.edu

This email sent to [EMAIL PROTECTED]

___

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 [EMAIL PROTECTED]


Re: looking for reference to a dictionary

2008-10-21 Thread Bill Bumgarner

On Oct 21, 2008, at 9:08 AM, Stefan Wolfrum wrote:

Hi all,

I have an array. Each array entry is a dictionary. Each dictionary  
has two key/value pairs (all are strings).


Now I get from somewhere else the value (a string) corresponding to  
one of the keys. It's exactly the same string, content-wise (not  
address-wise).
What I need: a reference/pointer to THAT dictionary inside the array  
which contains this string as the value of the key (I know what key  
it is).


How would I do that?

My knowledge is: to get an array's entry I just have the  
objectAtIndex: method. But then I'd need the index where the  
dictionary I'm looking for is. How would I get the index without, of  
course, iterating through all the array's entries and looking at  
every dictionary and comparing my given value with all the values  
inside the dictionaries?


First: is iterating over the array contents really causing a  
performance problem?  Or is it just algorithmically offensive and  
you'd like to make it go away in the name of code aesthetics?   Maybe  
it doesn't need to be changed at all, but if it does


Change your model.

Your current model -- your current object graph that consists of an  
array of dictionaries -- does not support a lookup pattern that you  
need to do.


So, change the model.

If order isn't important, maybe your array should really be a  
dictionary.


If order is important, you could use a dictionary to store the items  
and an array of keys in item order.


b.bum

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 [EMAIL PROTECTED]

Re: Cocoa-dev Digest, Vol 5, Issue 1808

2008-10-21 Thread Gordon Apple
Uh, unless you might want to draw an NSImage sometime...

On 10/20/08 9:04 PM, "[EMAIL PROTECTED]"
<[EMAIL PROTECTED]> wrote:

> On 21 Oct 2008, at 2:21 am, DKJ wrote:
> 
>> When I do this in the controller's awakeFromNib method:
>> 
>> [theView lockFocus];
> 
> 
> Then don't do it!
> 
> stuff like -lockFocus comes into the category of "advanced
> techniques". 99% of Cocoa programmers will never need it. Move along
> now, nothing to see here...
> 
> hth,
> 
> 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 [EMAIL PROTECTED]


Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Barry Wark
I'm using [NSPredicateRowEditorTemplate
templatesWithAttributeKeyPaths:inEntityDescription:] to generate
predicate row templates for a Core Data entity. One of the properties
is a date. Is there any way to change the NSDatePickerElementFlags for
the NSDatePicker in the associated row template (to include hrs:mm) or
do I have to write my own NSPredicateRowTemplate subclass?

Thanks for any info or pointers,
Barry
___

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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread glenn andreas


On Oct 21, 2008, at 10:54 AM, Josh Abernathy wrote:


Scott Stevenson uses an NSImage category with:

- (CGImageRef)cgImage
{
// I'm open to better ideas. :)

NSData* data = [self TIFFRepresentation];
return CreateCGImageFromData(data);
}

So create an NSImage and use that.



Unfortunately, that will leak a CGImageRef, which can be a potentially  
very bad thing (since they can become large)


At the very least the method should be renamed to "createCGImage" (to  
indicate that the object is created and the caller needs to release  
it) and then explicitly call CGImageRelease in the caller after  
setting the CGImageRef property of the CALayer (since the CALayer will  
have retained it).




Glenn Andreas  [EMAIL PROTECTED]
  wicked fun!
quadrium | prime : build, mutate, evolve, animate : the next  
generation of fractal art




___

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 [EMAIL PROTECTED]


Automatically generated predicate row templates for to-many key?

2008-10-21 Thread Barry Wark
Continuing my adventures with NSPredicateEditor...

In my Core Data managed object model, I have an entity Foo with a
to-many relationship (with a to-many inverse) to entity Baz named baz.
Baz has a string property named "tag". When I use
[NSPredicateRowEditorTemplate templatesWithAttributeKeyPaths:[NSArray
arrayWithObject:@"baz.tag"] inEntityDescription:FooDescription] to
create the row editors for an NSPredicateEditor, the result contains
(as expected) a row template like

[Popup: baz.tag] [Popup: Contains|is|is not|...] [TextField]

When I select "Contains" from the popup, a query with the predicate
works as expected. If I choose any of the other popups (e.g. "is"), I
get the following error: "to-many key not allowed here". Can I use
[NSPredicateRowEditorTemplate
templatesWithAttributeKeyPaths:inEntityDescription:] or do I have to
build the row editor manually?

Again, thanks for any info or pointers,
Barry
___

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 [EMAIL PROTECTED]


Re: How to draw a Recessed Button Shadow

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 9:55 AM, Dalzhim Dalzhim
<[EMAIL PROTECTED]> wrote:
> I have already tried the methods you mention and they draw the gray opaque
> background that I want to get rid of so that I can make the highlight a
> different color, as well as drawing the arrow images.

So subclass NSPopUpButton and override the implementation of those methods.

--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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread David Duncan

On Oct 21, 2008, at 8:50 AM, Jean-Daniel Dupas wrote:

I'd like to put an image stored in a JPEG file onto a CALayer. It  
seems that I do this by assigning a  CGImageRef to its contents  
property. But how do I get a CGImageRef from a file? Do I make an  
NSData object from the file and do something with that?


dkj


You use ImageIO Framework. See CGImageSource reference.



Specifically, you would do something like this:

NSURL *url = [NSURL fileURLWithPath:[[NSBundle mainBundle]  
pathForImageResource:@"myImage"]];
CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url,  
NULL);

CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
CFRelease(source);

Do what you will with 'image' and release it when your done.
--
David Duncan
Apple DTS Animation and Printing

___

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 [EMAIL PROTECTED]


Re: Starting a drag in mouseDragged

2008-10-21 Thread James Walker

James Walker wrote:
The documentation on -[NSView 
dragImage:at:offset:event:pasteboard:source:slideBack:] says that you 
can invoke it either in mouseDown or mouseDragged.  It makes more sense 
to me to call it from mouseDragged, since in most cases mouseDown will 
just indicate a click.  However, if I start the drag in mouseDragged, I 
don't see any drag image until I release the mouse button, at which time 
the image briefly appears and slides back.  If I start the drag with the 
exact same code but in mouseDown, then all looks good.  Does that ring 
any bells?


For the record, this turns out to be a Carbon/Cocoa conflict.  The 
Carbon function SetAutomaticControlDragTrackingEnabledForWindow causes 
this problem, even if the Carbon window was closed long before the Cocoa 
window is created.  

--
  James W. Walker, Innoventive Software LLC
  
___

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 [EMAIL PROTECTED]


Problems when putting a window between desktop and desktop icons

2008-10-21 Thread Markus Amalthea Magnuson
Hello,

I am trying to put a window above the desktop but below the desktop
icons. I have achieved this by using the following code (in my own
subclass of NSWindow):

[self setLevel:kCGDesktopIconWindowLevel - 1];

I can see that it at least visually works by using:

[self setBackgroundColor:[NSColor redColor]];
[self setAlphaValue:0.5];

This half transparent red color covers the desktop, but not the
desktop icons. So far, so good. The problem however, is that my window
intercepts all mouse clicks, even if I click on an icon. I've set up a
simple test by handling |mouseUp:| in the following way:

NSLog(@"Received %d clicks", [theEvent clickCount]);

I get this log message for all clicks, even when clicking desktop
icons. I've also tried to subtract 1 from the window level for each
click, to try each subsequent window level but the problem persists
att all available window levels, all the way to the lowest one (which
seems to be -2147483647, after which I get a "PSsetwindowlevel, error
setting window level (1001)" error).

Is there any way at all to put a window at the desired level, between
desktop and desktop icons, but still not have it intercept clicks from
icon areas?

regards
-- 
Markus Amalthea Magnuson

http://konstochvanligasaker.se
http://nattlek.se

"Life... is like a grapefruit. It's orange and squishy, and has a few
pips in it, and some folks have half a one for breakfast."
 – Douglas Adams
___

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 [EMAIL PROTECTED]


Data structure suggestions

2008-10-21 Thread Andre Masse

Hi all,

I'm currently implementing front-end to create a sql query for a  
PostgreSQL database. I have:


- a popup (tableMenu) menu containing the database' tables which is  
populated the database (from pg_tables)


- a combobox (fieldsList), datasource is  an array of "query-able"  
fields. I'm currently using the database fields names but I will need  
to provide more user friendly names ("Last Name" instead of lname).


- a combobox (operatorsList), datasource is  an array of query  
operators (in plain text) which is dependant on the field's type.


Example: for a date type, operatorsList will contain "is", "is  
before", "is after", "is not" and for a string type "is", "begins  
with" etc


- a text field (queryValue) which is also dependant on the field's  
type (quotes for strings, adding the '%' wildcard for "begins with" etc)



For each table I need

- the "query-able" field's list (not all fields should be exposed for  
queries) using the database fields names

- another one for the user friendly names
- another one for the fields types

and for each field type

- an operator list in plain text
- another for the sql version
- some kind of flags for quoting the value or not, inserting a  
wildcard or not...


I've already done the user friendly part (for 2 tables) using numerous  
arrays and dictionaries.


Here's what I'm doing at this point:

  - user selects "Person" in the table popup.

  - populate the fieldsList combo by looking up in an NSDictionary  
which keys are table names and values are an array of fields belonging  
to the Person's table.


  - populate the operatorsList combo by first getting the field's  
type from an NSDictionary who's mapping the field's name to its type  
and then looking up in another dictionary who's mapping a type to an  
operator array.


Now, I could continue using the same pattern but I'm pretty sure I'll  
get problems understanding myself a month from now... I'm already  
having trouble making myself clear in this message :-) Not counting  
the fact that the database contains 50+ tables!


Any ideas?

Thanks,

Andre Masse
___

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 [EMAIL PROTECTED]


Strange Tiger incompatability

2008-10-21 Thread David Burnett

Hi,
 I've got an issue with a Universal App targeting Tiger and above.


No Leopard the application works fine, but on Tiger I get this error...

2008-10-20 19:49:59.089 Oxidizer[389] An uncaught exception was raised
2008-10-20 19:49:59.089 Oxidizer[389] Cannot find value transformer with 
name ImageFormatIsJPEG
2008-10-20 19:49:59.090 Oxidizer[389] *** Uncaught exception: 
 Cannot find value transformer with 
name ImageFormatIsJPEG



The crash dump stack is...

Exception:  EXC_BREAKPOINT (0x0006)
Code[0]:0x0001
Code[1]:0x92c0f0d0


Thread 0 Crashed:
0   com.apple.Foundation0x92c0f0d0 _NSRaiseError + 264
1   com.apple.Foundation0x92c0ee0c +[NSException raise:format:] + 40
2   com.apple.AppKit	0x939dbe34 -[_NSBindingInfo 
valueTransformer] + 140
3   com.apple.AppKit	0x939dbd54 -[NSBinder 
_applyValueTransformerToValue:forBindingInfo:reverse:] + 112
4   com.apple.AppKit	0x939db960 -[NSBinder 
valueForBinding:resolveMarkersToPlaceholders:] + 172

5   com.apple.AppKit0x93c7caec -[NSEditableBinder hiddenState] + 72
6   com.apple.AppKit	0x93c7cdb8 -[NSEditableBinder 
_hiddenStateWithMode:] + 72
7   com.apple.AppKit	0x93c7cfb0 -[NSEditableBinder 
_setStatesImmediatelyInObject:mode:triggerRedisplay:] + 440
8   com.apple.AppKit	0x939d3820 
-[NSObject(NSKeyValueBindingCreation) 
bind:toObject:withKeyPath:options:] + 628
9   com.apple.AppKit	0x937cb638 -[NSIBObjectData 
nibInstantiateWithOwner:topLevelObjects:] + 728

10  com.apple.AppKit0x937b78ec loadNib + 240
11  com.apple.AppKit	0x937b7344 +[NSBundle(NSNibLoading) 
_loadNibFile:nameTable:withZone:ownerBundle:] + 716
12  com.apple.AppKit	0x9380e814 +[NSBundle(NSNibLoading) 
loadNibFile:externalNameTable:withZone:] + 156
13  com.apple.AppKit	0x9389e64c +[NSBundle(NSNibLoading) 
loadNibNamed:owner:] + 344

14  net.vargolsoft.oxidizer 0x55c4 -[FractalFlameModel init] + 1316

However if I open the examine the contents of the Nib and open 
classes.nib in a text editor lo and behold...



CLASS
ImageFormatIsJPEG
LANGUAGE
ObjC
SUPERCLASS
NSValueTransformer



and in the XCode project


#import 

@interface ImageFormatIsJPEG : NSValueTransformer {}

@end

Does any one have any ideas what I might be doing wrong.

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 [EMAIL PROTECTED]


Re: Core Data saving / Leopard / The temporary directory at ...

2008-10-21 Thread Jonathan Freeman
Thanks Chaitanya,

This sent me on the right path. I had implemented a custom remove on the 
children and was calling the MOC -deleteObject method to remove a child from 
MOC. 

The docs say this on the deletedObjects method:

Discussion
Note that the returned set does not necessarily include all the objects that 
have been deleted (using deleteObject:)—if an object has been inserted and 
deleted without an intervening save operation, it is not included in the set.

I was able to remove and clean up some legacy code, thanks so much!

Jonathan Freeman



___

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 [EMAIL PROTECTED]


keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley

Hi all,

Tried searching for answers to this and haven't come up with anything  
yet...


I'm displaying a sheet which has a default button. The default button  
dismisses the sheet. When the user presses Return to dismiss the sheet  
via the default button, the keyUp event for the Return key is sent to  
the window below. I happen to be looking at keyUp events in certain  
edit fields where the Return key triggers an action (much in the same  
way that the address field in a web browser does). When one of these  
edit fields is the first responder as the sheet is dismissed, the edit  
field gets the keyUp and triggers its action which is, obviously, not  
desirable.


It seems like the correct solution is to somehow avoid the keyUp being  
sent to the window/edit field after the sheet is dismissed, but I also  
wonder if I'm catching the right event in the edit field. keyDown  
doesn't work there because of the way edit fields work in Cocoa. I can  
try to look into the event queue for the keyUp in question, but I  
assume it isn't there yet at the point when I get the message that the  
default button's key equivalent was triggered...


Thanks in advance for any suggestions.

Ken

--
Ken Worley
Software Engineer, Tiberius, Inc.



___

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 [EMAIL PROTECTED]


Re: Strange Tiger incompatability

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 3:09 PM, David Burnett <[EMAIL PROTECTED]> wrote:
> Does any one have any ideas what I might be doing wrong.

You haven't called +[NSValueTransformer setValueTransfomer:forName:].
Re-read the Value Transformer Progamming Guide:
http://developer.apple.com/documentation/Cocoa/Conceptual/ValueTransformers/ValueTransformers.html

--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 [EMAIL PROTECTED]


Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 1:43 PM, Ken Worley <[EMAIL PROTECTED]> wrote:
> It seems like the correct solution is to somehow avoid the keyUp being sent
> to the window/edit field after the sheet is dismissed, but I also wonder if
> I'm catching the right event in the edit field.

Have you read the Text Editing Progamming Guide for Cocoa?  The
document specifically deals with handling the Return key:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextEditing/Tasks/InterceptKeys.html

Basically, don't handle -keyUp: or -keyDown:.  Use the
-control:textView:doCommandBySelector: delegate method.

--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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread DKJ

OK, I tried this:

NSURL *url = [NSURL fileURLWithPath:fname];
	CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url,  
NULL);

CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
CFRelease(source);

theView.layer.contents = image;

and now I get an incompatible pointer type warning on the last line.  
But the CALayer contents property has an id type.


And in any case, why is putting an image on a layer such an involved  
process?

___

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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread douglas welton


On Oct 21, 2008, at 4:00 PM, DKJ wrote:


OK, I tried this:

NSURL *url = [NSURL fileURLWithPath:fname];
	CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url,  
NULL);

CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
CFRelease(source);

theView.layer.contents = image;

and now I get an incompatible pointer type warning on the last line.  
But the CALayer contents property has an id type.


change your line of code to:

theView.layer.contents = (id)image;

And in any case, why is putting an image on a layer such an involved  
process?


pardon me, but why do you think that typing 3 lines* of code is an  
"involved process"?  Is there something about ImageIO or the exact  
nature of a layer's content that you don't understand or was not clear  
in the Core Animation Programming Guide?


curiously,

douglas

* the CFRelease() doesn't really count...  it's memory management and  
doesn't really (directly) affect the layer content.

___

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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread glenn andreas


On Oct 21, 2008, at 3:13 PM, douglas welton wrote:



On Oct 21, 2008, at 4:00 PM, DKJ wrote:


OK, I tried this:

NSURL *url = [NSURL fileURLWithPath:fname];
	CGImageSourceRef source =  
CGImageSourceCreateWithURL((CFURLRef)url, NULL);

CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
CFRelease(source);

theView.layer.contents = image;

and now I get an incompatible pointer type warning on the last  
line. But the CALayer contents property has an id type.


change your line of code to:

theView.layer.contents = (id)image;



And then add:

CGImageRelease(image);

(because otherwise you're still leaking the CGImageRef).


Glenn Andreas  [EMAIL PROTECTED]
  wicked fun!
quadrium2 | build, mutate, evolve, animate  | images, textures,  
fractals, art



___

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 [EMAIL PROTECTED]


Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Peter Ammon


On Oct 21, 2008, at 9:35 AM, Barry Wark wrote:


I'm using [NSPredicateRowEditorTemplate
templatesWithAttributeKeyPaths:inEntityDescription:] to generate
predicate row templates for a Core Data entity. One of the properties
is a date. Is there any way to change the NSDatePickerElementFlags for
the NSDatePicker in the associated row template (to include hrs:mm) or
do I have to write my own NSPredicateRowTemplate subclass?

Thanks for any info or pointers,
Barry


You don't need to make a subclass.  Just change the view directly.

[[[template templateViews] objectAtIndex:2] setDatePickerElements:...]

-Peter

___

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 [EMAIL PROTECTED]


Re: Problems when putting a window between desktop and desktop icons

2008-10-21 Thread Charles Steinman
--- On Tue, 10/21/08, Markus Amalthea Magnuson <[EMAIL PROTECTED]> wrote:

> This half transparent red color covers the desktop, but not
> the
> desktop icons. So far, so good. The problem however, is
> that my window
> intercepts all mouse clicks, even if I click on an icon.

Does [window setIgnoresMouseEvents:YES] work?

Cheers,
Chuck


  
___

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 [EMAIL PROTECTED]


Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Ashley Clark

On Oct 21, 2008, at 3:45 PM, Peter Ammon wrote:


On Oct 21, 2008, at 9:35 AM, Barry Wark wrote:


I'm using [NSPredicateRowEditorTemplate
templatesWithAttributeKeyPaths:inEntityDescription:] to generate
predicate row templates for a Core Data entity. One of the properties
is a date. Is there any way to change the NSDatePickerElementFlags  
for
the NSDatePicker in the associated row template (to include hrs:mm)  
or

do I have to write my own NSPredicateRowTemplate subclass?


You don't need to make a subclass.  Just change the view directly.

[[[template templateViews] objectAtIndex:2] setDatePickerElements:...]


Are the order of the views returned by templateViews guaranteed to  
remain constant or is it best to iterate over them looking for  
particular objects? NSDatePicker in this case.


Ashley
___

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 [EMAIL PROTECTED]


Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley


On Oct 21, 2008, at 1:36 PM, Kyle Sluder wrote:

On Tue, Oct 21, 2008 at 1:43 PM, Ken Worley  
<[EMAIL PROTECTED]> wrote:
It seems like the correct solution is to somehow avoid the keyUp  
being sent
to the window/edit field after the sheet is dismissed, but I also  
wonder if

I'm catching the right event in the edit field.


Have you read the Text Editing Progamming Guide for Cocoa?  The
document specifically deals with handling the Return key:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextEditing/Tasks/InterceptKeys.html

Basically, don't handle -keyUp: or -keyDown:.  Use the
-control:textView:doCommandBySelector: delegate method.

--Kyle Sluder



I somehow managed to miss that or I read it long enough ago that I  
forgot. Thanks much!


Ken

--
Ken Worley
Software Engineer, Tiberius, Inc.



___

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 [EMAIL PROTECTED]


Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Kyle Sluder
On Tue, Oct 21, 2008 at 5:35 PM, Ken Worley <[EMAIL PROTECTED]> wrote:
> This, by the way, is a constant source of confusion for me in Cocoa. Why is
> a delegate method specific to NSTextView listed under NSControl which is the
> parent class?

You seem to be misunderstanding a bit.  The field editor is an
instance of NSTextView (or a subclass).  Any control, however, may
make use of the field editor, not just NSTextField.  More information
about the relationship between text views, the field editor, and
controls can be found in the Text System Overview:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/Concepts/TextFieldsAndViews.html

--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 [EMAIL PROTECTED]


Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Peter Ammon


On Oct 21, 2008, at 2:21 PM, Ashley Clark wrote:


On Oct 21, 2008, at 3:45 PM, Peter Ammon wrote:


On Oct 21, 2008, at 9:35 AM, Barry Wark wrote:


I'm using [NSPredicateRowEditorTemplate
templatesWithAttributeKeyPaths:inEntityDescription:] to generate
predicate row templates for a Core Data entity. One of the  
properties
is a date. Is there any way to change the NSDatePickerElementFlags  
for
the NSDatePicker in the associated row template (to include  
hrs:mm) or

do I have to write my own NSPredicateRowTemplate subclass?


You don't need to make a subclass.  Just change the view directly.

[[[template templateViews] objectAtIndex:2]  
setDatePickerElements:...]


Are the order of the views returned by templateViews guaranteed to  
remain constant or is it best to iterate over them looking for  
particular objects? NSDatePicker in this case.


The order is constant.

-Peter


___

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 [EMAIL PROTECTED]


[Q] Size of the resize box on a window

2008-10-21 Thread Eric Gorr

Is it possible to determine the size of the resize box on a window?

The reason why this is important is that I need to be able to create a  
window programmatically and add stuff to it. In order to make sure  
that what I am adding does not overlap with the resize box in the  
lower right corner of the window, I need to know exactly how big the  
resize box is.


I did see the NSWindow method standardWindowButton, but none of the  
constants are for the resize box.


If it is not possible to do this programmatically, is the size defined  
anywhere in the documentation so I can hard code some values for it's  
size.


___

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 [EMAIL PROTECTED]


Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley


On Oct 21, 2008, at 3:20 PM, Ken Worley wrote:



On Oct 21, 2008, at 1:36 PM, Kyle Sluder wrote:

On Tue, Oct 21, 2008 at 1:43 PM, Ken Worley  
<[EMAIL PROTECTED]> wrote:
It seems like the correct solution is to somehow avoid the keyUp  
being sent
to the window/edit field after the sheet is dismissed, but I also  
wonder if

I'm catching the right event in the edit field.


Have you read the Text Editing Progamming Guide for Cocoa?  The
document specifically deals with handling the Return key:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextEditing/Tasks/InterceptKeys.html

Basically, don't handle -keyUp: or -keyDown:.  Use the
-control:textView:doCommandBySelector: delegate method.

--Kyle Sluder



I somehow managed to miss that or I read it long enough ago that I  
forgot. Thanks much!


Ken



This, by the way, is a constant source of confusion for me in Cocoa.  
Why is a delegate method specific to NSTextView listed under NSControl  
which is the parent class? Not to mention the fact that NSControl  
lists these delegate methods, but does not itself support a delegate.  
Looking at control:textView:doCommandBySelector:, textView is listed  
as an NSTextView* in the document mentioned above. NSTextView,  
however, doesn't derive from NSControl so is this really for  
NSTextView or is it for NSTextField which is mentioned at the top of  
the doc, but doesn't appear anywhere within. I'm using an NSTextField.


Those are rhetorical questions, by the way. Things I think about every  
time I'm frustrated because I've forgotten to search all the way up  
the inheritance chain looking for something I don't think should be up  
there :)


At least with this starting point thanks to Kyle, I should be able to  
find the correct way to do this.


--
Ken Worley
Software Engineer, Tiberius, Inc.



___

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 [EMAIL PROTECTED]


Re: [Q] Size of the resize box on a window

2008-10-21 Thread Charles Steinman
--- On Tue, 10/21/08, Eric Gorr <[EMAIL PROTECTED]> wrote:

> Is it possible to determine the size of the resize box on a
> window?

I'd think it can be safely expressed as NSMakeSize([NSScroller scrollerWidth], 
[NSScroller scrollerWidth]).

Cheers,
Chuck


  
___

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 [EMAIL PROTECTED]


Re: Modifying NSDatePicker for automatically generated predicate row templates

2008-10-21 Thread Barry Wark
On Tue, Oct 21, 2008 at 3:18 PM, Peter Ammon <[EMAIL PROTECTED]> wrote:
>
> On Oct 21, 2008, at 2:21 PM, Ashley Clark wrote:
>
>> On Oct 21, 2008, at 3:45 PM, Peter Ammon wrote:
>>
>>> On Oct 21, 2008, at 9:35 AM, Barry Wark wrote:
>>>
 I'm using [NSPredicateRowEditorTemplate
 templatesWithAttributeKeyPaths:inEntityDescription:] to generate
 predicate row templates for a Core Data entity. One of the properties
 is a date. Is there any way to change the NSDatePickerElementFlags for
 the NSDatePicker in the associated row template (to include hrs:mm) or
 do I have to write my own NSPredicateRowTemplate subclass?

>>> You don't need to make a subclass.  Just change the view directly.
>>>
>>> [[[template templateViews] objectAtIndex:2] setDatePickerElements:...]
>>
>> Are the order of the views returned by templateViews guaranteed to remain
>> constant or is it best to iterate over them looking for particular objects?
>> NSDatePicker in this case.
>
> The order is constant.

Worked like a charm. Thanks.

- Barry
___

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 [EMAIL PROTECTED]


Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley


On Oct 21, 2008, at 4:17 PM, Ken Worley wrote:



On Oct 21, 2008, at 4:03 PM, Kyle Sluder wrote:

On Tue, Oct 21, 2008 at 5:35 PM, Ken Worley  
<[EMAIL PROTECTED]> wrote:
This, by the way, is a constant source of confusion for me in  
Cocoa. Why is
a delegate method specific to NSTextView listed under NSControl  
which is the

parent class?


You seem to be misunderstanding a bit.  The field editor is an
instance of NSTextView (or a subclass).  Any control, however, may
make use of the field editor, not just NSTextField.  More information
about the relationship between text views, the field editor, and
controls can be found in the Text System Overview:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/Concepts/TextFieldsAndViews.html

--Kyle Sluder



You're right. I was somewhat confused. After looking at this in more  
detail, it seemed to me that the correct thing to do would be to  
specify a delegate to the NSTextField control and implement the - 
control:textView:doCommandBySelector: method that you suggested.


When I do that, however, the method never gets called, so I'm still  
not quite getting things. Still assimilating info though.



In the end, I found this note in the documentation for the  
textDidEndEditing: method of NSTextField:


If the user ended editing by pressing Return, this method tries to  
send the receiver’s action to its target; if unsuccessful, it sends  
performKeyEquivalent: to its NSView (for example, to handle the  
default button on a panel); if that also fails, the receiver simply  
selects its text.


I set an action and target for the NSTextField and it's called when  
the user presses Return or Enter. That's exactly what I needed in this  
case. I never did get anything working using  
control:textView:doCommandBySelector, but I'm not sure if I was using  
it correctly.


Thanks,
Ken

--
Ken Worley
Software Engineer, Tiberius, Inc.



___

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 [EMAIL PROTECTED]


NSInMemoryStoreType: Not really "persistent", is it?

2008-10-21 Thread Jerry Krinock
An NSPersistentStore created with NSInMemoryStoreType is in volatile  
RAM or VM, and is therefore not what I would call "persistent".  So,  
why is it an NS^Persistent^Store?


My guess is that NSInMemoryStoreType was added too late in the  
development of Core Data to change the names of the NS___Store and  
NS___StoreCoordinator.


Is there a better explanation?

(I'm just trying to understand the terms here.)

Jerry Krinock

___

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 [EMAIL PROTECTED]


Re: Toolbar buttons and isEnabled binding

2008-10-21 Thread Chris Idou
"You can try to disable Autovalidates."

I've done that, to no avail.

What does that option do anyway?



--- On Tue, 10/21/08, Ömer Kardaş <[EMAIL PROTECTED]> wrote:

> From: Ömer Kardaş <[EMAIL PROTECTED]>
> Subject: Re: Toolbar buttons and isEnabled binding
> To: [EMAIL PROTECTED]
> Date: Tuesday, October 21, 2008, 3:59 PM
> You can try to disable Autovalidates.
> 
> 
> On Oct 21, 2008, at 5:04 PM, Chris Idou wrote:
> 
> >
> > I seem to be getting erratic behaviour from toolbar
> button isEnabled  
> > bindings. In some scenarios they don't seem to
> work correctly.
> >
> > I've tried putting the exact same binding criteria
> on some regular  
> > buttons just to see what happens, and they seem to
> work correctly  
> > when the toolbar buttons don't.
> >
> > Has anyone else noticed this?
> >
> >
> >
> >
> >
> >
> > ___
> >
> > 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/omerkardas%40me.com
> >
> > This email sent to [EMAIL PROTECTED]



___

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 [EMAIL PROTECTED]


Re: NSInMemoryStoreType: Not really "persistent", is it?

2008-10-21 Thread Bill Bumgarner

On Oct 21, 2008, at 4:43 PM, Jerry Krinock wrote:
An NSPersistentStore created with NSInMemoryStoreType is in volatile  
RAM or VM, and is therefore not what I would call "persistent".  So,  
why is it an NS^Persistent^Store?


My guess is that NSInMemoryStoreType was added too late in the  
development of Core Data to change the names of the NS___Store and  
NS___StoreCoordinator.


Is there a better explanation?

(I'm just trying to understand the terms here.)


Well, it is persistent.  Just don't turn off your machine or shut down  
the app.


In all seriousness, a persistent store the interface between the  
coordinator and the permanent state of your object graph -- both for  
reading and writing.  When you push a change into a store, that change  
effectively becomes a permanent part of that objects state.   That the  
actual storage is in memory vs. on disk is irrelevant.


The in memory store is actually extremely useful for caches and as a  
backing store for applications that read/write to/from some kind of  
server -- typically an XML RPC of some type -- that wants to take full  
advantage of CD's object graph management infrastructure.  The various  
change hooks on the MOC and coordinator make it possible to easily  
mirror the changes out to the wire protocol or update the local cache  
-- the in memory persistent store -- with changes pulled from the  
other side.


(I did a little demo app at one point long ago that used an in memory  
store to cache results from Amazon's web services API.   The front end  
was all pure Cocoa / bindings / CD with a minimal amount of additional  
code to pull data from amazon and push it into the local store).


b.bum



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 [EMAIL PROTECTED]

Re: Toolbar buttons and isEnabled binding

2008-10-21 Thread Nick Zitzmann


On Oct 21, 2008, at 5:49 PM, Chris Idou wrote:


"You can try to disable Autovalidates."

I've done that, to no avail.

What does that option do anyway?



Normally toolbar item validation is not done through bindings, but is  
done through the -validateToolbarItem: method in the toolbar items'  
target object(s). The same goes for menus; they use the - 
validateMenuItem: method.


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 [EMAIL PROTECTED]


Re: Putting an image on a CALayer

2008-10-21 Thread DKJ

Me again. I've been using this code:

NSURL *url = [NSURL fileURLWithPath:fname];
	CGImageSourceRef source = CGImageSourceCreateWithURL((CFURLRef)url,  
NULL);

CGImageRef image = CGImageSourceCreateImageAtIndex(source, 0, NULL);
CFRelease(source);

theView.layer.contents = (id)image;

It compiles without complaint, but I'm still not seeing the image. I  
can see the effects of changing other properties of the layer (e.g.  
borderWidth). I've checked that image is not NULL. What am I missing  
here?

___

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 [EMAIL PROTECTED]


Re: @property and HeaderDoc

2008-10-21 Thread Jerry Krinock


On 2008 Oct, 21, at 8:48, Sean McBride wrote:

It is my impression that few people are still using HeaderDoc.   
doxygen

supports Obj-C 2 @property declarations.


Thank you, Sean.  That explains it.

Yes, I just downloaded Doxygen an hour ago and after running it on my  
project already I can see that it's obviously a generation or two more  
advanced than HeaderDoc.  Indeed, @property declarations just work.   
Here's a quick reference for converting Special Commands in the  
Special Comments from HeaderDoc syntax to Doxygen, using Project Find:


Find:
   @abstract
Replace:
   @brief

Find:
   @discussion
Replace:
   @detail

Finally, to remove the redundant symbol name Special Commands which  
Doxygen doesn't need, using Regular Expression matching, Find:
   [ ]*(@class|@header|@category|@protocol|@const|@struct|@enum@| 
defined|@function|@category|@superclass|@method)[ ]*[a-zA-Z0-9_:]+[ ]*\n

Replace: with nothing (i.e. delete the entire line)

If anyone has written any Xcode user scripts for inserting Doxygen  
templates, to replace those useless "HeaderDoc Insert" templates, let  
me know.


Otherwise, if I have any further discussion on this topic I'll take it  
to the Xcode list since that's where the issues are.


___

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 [EMAIL PROTECTED]


Re: stringWithFormat

2008-10-21 Thread Kyle Sluder
On Mon, Oct 20, 2008 at 3:25 AM, Ron Green <[EMAIL PROTECTED]> wrote:
> stringWithFormat: returns an NSString that is autoreleased. I know this
> because I read it in Hillegasses book. But since this does not seem to be
> covered in the documentation, if I had not read it in a book, how would I
> discover that the NSString was autoreleased?

Actually, the documentation usually isn't explicit about whether an
object is autoreleased.  The Cocoa Memory Management documentation
specifies the rules you must follow (if you create something, release
it; if you don't create it, you must retain it if you want to hold
onto it, and you must release it later), but that doesn't mean that a
method will necessarily return an autoreleased object.  In most cases,
it will, but it may return a singleton, for example.  Or some crazy
self-memory-managing thing.

Just follow the rules and you'll be fine.

--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 [EMAIL PROTECTED]


How to prompt for admin rights in Cocoa-Python?

2008-10-21 Thread Bill Janssen
I'm writing a little uninstaller app in Cocoa-Python, and I need to put
up that ubiquitous OS X prompt for the admin password, then elevate the
privileges of the script to remove some directories installed as root.
Is that a standard widget?  If so, what is it?  If not, what's the
standard dance to do this in a Cocoa application?

Bill
___

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 [EMAIL PROTECTED]


Re: How to prompt for admin rights in Cocoa-Python?

2008-10-21 Thread Jason Coco


On Oct 21, 2008, at 22:13 , Bill Janssen wrote:

I'm writing a little uninstaller app in Cocoa-Python, and I need to  
put
up that ubiquitous OS X prompt for the admin password, then elevate  
the

privileges of the script to remove some directories installed as root.
Is that a standard widget?  If so, what is it?  If not, what's the
standard dance to do this in a Cocoa application?


http://developer.apple.com/technotes/tn2002/tn2095.html

http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/01introduction/chapter_1_section_1.html
http://developer.apple.com/documentation/Security/Conceptual/authorization_concepts/03authtasks/chapter_3_section_4.html#/ 
/apple_ref/doc/uid/TP3995-CH206-TPXREF33

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 [EMAIL PROTECTED]

Re: keyUp falling through to window when sheet dismissed

2008-10-21 Thread Ken Worley


On Oct 21, 2008, at 4:03 PM, Kyle Sluder wrote:

On Tue, Oct 21, 2008 at 5:35 PM, Ken Worley  
<[EMAIL PROTECTED]> wrote:
This, by the way, is a constant source of confusion for me in  
Cocoa. Why is
a delegate method specific to NSTextView listed under NSControl  
which is the

parent class?


You seem to be misunderstanding a bit.  The field editor is an
instance of NSTextView (or a subclass).  Any control, however, may
make use of the field editor, not just NSTextField.  More information
about the relationship between text views, the field editor, and
controls can be found in the Text System Overview:
http://developer.apple.com/documentation/Cocoa/Conceptual/TextArchitecture/Concepts/TextFieldsAndViews.html

--Kyle Sluder



You're right. I was somewhat confused. After looking at this in more  
detail, it seemed to me that the correct thing to do would be to  
specify a delegate to the NSTextField control and implement the - 
control:textView:doCommandBySelector: method that you suggested.


When I do that, however, the method never gets called, so I'm still  
not quite getting things. Still assimilating info though.


Thanks,
Ken

--
Ken Worley
Software Engineer, Tiberius, Inc.



___

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 [EMAIL PROTECTED]


When does Cocoa fall apart? (Run loops)

2008-10-21 Thread Chris Idou

I noticed with the below discussed isEnabled bindings problem that if I do:

[objectController performSelectorOnMainThread:@selector(setContent:) 
withObject:title waitUntilDone:NO];

instead of.

[objectController setContent:title];

then it seems to start behaving better.

I think I've noticed this once or twice in the past, that things that don't 
seem to work as they should, start working when you throw them on the run loop. 
In this case, the isEnabled bindings status of toolbar items seems to start 
working when I do certain things on the Run loop instead of immediately.

Have people noticed these situations? What causes them, and when should I look 
out for it?


Re: Toolbar buttons and isEnabled binding

> From: Chris Idou <[EMAIL PROTECTED]>
> Subject: Toolbar buttons and isEnabled binding
> To: cocoa-dev@lists.apple.com
> Date: Tuesday, October 21, 2008, 7:04 AM
> I seem to be getting erratic behaviour from toolbar button
> isEnabled bindings. In some scenarios they don't seem to
> work correctly.
> 
> I've tried putting the exact same binding criteria on
> some regular buttons just to see what happens, and they seem
> to work correctly when the toolbar buttons don't.
> 
> Has anyone else noticed this?


  
___

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 [EMAIL PROTECTED]


Re: looking for reference to a dictionary

2008-10-21 Thread Ken Thomases

On Oct 21, 2008, at 11:08 AM, Stefan Wolfrum wrote:

I have an array. Each array entry is a dictionary. Each dictionary  
has two key/value pairs (all are strings).


Now I get from somewhere else the value (a string) corresponding to  
one of the keys. It's exactly the same string, content-wise (not  
address-wise).
What I need: a reference/pointer to THAT dictionary inside the array  
which contains this string as the value of the key (I know what key  
it is).


How would I do that?


You may be able to accomplish what you're looking for using -[NSArray  
filteredArrayUsingPredicate:].


You won't get the index of the dictionary which matches, but you will  
get a reference to it (or them, if more than one match).


Cheers,
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 [EMAIL PROTECTED]