Re: Group CGAffineTransform Animations?

2009-06-18 Thread Chunk 1978
thanks to everyone for your input.  i've learned quite a lot!  an
interesting topic indeed :).  thanks again.

On Thu, Jun 18, 2009 at 1:45 AM, WT wrote:
> Hi David,
>
> On Jun 18, 2009, at 12:42 AM, David Duncan wrote:
>
>> Your solution works because you've scaled the coordinate system, so the
>> translation needs to be scaled too (to get the change specified by the
>> translation).
>
> Yes, that was the point I was trying to make on earlier posts, though in a
> confusing way. My intuition was correct but I was too tired to understand
> why. It's actually rather simple. A scaling is like changing the size of
> your ruler or meter-stick (a smaller ruler produces larger lengths, so the
> object you're measuring appears bigger, and vice-versa). The problem is,
> though, that changing your ruler also changes how far you travel when you
> apply a translation (changing your ruler *is* changing the scale of your
> entire coordinate system). Thus, if you scale up, you also travel more, and
> if you scale down, you travel less, and always by the same factor. So, in
> order to travel the correct distance *and* make your object have a different
> size, you need to divide the translation offset by the scale of your
> scaling. The translation offset, of course, has to be the correct one, and
> that was a vector from the object's center to the center of the screen.
>
> I am a bit confused now by something you said, though.
>
>> The issue with a translation is that it starts to confuse your
>> expectations of the relationship between a view's center and the view's
>> frame, because the center isn't altered by the transform, only the frame is.
>> This is also why I recommend not using translations as part of your
>> transform if they are not necessary, because then you look at the center of
>> the view and you discover that it hasn't actually moved, yet your view is
>> clearly not where it was before you set the transform.
>>
>> Of note at this point is that the view's center is in its super view's
>> coordinate system, while the view's bounds is in its own coordinate system
>> (and thus the origin is usually, but need not be, CGPointZero).
>
> If the center is in the superview's coordinate system, how can it not be
> changed by a translation? In the view's own coordinate system, yes, I can
> see that that's true, because then the center is half-way the bounds' width
> and height, and those don't change under a translation.
>
> Wagner
> ___
>
> 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/chunk1978%40gmail.com
>
> This email sent to chunk1...@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: Problem with capturing active state of the application

2009-06-18 Thread Srinivasa Prabhu


Thanks Andrew.

We looked into the link.

However if our application is not active and the user enters the  
selection capture mode using Hot Keys, how do we capture the
active state of close, minimize, zoom, scroll buttons of the  
application currently on screen?


Since we put up a transparent window to handle the selection drawing,  
we have to activate our application to receive mouse and key events.

Because of this the previously active application gets deactivated.

Is there any workaround for this?

Regards,
Srinivas
On Jun 18, 2009, at 11:49 AM, Andrew Farmer wrote:


On 17 Jun 2009, at 22:49, Srinivasa Prabhu wrote:
In our application we want to capture a selected area similar to  
Apple's Cmd+Shift+4 i.e
during selection capture, the active state of another application  
has to be captured.

...
Is there any workaround to capture the active state of the  
applications?


Yes: CGWindow.

http://developer.apple.com/documentation/Carbon/reference/CGWindow_Reference/Reference/Functions.html#/ 
/apple_ref/doc/uid/TP40008073-CH2-DontLinkElementID_53




---
Robosoft Technologies - Come home to Technology

Disclaimer: This email may contain confidential material. If you were not an 
intended recipient, please notify the sender and delete all copies. Emails to 
and from our network may be logged and monitored. This email and its 
attachments are scanned for virus by our scanners and are believed to be safe. 
However, no warranty is given that this email is free of malicious content or 
virus.
___

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: MobileMe API for uploading photos

2009-06-18 Thread Rimas M.
Hello,

Ok. It is possible to access iDisk itself - list content, create
folders, files etc. But I am wondering what to do, that MobileMe
gallery would show uploaded photos? How to create new album in this
gallery manually and upload photos to it?

Any help is appreciate.

Best Regards,

Rimas M.

On Mon, Mar 16, 2009 at 6:42 PM, Nick Zitzmann wrote:
>
> On Mar 15, 2009, at 10:32 PM, Deepa wrote:
>
>> Are there any APIs available for uploading photos to MobileMe account?
>
> There are, but you don't want to use them. Apple once made a DotMacKit
> framework that would upload anything to MobileMe, but it hasn't been updated
> in years, it's horribly obsolete, the authors will most likely never update
> it, and the source code isn't available.
>
> You're best off using a library that supports HTTP PUT and doing this
> manually, such as ConnectionKit or CURL.
___

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


What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Chilton Webb

Hi,

In an effort to create a less structured set of IB objects, I would  
like to 'tag' various IB elements.


For example, I might want to add a specific tag to a group of objects  
that I might later want to show or hide. I might want to grab values  
from only objects that contain some key word. And I might want to add  
or remove objects to the window at runtime, that won't be in the IB  
file to begin with.


I'd rather not have to keep creating instance variables and writing  
glue code to do this. And I'd prefer to not use bindings for this,  
since I'd ultimately like to use this same technique on the iPhone.


I could use the 'help' tag in OSX, but that's visible to the user. I  
could use the 'Interface Builder Identity' tag on the iPhone side, but  
that's AFAIK just used in IB itself.


Is there a way to add a tag an IB object in such a way that it is not  
visible to the user, but in such a way that I could reference it from  
my app?


Thank you,
-Chilton Webb
___

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: advice on background process

2009-06-18 Thread Rick C.
thanks again.  yes after reviewing everything that would seem to be the best 
way to go for me.  am i on the right track thinking i could write a foundation 
tool maybe using fsevents to screen the changes of a directory and then if 
necessary pass along the info and/or launch my main app?  if so i'll probably 
go that route.  thank you for all the advice.  i've been trying to read up as 
much as i can since it's the first time i'm doing a background process.

rick

 




From: Jerry Krinock 
To: cocoa-dev 
Sent: Wednesday, June 17, 2009 11:56:10 PM
Subject: Re: advice on background process


On 2009 Jun 17, at 05:58, Rick C. wrote:

> the launchd task can tell me if there was a change but it seems there's no 
> way to find out what that change was right?

Yes.

> it seems i could use this to launch my app but then if i have no way to 
> screen what the changes might be then i would have to launch my app every 
> time there's a change to see what it is.

Well, maybe you still want two executables then.  But you could launch a small 
tool to "screen changes".  Simpler than one that must watch for changes and run 
24/7.

___

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/jo_phls%40yahoo.com

This email sent to jo_p...@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/archive%40mail-archive.com

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


[iPhone] TableView with the new iPhone OS 3.0 Spotlight search look?

2009-06-18 Thread Påhl Melin
Hi,

Have you noticed the new table view style used in the Spotlight search
screen in iPhone OS 3.0? The table view has rounded corners like the
grouped style but where the actual content *within* the group is
scrolled and the icons in the left column are positioned in the top
left corner while scrolling within a category to be moved up by the
next category when entering a new category.

This seems (must be?) a new table view style or a completely new UI
class. Does anyone know if it's a public class or new addition to the
standard table view class?

/ Påhl
___

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


Manually updating a data bound value of a bound text field

2009-06-18 Thread Ramakrishna Vavilala
I have a window (displayed as a sheet) with a text field and some
other controls. I can not set the binding mode to continuous so I use
non continuous binding. Everything works fine as long as I press tab
and switch to a different control. However when the the text field is
the key view and I press OK button, then the value of the text field
does not get reflected in the property to which it is bound. I want to
make sure that when the user clicks OK button the property value is
updated. How can I do that apart from making the binding continuous?
___

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: Manually updating a data bound value of a bound text field

2009-06-18 Thread Ken Thomases

On Jun 18, 2009, at 9:49 AM, Ramakrishna Vavilala wrote:


I have a window (displayed as a sheet) with a text field and some
other controls. I can not set the binding mode to continuous so I use
non continuous binding. Everything works fine as long as I press tab
and switch to a different control. However when the the text field is
the key view and I press OK button, then the value of the text field
does not get reflected in the property to which it is bound. I want to
make sure that when the user clicks OK button the property value is
updated. How can I do that apart from making the binding continuous?


Send -commitEditingWithDelegate:didCommitSelector:contextInfo: (or  
just -commitEditing) to the controller in the action method of the OK  
button.


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 arch...@mail-archive.com


Re: MobileMe API for uploading photos

2009-06-18 Thread Rimas M.
Yes, I have followed your suggestion and I am using one of them to  
access iDisk. My question would be - what should I do, that my  
uploaded photos would be visible through http://gallery.me.com/ 
USERNAME. Or at least http://www.me.com/gallery/#home, when I am  
logged in. I am talking about things stored at /Web/Sites/_gallery/ 
xx/
I have tried to mimic structure created by iPhoto, but that does not  
work. There must be something that I am missing.


Basically, all I want to do, is to export photo from my app to  
MobileMe gallery, that would be accessible using web browser.


Regards,

Rimas M.


On 2009.06.18, at 18:03, Nick Zitzmann wrote:


On Jun 18, 2009, at 3:37 AM, Rimas M. wrote:



Ok. It is possible to access iDisk itself - list content, create
folders, files etc. But I am wondering what to do, that MobileMe
gallery would show uploaded photos? How to create new album in this
gallery manually and upload photos to it?



Use a WebDAV framework. Search around for one.


___

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: Manually updating a data bound value of a bound text field

2009-06-18 Thread Ramakrishna Vavilala
Unfortunately, I used incorrect design by binding text field to
properties of the file's owner (which happens to be a
NWindowController) which does not respond to commitEditing message.
Any other ideas?

On Thu, Jun 18, 2009 at 8:21 AM, Ken Thomases wrote:
> On Jun 18, 2009, at 9:49 AM, Ramakrishna Vavilala wrote:
>
>> I have a window (displayed as a sheet) with a text field and some
>> other controls. I can not set the binding mode to continuous so I use
>> non continuous binding. Everything works fine as long as I press tab
>> and switch to a different control. However when the the text field is
>> the key view and I press OK button, then the value of the text field
>> does not get reflected in the property to which it is bound. I want to
>> make sure that when the user clicks OK button the property value is
>> updated. How can I do that apart from making the binding continuous?
>
> Send -commitEditingWithDelegate:didCommitSelector:contextInfo: (or just
> -commitEditing) to the controller in the action method of the OK button.
>
> 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 arch...@mail-archive.com


Re: Manually updating a data bound value of a bound text field

2009-06-18 Thread Clark S. Cox III

Then change that and do the right thing. :)

Just add an intermediate NSObjectController to your nib in between  
your bound field and the file's owner.


Sent from my iPhone

On Jun 18, 2009, at 9:17, Ramakrishna Vavilala   
wrote:



Unfortunately, I used incorrect design by binding text field to
properties of the file's owner (which happens to be a
NWindowController) which does not respond to commitEditing message.
Any other ideas?

On Thu, Jun 18, 2009 at 8:21 AM, Ken Thomases  
wrote:

On Jun 18, 2009, at 9:49 AM, Ramakrishna Vavilala wrote:


I have a window (displayed as a sheet) with a text field and some
other controls. I can not set the binding mode to continuous so I  
use

non continuous binding. Everything works fine as long as I press tab
and switch to a different control. However when the the text field  
is

the key view and I press OK button, then the value of the text field
does not get reflected in the property to which it is bound. I  
want to

make sure that when the user clicks OK button the property value is
updated. How can I do that apart from making the binding continuous?


Send -commitEditingWithDelegate:didCommitSelector:contextInfo: (or  
just
-commitEditing) to the controller in the action method of the OK  
button.


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

This email sent to clarkc...@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: Manually updating a data bound value of a bound text field

2009-06-18 Thread Ken Thomases

On Jun 18, 2009, at 11:17 AM, Ramakrishna Vavilala wrote:


Unfortunately, I used incorrect design by binding text field to
properties of the file's owner (which happens to be a
NWindowController) which does not respond to commitEditing message.
Any other ideas?


Fix the design?  It should be relatively easy to interpose an  
NSObjectController in between and adjust your bindings.


Alternatively, you can directly invoke one of the commitEditing...  
methods on the text field, but you should only invoke it if you know  
that the text field is editing.  To learn that, you'd have to make the  
bound-to object (File's Owner) conform to NSEditorRegistration so that  
the text field (and any other editors) can inform it when it's  
editing.  This is essentially re-implementing a part of what  
NSController-derived classes would do for you.  That seems like a lot  
of unnecessary work to me.


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


Re: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread Benjamin Stiglitz
I'm working on a project that works a lot with Spotlight, and we're  
trying to get a list of all the attributes that Spotlight knows  
about.  We found a really nice function called  
MDSchemaCopyAllAttributes that returns a CFArrayRef of CFStringRefs,  
each one corresponding to a spotlight attribute in the schema.


The problem is that when we run this program as root (which we have  
to), MDSchemaCopyAllAttributes seems to consistently be returning  
nil.  Is this normal behavior?  If so, how can we get a list of all  
Spotlight attributes across an entire machine (and not just the user  
domain)?


You should be using a privileged helper process for the privileged  
operations your application performs instead of running as root. There  
was a great session on Authorization Services at WWDC; until the video  
is up, you can take a look at:
• The Authorization Services Programming Guide: 
• BetterAuthorizationSample: 


-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


[iPhone]MKAnnotation of "showUserLocation"-getting a reference to my own location pin

2009-06-18 Thread James Lin

Hi all...

Anyone playing with MKMapView?

I am trying to set the pin color of "my" location to be red.
and set other annotations to another color.

But I am having trouble getting a reference to the pin that denotes my  
location.
because this pin is generated by "showUserLocation" and not by  
MKAnnotationView.


I can set the pin color of other annotations by "title" of the pin.
however, if i use the title of my pin "Current Location" to refer to it,
nothing happens to my setPinColor call.

How do i get a reference to the pin of my own location?

Thank you in advance for your help.

James
___

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: Group CGAffineTransform Animations?

2009-06-18 Thread David Duncan

On Jun 17, 2009, at 10:45 PM, WT wrote:

If the center is in the superview's coordinate system, how can it  
not be changed by a translation?


Because the center is only 1 part in the chorus of things that  
determines where your view is. All of this really translates to Core  
Animation under the covers, and what UIKit reports to you as the  
center of a view is the view's layer's position. So lets go strictly  
to layers for a moment.


A layer has 4 properties that affect its area on screen – position,  
bounds.size, anchorPoint and transform. All of these properties  
together produce the final bounding rect in 3D space for the layer,  
which is then flattened into the frame rect that we all know and love.


So the position property of the layer never changes when you transform  
a layer, regardless of the transform. The layer moves when you apply a  
translation transform to it because you've changed the bounding rect  
that was calculated from the transform along with the other 3  
properties I mentioned.


In the view's own coordinate system, yes, I can see that that's  
true, because then the center is half-way the bounds' width and  
height, and those don't change under a translation.



The view's center property is the point around which the view bounds  
are located. If you change the view's layer's anchorPoint, then the  
view's center will have a different meaning. It defaults to half way  
between, but really its saying to place half of the bounds on either  
side of the position.

--
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 arch...@mail-archive.com


Re: Manually updating a data bound value of a bound text field

2009-06-18 Thread Ramakrishna Vavilala
That works well.

 I eventually implemented

- (void)objectDidBeginEditing:(id)editor
and
- (void)objectDidEndEditing:(id)editor

It works like a charm. I agree that the better design would be to use
an object controller. But I was also trying to understand how the
whole binding thing works so it is good to know about
NSEditorRegistration.

Thanks for your help:).

On Thu, Jun 18, 2009 at 9:33 AM, Ken Thomases wrote:
> On Jun 18, 2009, at 11:17 AM, Ramakrishna Vavilala wrote:
>
>> Unfortunately, I used incorrect design by binding text field to
>> properties of the file's owner (which happens to be a
>> NWindowController) which does not respond to commitEditing message.
>> Any other ideas?
>
> Fix the design?  It should be relatively easy to interpose an
> NSObjectController in between and adjust your bindings.
>
> Alternatively, you can directly invoke one of the commitEditing... methods
> on the text field, but you should only invoke it if you know that the text
> field is editing.  To learn that, you'd have to make the bound-to object
> (File's Owner) conform to NSEditorRegistration so that the text field (and
> any other editors) can inform it when it's editing.  This is essentially
> re-implementing a part of what NSController-derived classes would do for
> you.  That seems like a lot of unnecessary work to me.
>
> 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


NSInterger Infinity?

2009-06-18 Thread Chunk 1978
i would like to set an AnimationRepeatCount to loop continuously.
what is an appropriate number to set?
___

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: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread Dave DeLong
This application *is* the privileged helper process, and it needs to know about 
all the Spotlight attributes that spotlight has.  The problem is that Spotlight 
doesn't seem to like the root user.

For example, in Terminal I can run "mdimport -X" and get a dump of the 
Spotlight schema information.  However, if I run that same command with sudo, I 
get "mdimport will not import on behalf of root user.  Exiting."

So, reiterating my original question, how can my root process get a list of all 
the spotlight attributes in the schema?

Thanks,

Dave
 
On Thursday, June 18, 2009, at 10:35AM, "Benjamin Stiglitz"  
wrote:
>You should be using a privileged helper process for the privileged  
>operations your application performs instead of running as root. There  
>was a great session on Authorization Services at WWDC; until the video  
>is up, you can take a look at:
>• The Authorization Services Programming Guide: 
> 
> >
>• BetterAuthorizationSample: 
> 
> >
___

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: NSInterger Infinity?

2009-06-18 Thread Nick Zitzmann


On Jun 18, 2009, at 11:02 AM, Chunk 1978 wrote:


i would like to set an AnimationRepeatCount to loop continuously.
what is an appropriate number to set?



If you're using UIImageView, then setting the value to 0 will make it  
loop indefinitely...


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: NSInterger Infinity?

2009-06-18 Thread Chunk 1978
i'll certainly use your advice in the future, thanks.  however, i'm
currently just setting a UIView within the animation block and setting
0 plays the animation only one tim

On Thu, Jun 18, 2009 at 1:07 PM, Nick Zitzmann wrote:
>
> On Jun 18, 2009, at 11:02 AM, Chunk 1978 wrote:
>
>> i would like to set an AnimationRepeatCount to loop continuously.
>> what is an appropriate number to set?
>
>
> If you're using UIImageView, then setting the value to 0 will make it loop
> indefinitely...
>
> 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: NSInterger Infinity?

2009-06-18 Thread Chunk 1978
perfect.  thanks :)

On Thu, Jun 18, 2009 at 1:15 PM, Nick Zitzmann wrote:
>
> On Jun 18, 2009, at 11:10 AM, Chunk 1978 wrote:
>
>> i'll certainly use your advice in the future, thanks.  however, i'm
>> currently just setting a UIView within the animation block and setting
>> 0 plays the animation only one time.
>
>
> Oh, if you're using a UIView, they take floating point arguments instead of
> integers, so you'll probably want to use FLT_MAX.
>
> 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: NSInterger Infinity?

2009-06-18 Thread WT

On Jun 18, 2009, at 7:02 PM, Chunk 1978 wrote:


i would like to set an AnimationRepeatCount to loop continuously.
what is an appropriate number to set?


You could use NSIntegerMax. Although finite, it's so large it might as  
well be considered infinitely large, in the context in question. I  
doubt any user will be running your application continuously for a  
long enough period of time to exhaust an entire animation cycle of  
that length.


Wagner
___

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: NSInterger Infinity?

2009-06-18 Thread Chunk 1978
agreed.  the reason i asked is because i saw this snippet of code:
repeatCount = 1e100f; and i just though that seems awfully ambiguous
and hoped for something a little more universal.

On Thu, Jun 18, 2009 at 1:35 PM, WT wrote:
> On Jun 18, 2009, at 7:02 PM, Chunk 1978 wrote:
>
>> i would like to set an AnimationRepeatCount to loop continuously.
>> what is an appropriate number to set?
>
> You could use NSIntegerMax. Although finite, it's so large it might as well
> be considered infinitely large, in the context in question. I doubt any user
> will be running your application continuously for a long enough period of
> time to exhaust an entire animation cycle of that length.
>
> Wagner
>
___

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: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread Kyle Sluder
On Thu, Jun 18, 2009 at 10:03 AM, Dave DeLong wrote:
> This application *is* the privileged helper process, and it needs to know 
> about all the Spotlight attributes that spotlight has.  The problem is that 
> Spotlight doesn't seem to like the root user.

Why is the privileged process asking Spotlight for anything?  Try to
factor as much code as possible out of your privileged tool.

In this particular instance, don't forget that Spotlight importers can
live in ~/Library/Spotlight as well as within app bundles in
~/Applications.  Any answer that MDSchemaCopyAllAttributes() would
give you when running as root might be incorrect for the user who's
actually the results.

--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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Erik Buck
See the - (void)setRepresentedObject:(id)anObject method of NSCell.  You can 
set a string or dictionary and the represented object and retrieve it via 
-representedObject.
 
You can also instantiate an array and add objects to the array within IB.  Then 
you only need an outlet instance variable to reference the array and not 
separate instance variables for all of the user interface objects.  See 
"Foundation Collections Palette"  You can populate the array  entirely within 
IB. Make any target/action connections in IB.
http://www.geocities.com/kritter_cocoadev/

 
For some final advice: Don't do what you are contemplating.  Users hate 
interfaces that change outside the user's control.  If a group of objects are 
going to appear or disappear, consider whether they should become enabled or 
disabled instead.  If objects are logically associated, group the objects 
together visibly in boxes or matrix or tabs or through other means.  Then you 
can enable or disable all elements of the box in code without needing to have 
outlets for every element.  You can even hide or unhidden the whole box.
 
use 
[[myBox subviews] makeObjectPerformSelector:@selector(setEnabled:) 
withObject:NO];
 
or similar.
 
 
___

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: Group CGAffineTransform Animations?

2009-06-18 Thread WT

On Jun 18, 2009, at 6:39 PM, David Duncan wrote:


On Jun 17, 2009, at 10:45 PM, WT wrote:

If the center is in the superview's coordinate system, how can it  
not be changed by a translation?


Because the center is only 1 part in the chorus of things that  
determines where your view is. All of this really translates to Core  
Animation under the covers, and what UIKit reports to you as the  
center of a view is the view's layer's position. So lets go strictly  
to layers for a moment.


A layer has 4 properties that affect its area on screen – position,  
bounds.size, anchorPoint and transform. All of these properties  
together produce the final bounding rect in 3D space for the layer,  
which is then flattened into the frame rect that we all know and love.


So the position property of the layer never changes when you  
transform a layer, regardless of the transform. The layer moves when  
you apply a translation transform to it because you've changed the  
bounding rect that was calculated from the transform along with the  
other 3 properties I mentioned.


In the view's own coordinate system, yes, I can see that that's  
true, because then the center is half-way the bounds' width and  
height, and those don't change under a translation.



The view's center property is the point around which the view bounds  
are located. If you change the view's layer's anchorPoint, then the  
view's center will have a different meaning. It defaults to half way  
between, but really its saying to place half of the bounds on either  
side of the position.

--
David Duncan
Apple DTS Animation and Printing


Hi David,

I very much appreciate that you spent the time to explain all that  
(and not just for my benefit, but for everyone else's as well), but  
I'm still very confused by what you said, even more so now.


Ultimately, I have some rectangular area on the 2D screen of an iPhone  
or a Mac, and it has a center point (which, I understand, doesn't  
*have* to be halfway through the bounds), whose coordinates are  
measured in the coordinate system of the rectangle's superview. I then  
apply a translation to this rectangle and it ends up somewhere else on  
that screen. Assuming that the rectangle's superview was not  
translated along as well, I cannot see how the coordinates of the  
rectangle's center would not have changed.


Now, I fully realize that my lack of understanding is entirely due to  
not having worked with layers, meaning that I have not spent any  
serious time reading the docs on them (meaning that I should!).


I would love to continue this discussion off-list but, realistically,  
I am not prepared enough for that yet, so I won't impose on you any  
more than I already have. I am soon going to dive into core animation  
for an app I'm working on and maybe then I'll understand what you  
wrote above. And, if not, at least I'll be ready to ask more specific  
questions.


Regardless, thank you for trying to make sense of it for me (and  
others).


Wagner___

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: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread Dave DeLong
This is the root tool that powers the Mozy backup product.  One of the  
features is that users can specify queries to determine which files to  
back up.  However, it needs to find all files across the system, and  
not just the users files.  Hence, our backup utility has to run as  
root.  Part of our query stuff needs to have access to the list of  
spotlight attributes for optimization reasons.


So, how can a root program get a complete list of Spotlight  
attributes?  (Either via a function or getting a list for each user  
and combining them, etc)


Thanks,

Dave

On Jun 18, 2009, at 11:58 AM, Kyle Sluder wrote:

On Thu, Jun 18, 2009 at 10:03 AM, Dave DeLong  
wrote:
This application *is* the privileged helper process, and it needs  
to know about all the Spotlight attributes that spotlight has.  The  
problem is that Spotlight doesn't seem to like the root user.


Why is the privileged process asking Spotlight for anything?  Try to
factor as much code as possible out of your privileged tool.

In this particular instance, don't forget that Spotlight importers can
live in ~/Library/Spotlight as well as within app bundles in
~/Applications.  Any answer that MDSchemaCopyAllAttributes() would
give you when running as root might be incorrect for the user who's
actually the results.

--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: Group CGAffineTransform Animations?

2009-06-18 Thread David Duncan

On Jun 18, 2009, at 11:01 AM, WT wrote:

Ultimately, I have some rectangular area on the 2D screen of an  
iPhone or a Mac, and it has a center point (which, I understand,  
doesn't *have* to be halfway through the bounds), whose coordinates  
are measured in the coordinate system of the rectangle's superview.  
I then apply a translation to this rectangle and it ends up  
somewhere else on that screen. Assuming that the rectangle's  
superview was not translated along as well, I cannot see how the  
coordinates of the rectangle's center would not have changed.



Your confusing the geometric center of the view's rectangle with the  
center property of the view. Specifically in code if you do this:


CGPoint c = view.center;
view.transform = CGAffineTransformMakeTranslation(20, 20);
CGPoint visualCenter = CGPointMake(CGRectGetMidX(view.frame),  
CGRectGetMidY(view.frame));

CGPoint c2 = view.center;

Then you will find that c == c2, c != visualCenter, and c2 !=  
visualCenter.


This is why using translations for transforms is very confusing. You  
expect the center of the view to change, but it does not. This is by  
design.

--
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 arch...@mail-archive.com


Re: NSInterger Infinity?

2009-06-18 Thread Henry McGilton (Boulevardier)


On Jun 18, 2009, at 10:39 AM, Chunk 1978 wrote:


agreed.  the reason i asked is because i saw this snippet of code:
repeatCount = 1e100f; and i just though that seems awfully ambiguous
and hoped for something a little more universal.


Nothing ambiguous at all --- it's about 2 * 10 ^ 82 times the current  
estimated age

of the Universe, and that ought to be Universal enough . . .



On Thu, Jun 18, 2009 at 1:35 PM, WT wrote:

On Jun 18, 2009, at 7:02 PM, Chunk 1978 wrote:


i would like to set an AnimationRepeatCount to loop continuously.
what is an appropriate number to set?


You could use NSIntegerMax. Although finite, it's so large it might  
as well
be considered infinitely large, in the context in question. I doubt  
any user
will be running your application continuously for a long enough  
period of

time to exhaust an entire animation cycle of that length.


___

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


Toggle Dock Icon

2009-06-18 Thread Charles E. Heizer
Hello,
Does anyone know if there is a good way to toggle the dock icon?

I have a reboot application that has problems at times with OS updates
and not launching, due to libraries being updated. I was looking to
solve this by launching my reboot application before the updates occur
and just back grounding it, and bring it to the front once the updates/
installs have completed.
All of this is fairly easy to do except for; I want to toggle the dock
icon's visibility when ready to reboot. I looked at the LSUIElement and this
is nice but it also hides the menubar.

Thanks,
Charles

___

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

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

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

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


Strange problem with CFHash and CFEqual

2009-06-18 Thread Stefan

Hi,

i have some trouble with some Core funtions and are out of ideas
(after a whole day of searching, debugging and docs-reading)

The problem could be simple described:

I have 2 CGImageRef 'objects' which i have to compare.
That is working fine with the CFEqual function.
But i also need a valid (valid per contract) HashCode too.

The problem is now that these hashcodes are _always_ 0

To make this more visual i have appended  a little code snipped below.
Because i really have any further ideas i need some help with this.


Much thanks in advance.
Stefan


/*  SNIP  */

(Yes, CoreFoundation.h is included)
CGImageRef imageRefOne;
CGImageRef imageRefTwo;
/.../

CGDataProviderRef dprov = CGImageGetDataProvider( imageRefOne );
CFDataRef imageRefOneDataRef = CGDataProviderCopyData( dprov );

/*
imageRefOneDataRef and the 2 CGImageRef's are ok, checked in XCode  
debugger.

could be copied into an NSBitmapImageRep object and looks as expected
*/

CFHashCode hcOne = CFHash(imageRefOne); /* Returns ALWAYS 0 */
CFHashCode hcTwo = CFHash(imageRefTwo); /* Returns ALWAYS 0 */


BOOL isEqual = CFEqual(imageRefOne, imageRefTwo); /* Works ALWAYS as  
expected: if images are equal it returns equal. if not: not*/


/*  SNIP  */

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

Strange problem with CFDataRef, CFHash and CFEqual

2009-06-18 Thread Stefan

Hi,

i have some trouble with some Core funtions and are out of ideas
(after a whole day of searching, debugging and docs-reading)

The problem could be simple described:

I have 2 CGImageRef 'objects' which i have to compare.
That is working fine with the CFEqual function.
But i also need a valid (valid per contract) HashCode too.

The problem is now that these hashcodes are _always_ 0

To make this more visual i have appended  a little code snipped below.
Because i really have any further ideas i need some help with this.


Much thanks in advance.
Stefan


/*  SNIP  */

(Yes, CoreFoundation.h is included)
CGImageRef imageRefOne;
CGImageRef imageRefTwo;

/.../

CGDataProviderRef dprov = CGImageGetDataProvider( imageRefOne );
CFDataRef imageRefOneDataRef = CGDataProviderCopyData( dprov );

/*
imageRefOneDataRef and the 2 CGImageRef's are ok, checked in XCode  
debugger.

could be copied into an NSBitmapImageRep object and looks as expected
*/

CFHashCode hcOne = CFHash(imageRefOneDataRef); /* Returns ALWAYS 0 */


BOOL isEqual = CFEqual(imageRefOne, imageRefTwo); /* Works ALWAYS as  
expected: if images are equal it returns equal. if not: not*/


/*  SNIP  */

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: Toggle Dock Icon

2009-06-18 Thread Kyle Sluder
On Thu, Jun 18, 2009 at 11:33 AM, Charles E. Heizer wrote:
> All of this is fairly easy to do except for; I want to toggle the dock
> icon's visibility when ready to reboot. I looked at the LSUIElement and this
> is nice but it also hides the menubar.

If you found LSUIElement, you no doubt found the numerous threads
(including the one from a few days ago) where it's pointed out that
you cannot have a menu bar without a Dock icon.

I don't understand what your app is doing anyway.  Is it asking for a reboot?

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


Strange problem with CFDataRef, CFHash and CFEqual

2009-06-18 Thread Stefan

Hi,

i have some trouble with some Core funtions and are out of ideas
(after a whole day of searching, debugging and docs-reading)

The problem could be simple described:

I have 2 CGImageRef 'objects' which i have to compare.
That is working fine with the CFEqual function.
But i also need a valid (valid per contract) HashCode too.

The problem is now that these hashcodes are _always_ 0

To make this more visual i have appended  a little code snipped below.
Because i really have any further ideas i need some help with this.


Much thanks in advance.
Stefan


/*  SNIP  */

(Yes, CoreFoundation.h is included)
CGImageRef imageRefOne;
CGImageRef imageRefTwo;

CFDataRef imageRefTwoDataRef; /* ... */

/.../

CGDataProviderRef dprov = CGImageGetDataProvider( imageRefOne );
CFDataRef imageRefOneDataRef = CGDataProviderCopyData( dprov );

/*
imageRefOneDataRef and the 2 CGImageRef's are ok, checked in XCode  
debugger.

could be copied into an NSBitmapImageRep object and looks as expected
*/

CFHashCode hcOne = CFHash(imageRefOneDataRef); /* Returns ALWAYS 0 */
CFHashCode hcTwo = CFHash(imageRefTwoDataRef); /* Returns ALWAYS 0 */

BOOL isEqual = CFEqual(imageRefOneDataRef, imageRefTwoDataRef);
/* Works ALWAYS as expected: if images are equal it returns equal. if  
not: not*/


/*  SNIP  */

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: Strange problem with CFDataRef, CFHash and CFEqual

2009-06-18 Thread Stefan

*** Sorry for the double post ***

Am 18.06.2009 um 20:43 schrieb Stefan:


Hi,

i have some trouble with some Core funtions and are out of ideas
(after a whole day of searching, debugging and docs-reading)

The problem could be simple described:

I have 2 CGImageRef 'objects' which i have to compare.
That is working fine with the CFEqual function.
But i also need a valid (valid per contract) HashCode too.

The problem is now that these hashcodes are _always_ 0

To make this more visual i have appended  a little code snipped below.
Because i really have any further ideas i need some help with this.


Much thanks in advance.
Stefan


/*  SNIP  */

(Yes, CoreFoundation.h is included)
CGImageRef imageRefOne;
CGImageRef imageRefTwo;

/.../

CGDataProviderRef dprov = CGImageGetDataProvider( imageRefOne );
CFDataRef imageRefOneDataRef = CGDataProviderCopyData( dprov );

/*
imageRefOneDataRef and the 2 CGImageRef's are ok, checked in XCode  
debugger.

could be copied into an NSBitmapImageRep object and looks as expected
*/

CFHashCode hcOne = CFHash(imageRefOneDataRef); /* Returns ALWAYS 0 */


BOOL isEqual = CFEqual(imageRefOne, imageRefTwo); /* Works ALWAYS as  
expected: if images are equal it returns equal. if not: not*/


/*  SNIP  */___

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/stefan%40wammel.com

This email sent to ste...@wammel.com




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: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread BJ Homer
>
>
> In this particular instance, don't forget that Spotlight importers can
> live in ~/Library/Spotlight as well as within app bundles in
> ~/Applications.  Any answer that MDSchemaCopyAllAttributes() would
> give you when running as root might be incorrect for the user who's
> actually the results.
>
> --Kyle Sluder


Interesting. So what you're saying is that the schema is actually defined on
a per-user basis, depending on what applications and spotlight importers are
installed for that user?  Shouldn't root, though, still be able to list the
schema provided by apps in /Applications and importers in /Library/Spotlight
Importers?

-BJ
___

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: Strange problem with CFHash and CFEqual

2009-06-18 Thread David Duncan

On Jun 18, 2009, at 11:39 AM, Stefan wrote:


I have 2 CGImageRef 'objects' which i have to compare.
That is working fine with the CFEqual function.
But i also need a valid (valid per contract) HashCode too.

The problem is now that these hashcodes are _always_ 0



A 0 hash code is valid (if somewhat useless). It just puts them all in  
the same bucket. If you want a better hash code, then you would have  
to implement that yourself (I would probably do something with the  
width, height, rowbytes and maybe some other parameters of the image.

--
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 arch...@mail-archive.com


Re: Group CGAffineTransform Animations?

2009-06-18 Thread WT

On Jun 18, 2009, at 8:19 PM, David Duncan wrote:


On Jun 18, 2009, at 11:01 AM, WT wrote:

Ultimately, I have some rectangular area on the 2D screen of an  
iPhone or a Mac, and it has a center point (which, I understand,  
doesn't *have* to be halfway through the bounds), whose coordinates  
are measured in the coordinate system of the rectangle's superview.  
I then apply a translation to this rectangle and it ends up  
somewhere else on that screen. Assuming that the rectangle's  
superview was not translated along as well, I cannot see how the  
coordinates of the rectangle's center would not have changed.



Your confusing the geometric center of the view's rectangle with the  
center property of the view. Specifically in code if you do this:


CGPoint c = view.center;
view.transform = CGAffineTransformMakeTranslation(20, 20);
CGPoint visualCenter = CGPointMake(CGRectGetMidX(view.frame),  
CGRectGetMidY(view.frame));

CGPoint c2 = view.center;

Then you will find that c == c2, c != visualCenter, and c2 !=  
visualCenter.


This is why using translations for transforms is very confusing. You  
expect the center of the view to change, but it does not. This is by  
design.


Ok, simple enough. But, then, IMHO, "center" is a terrible name for  
the view.center property.


Wagner
___

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: Manually updating a data bound value of a bound text field

2009-06-18 Thread Matt Neuburg
On Thu, 18 Jun 2009 07:49:15 -0700, Ramakrishna Vavilala
 said:
>I have a window (displayed as a sheet) with a text field and some
>other controls. I can not set the binding mode to continuous so I use
>non continuous binding. Everything works fine as long as I press tab
>and switch to a different control. However when the the text field is
>the key view and I press OK button, then the value of the text field
>does not get reflected in the property to which it is bound. I want to
>make sure that when the user clicks OK button the property value is
>updated. How can I do that apart from making the binding continuous?

Have the OK button set the window's first responder to nil? m.

-- 
matt neuburg, phd = m...@tidbits.com, 
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
http://www.tidbits.com/matt/default.html#applescriptthings



___

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: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread Benjamin Stiglitz

Why is the privileged process asking Spotlight for anything?  Try to
factor as much code as possible out of your privileged tool.


This is the root tool that powers the Mozy backup product.  One of  
the features is that users can specify queries to determine which  
files to back up.  However, it needs to find all files across the  
system, and not just the users files.  Hence, our backup utility has  
to run as root.  Part of our query stuff needs to have access to the  
list of spotlight attributes for optimization reasons.


You can pass it in from the UI process, then. Like Kyle was alluding  
to, the tool should do as little as possible with privilege. If all  
you really need privileges for is file enumeration and copying, then  
that’s all you should do. You can use IPC to filter in the main  
process with the full complement of libraries available to you.


-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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Michael Ash
On Thu, Jun 18, 2009 at 1:59 PM, Erik Buck wrote:
> You can also instantiate an array and add objects to the array within IB.  
> Then you only need an outlet instance variable to reference the array and not 
> separate instance variables for all of the user interface objects.  See 
> "Foundation Collections Palette"  You can populate the array  entirely within 
> IB. Make any target/action connections in IB.
> http://www.geocities.com/kritter_cocoadev/

Since the last update on that page is from the Panther era, and since
Leopard's IB3 completely broke backwards compatibility with IB2
plugins, I'd say the chances of the Foundation Collections Palette
still working are approximately zero.

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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Kyle Sluder
On Thu, Jun 18, 2009 at 1:45 PM, Michael Ash wrote:
> Since the last update on that page is from the Panther era, and since
> Leopard's IB3 completely broke backwards compatibility with IB2
> plugins, I'd say the chances of the Foundation Collections Palette
> still working are approximately zero.

I started working on replacements but they never got anywhere.  Please
file an enhancement request; this could be very useful.

--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: advice on background process

2009-06-18 Thread Jerry Krinock


On 2009 Jun 18, at 06:42, Rick C. wrote:

thanks again.  yes after reviewing everything that would seem to be  
the best way to go for me.  am i on the right track thinking i could  
write a foundation tool maybe using fsevents to screen the changes  
of a directory and then if necessary pass along the info and/or  
launch my main app?  if so i'll probably go that route.


I can't answer this for sure without knowing exactly what kind of  
"change" your looking for.


But I don't believe you need FSEvents.  FSEvents notifies you when  
something has changed.  launchd launches your tool when something has  
changed.  You see, they do the same thing.  I would suspect that  
launchd uses FSEvents under the hood.


Knowing that there has been "a change", your tool will use  
NSFileManager methods to determine what is in the subject directory  
now, and if necessary, compare it with a record you have stored  
somewhere of what was in the subject directory previously.  This  
record can be stored in User Defaults, a file in Application Support,  
etc.

___

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] BWToolkit 1.2 - IB Plugin

2009-06-18 Thread Brandon Walkin

Hi all,

I've just released version 1.2 of BWToolkit with three new additions:  
a gradient box with customizable border and inset lines, a styled text  
field that lets you apply a gradient and a shadow to text, and a  
hyperlink button to link text or images to URLs. I've also added Snow  
Leopard support and various fixes and improvements.


For those who haven't heard of BWToolkit, it's a BSD licensed plugin  
for Interface Builder that contains commonly used UI elements and  
other objects designed to simplify Mac development.


Learn more and download here: http://brandonwalkin.com/bwtoolkit/

-Brandon
___

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


File-picker dialog?

2009-06-18 Thread Mac First

Sorry to be so out of touch -- it's been a while...

Is NavServices still the preferred way to put up, say, a file-picker  
dialog?  That is, is The Cocoa Way to do this:


OSStatus NavCreateChooseFileDialog ( const NavDialogCreationOptions  
*inOptions, NavTypeListHandle inTypeList, NavEventUPP inEventProc,  
NavPreviewUPP inPreviewProc, NavObjectFilterUPP inFilterProc, void  
*inClientData, NavDialogRef *outDialog );


...Or is there some more Cocoa-y way to do things, now-a-days?  That  
seems awfully Carbon/ancient-history.  I'm writing an app for "Leopard  
& later, only."


Pointers to sample code, tutorials, stuff I need to read...?

Thanks!

___

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: File-picker dialog?

2009-06-18 Thread Luke the Hiesterman

NSOpenPanel.

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSOpenPanel_Class/Reference/Reference.html
http://developer.apple.com/documentation/Cocoa/Conceptual/AppFileMgmt/Tasks/UsingAnOpenPanel.html#/ 
/apple_ref/doc/uid/2777


Luke


On Jun 18, 2009, at 2:39 PM, Mac First wrote:


Sorry to be so out of touch -- it's been a while...

Is NavServices still the preferred way to put up, say, a file-picker  
dialog?  That is, is The Cocoa Way to do this:


OSStatus NavCreateChooseFileDialog ( const NavDialogCreationOptions  
*inOptions, NavTypeListHandle inTypeList, NavEventUPP inEventProc,  
NavPreviewUPP inPreviewProc, NavObjectFilterUPP inFilterProc, void  
*inClientData, NavDialogRef *outDialog );


...Or is there some more Cocoa-y way to do things, now-a-days?  That  
seems awfully Carbon/ancient-history.  I'm writing an app for  
"Leopard & later, only."


Pointers to sample code, tutorials, stuff I need to read...?

Thanks!

___

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/luketheh%40apple.com

This email sent to luket...@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


Re: File-picker dialog?

2009-06-18 Thread Dave Keck
NSOpenPanel is what you're looking for.
___

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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Greg Guerin

Chilton Webb wrote:

Is there a way to add a tag an IB object in such a way that it is  
not visible to the user, but in such a way that I could reference  
it from my app?



Maybe the -tag method: it returns a 32-bit integer..  It's settable  
in IB as the control's tag value.  I don't know if iPhone has it.


Since it's only 32-bits I don't know how useful it would be for your  
intended purpose.  But IB has no inherent use for it, and it is  
readable from the app.


  -- GG
___

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


There is an equivalent to NSLocalizedString with selectable locale?

2009-06-18 Thread Giacomo Tufano
I have a CocoaTouch app that's localized using NSLocalizedString() and  
NSLocalizedStringFromTable().
I would like to give the user the option to change language on some  
part of the program but I couldn't find any call or function for  
selecting the locale into the program. I found that I can get the  
current preferred locale with [NSUserDefaults standardUserDefaults]  
@"AppleLanguages" key, but that's all...


Should I rewrite the routines to read directly from the string tables  
or there is some function/method I didn't find to do this?


TIA,
gt

___

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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Chilton Webb

Hi Greg!

Thanks for writing back.

On Jun 18, 2009, at 4:52 PM, Greg Guerin wrote:
Is there a way to add a tag an IB object in such a way that it is  
not visible to the user, but in such a way that I could reference  
it from my app?
Maybe the -tag method: it returns a 32-bit integer..  It's settable  
in IB as the control's tag value.  I don't know if iPhone has it.


Since it's only 32-bits I don't know how useful it would be for your  
intended purpose.  But IB has no inherent use for it, and it is  
readable from the app.


It *would* be useful, but IB doesn't let you set it to a string in  
Cocoa. It's limited to numeric values, which makes it less useful for  
humans.


For a bit of perspective, this is doable in *CARBON* apps, via the  
'Command' attribute in Interface Builder. You can only use 4  
characters, but it's damned useful. It's commonly used to create  
interfaces that don't require hard linkage between the code and the  
view. Somewhat ironically, despite that MVC is the law of the land in  
Cocoa, this option is not available to Cocoa apps.


I was sure I was mistaken about this! Any other suggestions?

Thanks!
-Chilton
___

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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Greg Guerin

Chilton Webb wrote:

It *would* be useful, but IB doesn't let you set it to a string in  
Cocoa. It's limited to numeric values, which makes it less useful  
for humans.


For a bit of perspective, this is doable in *CARBON* apps, via the  
'Command' attribute in Interface Builder. You can only use 4  
characters, but it's damned useful. It's commonly used to create  
interfaces that don't require hard linkage between the code and the  
view. Somewhat ironically, despite that MVC is the law of the land  
in Cocoa, this option is not available to Cocoa apps.


I was sure I was mistaken about this! Any other suggestions?



Create an app where you enter the 4-char text you want, and it shows  
you the decimal number and even puts it on the pasteboard, so you  
simply paste it in IB.  The same app can have the inverse function:  
enter or paste a decimal number, see the 4-char code.


This is surprisingly close to the Currency Converter illustrative app  
for introducing Cocoa and IB.  It shouldn't be that hard to build.


A useful improvement would make it work via the Services menu (read  
current selection as input, convert to alternate form, paste).


  -- GG

___

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


continuous spell checking, NSTextView / field editor, document tag

2009-06-18 Thread kvic...@pobox.com
i would like to have continuous spell checking available for many of 
my text fields and table/outline cells. i realize that this can be 
accomplished by call -[NSTextView setContinuousSpellCheckingEnabled:] 
for the appropriate field editor. what i don't understand is how to 
specify the spell document tag that should be used by the NSTextView. 
NSTextView has -spellCheckerDocumentTag to get the spell document tag 
used by the text view, but i don't see a way to set it. have i missed 
something?


from the archives 
(http://www.cocoabuilder.com/archive/message/cocoa/2006/10/24/173279) 
states:



As-you-type spellchecking is not so easily
overridden in Tiger and before; there will be more control available
in Leopard.


did this control make it into leopard? if so, where is it?

i have a multi-document app, and thus, i would like to be able to use 
a document specific dictionary for each document, and thus, i need to 
be able to specify the spell document tag to be used for my text 
fields and table/outline cells.


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


Re: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Ricky Sharp


On Jun 18, 2009, at 5:15 PM, Chilton Webb wrote:


Hi Greg!

Thanks for writing back.

On Jun 18, 2009, at 4:52 PM, Greg Guerin wrote:
Is there a way to add a tag an IB object in such a way that it is  
not visible to the user, but in such a way that I could reference  
it from my app?
Maybe the -tag method: it returns a 32-bit integer..  It's settable  
in IB as the control's tag value.  I don't know if iPhone has it.


Since it's only 32-bits I don't know how useful it would be for  
your intended purpose.  But IB has no inherent use for it, and it  
is readable from the app.


It *would* be useful, but IB doesn't let you set it to a string in  
Cocoa. It's limited to numeric values, which makes it less useful  
for humans.


For a bit of perspective, this is doable in *CARBON* apps, via the  
'Command' attribute in Interface Builder. You can only use 4  
characters, but it's damned useful. It's commonly used to create  
interfaces that don't require hard linkage between the code and the  
view. Somewhat ironically, despite that MVC is the law of the land  
in Cocoa, this option is not available to Cocoa apps.


I was sure I was mistaken about this! Any other suggestions?



As was suggested, probably a utility app.

I know when I moved one of my apps from Carbon to Cocoa, I also  
created IB palettes (later plugins) for all the UI.  I put conversion  
APIs around the 'tag' attributes.  I could then enter/display four- 
char codes.


___
Ricky A. Sharp mailto:rsh...@instantinteractive.com
Instant Interactive(tm)   http://www.instantinteractive.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


[RFC] NSScaleRect for AppKit Drawing Primitives

2009-06-18 Thread Grant Erickson
While a similar effect could be achieved using NSAffineTransforms, it seems
like the following API is noticeably absent from the NSGeometry.h AppKit
drawing primitives and one I would venture many have included in their own
Cocoa toolkits:

typedef enum {
NSBottomLeftPoint,
NSMiddleLeftPoint,
NSTopLeftPoint,
NSTopCenterPoint,
NSTopRightPoint,
NSMiddleRightPoint,
NSBottomRightPoint,
NSBottomCenterPoint,
NSMiddleCenterPoint
} NSReferencePoint;

extern NSRect
NSScaleRect(NSRect aRect,
CGFloat dW,
CGFloat dH,
NSReferencePoint reference);

Description:
  NSScaleRect scales the specified rectangle by the specified width and
  height scalars about the specified reference point.

  See http://www.tc.umn.edu/~erick205/NSScaleRect.pdf for a graphical
  illustration.

Implementation:
  Trivial and effectively amounts to:

  NSRect scaledRect;
  CGFloat dx, dy;

  switch (reference) {

  ...

  }

  scaledRect.origin = aRect.origin;
  scaledRect.size = NSMakeSize(NSWidth(aRect) * dW,
   NSHeight(aRect) * dH);

  return (NSOffsetRect(scaledRect, dx, dy));

Comments on this API, particularly as it concerns inclusion in some future
version of AppKit? Is this worth filing a Radar enhancement request for?

Regards,

Grant


___

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: Enter Key Behavior in NSTableView

2009-06-18 Thread Raleigh Ledet
I don't think this is normal. When a field editor is up, the Return  
should go to the Field Editor's keyDown: method, not TV. (for both  
cases)


Is your File's Owner overriding textShouldEndEditing:? and preventing  
the Field Editor from ending?


-raleigh

On Jun 17, 2009, at 4:03 PM, Chris Tracewell wrote:

I have a subclass of NSTableView which I have implemented keyDown to  
pick up delete and enter key presses. When the TV is bound to an  
array controller it works perfectly, I can detect keyDowns for the  
above mentioned and as a bonus when the user presses "Enter" or  
"Return" the field editor ends editing. Thats what I want.


The problem is that as soon as I hook up my File's Owner as the  
delegate for the TV the Field Editor no longer detects the Return  
and Enter key strokes. Is this normal? If so where do I look in docs  
to re-establish this behavior?

___

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/ledet%40apple.com

This email sent to le...@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


Re: Enter Key Behavior in NSTableView

2009-06-18 Thread Chris Tracewell

raleigh,

I am not overriding textShouldEndEditing, but your suggestion did lead  
me to find that my File's Owner's superclass is implementing:


-(BOOL)control:(NSControl*)control textView:(NSTextView*)textView  
doCommandBySelector:(SEL)commandSelector


In there I had an if statement that was catching the insertNewLine:  
selector for every control in the view when I only intended it for  
some textFields.


Thanks for the help - it is working now.


Chris

On Jun 18, 2009, at 5:22 PM, Raleigh Ledet wrote:

I don't think this is normal. When a field editor is up, the Return  
should go to the Field Editor's keyDown: method, not TV. (for both  
cases)


Is your File's Owner overriding textShouldEndEditing:? and  
preventing the Field Editor from ending?


-raleigh

On Jun 17, 2009, at 4:03 PM, Chris Tracewell wrote:

I have a subclass of NSTableView which I have implemented keyDown  
to pick up delete and enter key presses. When the TV is bound to an  
array controller it works perfectly, I can detect keyDowns for the  
above mentioned and as a bonus when the user presses "Enter" or  
"Return" the field editor ends editing. Thats what I want.


The problem is that as soon as I hook up my File's Owner as the  
delegate for the TV the Field Editor no longer detects the Return  
and Enter key strokes. Is this normal? If so where do I look in  
docs to re-establish this behavior?

___

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/ledet%40apple.com

This email sent to le...@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


Incompatible managed object model versions

2009-06-18 Thread Lynn Barton
I am programming a Core Data application, and testing it from time to  
time by importing a small amount of data. This was going well for a  
while, but after the latest changes to the data model the application  
produces the error message "The managed object model version used to  
open the persistent store is incompatible with the one that was used  
to create the persistent store."


I don't think that I saved any data while testing the app, but perhaps  
I did. Please  help me rescue this application.


Thanks. Lynn.
___

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: MDSchemaCopyAllAttributes() returning nil

2009-06-18 Thread Kyle Sluder
On Thu, Jun 18, 2009 at 11:04 AM, Dave DeLong wrote:
> So, how can a root program get a complete list of Spotlight attributes?

I don't think this is quite the question you want to ask.

1) As I mentioned before, the root program shouldn't need a list of
Spotlight attributes.
2) Do you really want to be using Spotlight for this?  Spotlight won't
find anything on removable media (except attached hard disks) or
anything the user doesn't want Spotlight to index.
3) What about users who use FileVault, or perhaps store their
sensitive information on an encrypted disk image?  I'm required to
store my company's source code on an encrypted image on my laptop.

As a producer of backup software, I'm sure that you would prefer your
software to err on the side of over- rather than under-protection.
Hard drive space is cheap; lost data is invaluable.  I'd suggest
seriously reconsidering your use of Spotlight for this task.  All it
takes is one misplaced mdimporter and the user isn't backing up files
they think they are.

Don't forget, there's always the mdimport(1) tool that you can use to
play around with Spotlight.  Which is coincidentally why I could never
use this feature of your product: we ship Spotlight importers as part
of our products, and part of the development process involves blowing
away the metadata store and ensuring that our importers are still able
to import all the data.

--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: Incompatible managed object model versions

2009-06-18 Thread Kyle Sluder
On Thu, Jun 18, 2009 at 6:19 PM, Lynn Barton wrote:
> I don't think that I saved any data while testing the app, but perhaps I
> did. Please  help me rescue this application.

This message means that the managed object model changed.  Rather than
lossily loading pieces of the persistent store, Core Data simply
refuses to load persistent stores that contain managed objects whose
entities are different or nonexistent in the managed object model.
You'll need to revert your managed object model, and if you want to
continue using your data set you'll need to write a mapping model:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreDataVersioning/Introduction/Introduction.html

Hopefully you're following best practices and have a known working
managed object model in your version control system.

--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 fill rectangle under vertical scroller?

2009-06-18 Thread Sumin Kim
Thanks for the information. Those frameworks seems very helpful for the
future even though they are not solving my problem right now. Incidentally,
I found out that I know the writer of HIMBIkAppKit personally. ;-)

Thanks,


On Thu, Jun 18, 2009 at 6:15 AM, Scott Andrew wrote:

> Have you looked at a couple of frameworks that already do this? The two i
> can think of fare.  BWToolkit and HMBlkAppKit. Source is available for both.
>
> Scott
>
>
___

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 fill rectangle under vertical scroller?

2009-06-18 Thread Sumin Kim
>
>
>
> You need to place a view here and do the custom drawing in the view. To
> place the view, you need to subclass NSScrollView and override the -tile
> method to place the view in that corner. The scrollview subclass will also
> typically own the custom view.
>
> Here's an example from the archives that will do what you want:
>
> http://www.cocoabuilder.com/archive/message/cocoa/2001/6/29/21070
>
> --Graham
>
>
>
Thanks for your information. I read your linked article, and tried to do the
same thing. But, I am still in the problem.
Where I want to draw a color is the area under vertical scroller but for the
some reason, it seems that my new view is drawn at top of the vertical
scroller. the area under the vertical scroller and right to horizontal
scroller still remains white. I tried to set different origin and frame size
for the view that is supposed to be drawn the area, but the results have not
changed.

I just want to change the color of this area.
How can I?
___

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


"Tokenizing" NSTextView content

2009-06-18 Thread Rob Keniger

Hi,

I need to display a text view which will contain HTML-like syntax and  
allow the user to drag "objects" into the view.


I have been able to use NSTextAttachment to handle the display of the  
dragged objects just fine, but what I want to do is restrict the user  
from dragging the object anywhere except between the "tags" in the  
document.


For instance, say the content of the NSTextView is this:



I want to allow the user to drag the object between the tags:

[object]

But prevent them from dragging into the text of the tag:



What would be the best way to handle this? Ideally, when the text view  
has focus I'd also like to prevent the cursor from being placed  
anywhere except between the tags, so the user can't actually edit the  
content of the tags, but this is less important.


I guess what I'm looking for is a way to tokenize the content a bit  
like the way NSTokenField does, but for larger amounts of text.


--
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/archive%40mail-archive.com

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


moderator Re: [RFC] NSScaleRect for AppKit Drawing Primitives

2009-06-18 Thread Scott Anguish

radar is the only way to get these types of things addresssed.

mind you, there are far less trivial (your word) thinks that time  
could be spent on.



___

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: What is the best way to store some kind of identifying string in an interface builder object?

2009-06-18 Thread Andy Lee

On Jun 18, 2009, at 4:45 PM, Michael Ash wrote:
On Thu, Jun 18, 2009 at 1:59 PM, Erik Buck  
wrote:

[...]
You can populate the array  entirely within IB. Make any target/ 
action connections in IB.

http://www.geocities.com/kritter_cocoadev/


Since the last update on that page is from the Panther era, and since
Leopard's IB3 completely broke backwards compatibility with IB2
plugins, I'd say the chances of the Foundation Collections Palette
still working are approximately zero.


Way back in the NextStep days, I used an NSMatrix as a sort of poor  
man's array.  I'd drag a text field or a form into the nib, stretch it  
out to as many elements as I wanted, and make outlet connections from  
the cells to the elements of my array.  I'd type descriptions of the  
array elements into the text fields, kind of like comments.  Once the  
nib was loaded, it only took a few lines of code to construct a real  
array and discard the NSMatrix.  The same approach could be used to  
construct a dictionary.


--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 arch...@mail-archive.com


Re: How to fill rectangle under vertical scroller?

2009-06-18 Thread Quincey Morris

On Jun 18, 2009, at 19:23, Sumin Kim wrote:

Thanks for your information. I read your linked article, and tried  
to do the

same thing. But, I am still in the problem.
Where I want to draw a color is the area under vertical scroller but  
for the

some reason, it seems that my new view is drawn at top of the vertical
scroller. the area under the vertical scroller and right to horizontal
scroller still remains white. I tried to set different origin and  
frame size
for the view that is supposed to be drawn the area, but the results  
have not

changed.

I just want to change the color of this area.
How can I?


Did you try [scrollView setDrawsBackground: NO]?

The area you want to draw is normally filled with white by the scroll  
view, and that's probably drawing over the top of your custom view. If  
you tell the scroll view not to draw its background, your view should  
show through.


If it still doesn't show up, you'll need to actually debug your code.  
Is your view in the right place in the window? If so, is it hidden? If  
not, is it being drawn underneath something else? You'll need to look  
for an answer, instead of just coming back to this list and  
complaining that your code doesn't work.



___

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: Incompatible managed object model versions

2009-06-18 Thread Lynn Barton


On Jun 18, 2009, at 6:27 PM, Kyle Sluder wrote:

On Thu, Jun 18, 2009 at 6:19 PM, Lynn Barton  
wrote:
I don't think that I saved any data while testing the app, but  
perhaps I

did. Please  help me rescue this application.


This message means that the managed object model changed.  Rather than
lossily loading pieces of the persistent store, Core Data simply
refuses to load persistent stores that contain managed objects whose
entities are different or nonexistent in the managed object model.
You'll need to revert your managed object model, and if you want to
continue using your data set you'll need to write a mapping model:
http://developer.apple.com/documentation/Cocoa/Conceptual/CoreDataVersioning/Introduction/Introduction.html

Hopefully you're following best practices and have a known working
managed object model in your version control system.

--Kyle Sluder


Thanks, Kyle. I would like to try just deleting the existing  
persistent store and letting a new one be created based on the current  
model. Where would I find the existing persistent store?

Lynn Barton
___

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: Incompatible managed object model versions

2009-06-18 Thread Quincey Morris

On Jun 18, 2009, at 20:44, Lynn Barton wrote:

Thanks, Kyle. I would like to try just deleting the existing  
persistent store and letting a new one be created based on the  
current model. Where would I find the existing persistent store?


Uh, it's wherever you put it. If your application is  
NSPersistentDocument-based, the document file *is* the persistent  
store. If you application isn't document-based, your application  
delegate probably contains a method that specifies the path to the  
persistent store. (In the Xcode Core Data application template, the  
boilerplate code puts it in a folder inside the Application Support  
folder.)



___

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