Re: install_name_tool

2008-06-20 Thread Martin
Thanks for your answers but it's still not working here. Plus I don't  
really see why I should use -id option since what I really want to  
do is *change* one of the paths.

Back to my Foo framework:

$ otool -L Foo.framework/Foo
	/Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo  
(compatibility version 1.0.0, current version 1.0.0)

...

$ install_name_tool -change /Users/martin/Library/Frameworks/ 
Foo.framework/Versions/A/Foo @executable_path../../Frameworks/ 
Foo.framework/Versions/A/Foo Foo.framework/Foo


$ otool -L Foo.framework/Foo
	/Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo  
(compatibility version 1.0.0, current version 1.0.0)

...

Am I typing something wrong? Does it work on your computer?
There are no error messages given by install_name_tool, it just  
silently does nothing...


Martin.

On Jun 19, 2008, at 11:56 PM, Laurent Cerveau wrote:



On Jun 19, 2008, at 11:02 PM, Kyle Sluder wrote:

On Thu, Jun 19, 2008 at 4:40 PM, Martin [EMAIL PROTECTED]  
wrote:
And as you can see, nothing has changed and the first line has  
certainly not

been replaced by bla. What am I doing wrong?


Shouldn't you be using the -id flag, not -change?



I usually do both of them (for framework embedding). E.g to make a  
framework embeddable


 install_name_tool -change /Library/Frameworks/$EXECUTABLE_PATH  
@executable_path/../Frameworks/$EXECUTABLE_PATH $EXECUTABLE_NAME
 install_name_tool -id @executable_path/../Frameworks/ 
$EXECUTABLE_PATH $EXECUTABLE_NAME


I think one option is about install path while the other is about  
identification


laurent



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: install_name_tool

2008-06-20 Thread Jean-Daniel Dupas
You don't want to change the path, you want to change the id of your  
library.


-change is intended to be used to change the path of a dependent  
library in an other binary.


install_name_tool -id @executable_path../../Frameworks/Foo.framework/ 
Versions/A/Foo Foo.framework/Foo


But as I said, it's easier to change that in your Xcode build settings  
instead.



Le 20 juin 08 à 09:12, Martin a écrit :

Thanks for your answers but it's still not working here. Plus I  
don't really see why I should use -id option since what I really  
want to do is *change* one of the paths.

Back to my Foo framework:

$ otool -L Foo.framework/Foo
	/Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo  
(compatibility version 1.0.0, current version 1.0.0)

...

$ install_name_tool -change /Users/martin/Library/Frameworks/ 
Foo.framework/Versions/A/Foo @executable_path../../Frameworks/ 
Foo.framework/Versions/A/Foo Foo.framework/Foo


$ otool -L Foo.framework/Foo
	/Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo  
(compatibility version 1.0.0, current version 1.0.0)

...

Am I typing something wrong? Does it work on your computer?
There are no error messages given by install_name_tool, it just  
silently does nothing...


Martin.

On Jun 19, 2008, at 11:56 PM, Laurent Cerveau wrote:



On Jun 19, 2008, at 11:02 PM, Kyle Sluder wrote:

On Thu, Jun 19, 2008 at 4:40 PM, Martin [EMAIL PROTECTED]  
wrote:
And as you can see, nothing has changed and the first line has  
certainly not

been replaced by bla. What am I doing wrong?


Shouldn't you be using the -id flag, not -change?



I usually do both of them (for framework embedding). E.g to make a  
framework embeddable


install_name_tool -change /Library/Frameworks/$EXECUTABLE_PATH  
@executable_path/../Frameworks/$EXECUTABLE_PATH $EXECUTABLE_NAME
install_name_tool -id @executable_path/../Frameworks/ 
$EXECUTABLE_PATH $EXECUTABLE_NAME


I think one option is about install path while the other is about  
identification


laurent



___

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

Please do not post 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/devlists%40shadowlab.org

This email sent to [EMAIL PROTECTED]





smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Binding the enabled property of a NSMatrix instance to wether or not a multiple selection on a array controller is made.

2008-06-20 Thread Eloy Duran

Hi Keary,

Awesome, this indeed works. Thanks a lot!

And about the klunkyness, it does feel a bit that way,
but it's a lot better than not being able to do it :)

Cheers,
Eloy

On 19 jun 2008, at 21:03, Keary Suska wrote:


6/19/08 3:30 AM, also sprach [EMAIL PROTECTED]:


Just wanted to check if I need to explain it differently?
Simple recap: I want a NSMatrix to be disabled when the selection of
the NSArrayController it's bound to returns a multiple selection.


What I will often do in these cases is bind enabled to a keypath  
that I
know will always be non-nil, and use the NSIsNotNil transformer. I  
then set
the No Selection and Multiple Selection placeholders to No.  
May be

kludgey, but it works.

P.S. to be safe, you could also set the NULL placeholder to Yes,  
just in

case null/nil values are possible.


On Jun 18, 2008, at 12:23 PM, Eloy Duran wrote:


Hi list,

I have a NSArrayController and a form (collection of controls) that
displays attributes for a individual object in the array controller.
One attribute is bound to a NSMatrix (radio buttons) with the
Selected Index binding. This works great.

But now I want to disable the NSMatrix when multiple objects in the
array controller are selected.
I have this working with NSTextField, by setting Allows Editing
Multiple Values Selection to false and Conditionally Sets Enabled
to true.
I did the same for the NSMatrix under it's Selected Index binding,
but it doesn't work

I have tried checking/unchecking all different sorts of
combinations, but nothing really helps.
Any suggestions/ideas? Existing code/examples would be great too.



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


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/eloy.de.enige%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: install_name_tool

2008-06-20 Thread Sherm Pendley
On Thu, Jun 19, 2008 at 5:56 PM, Laurent Cerveau [EMAIL PROTECTED] wrote:

 On Jun 19, 2008, at 11:02 PM, Kyle Sluder wrote:

 On Thu, Jun 19, 2008 at 4:40 PM, Martin [EMAIL PROTECTED] wrote:

 And as you can see, nothing has changed and the first line has certainly
 not
 been replaced by bla. What am I doing wrong?

 Shouldn't you be using the -id flag, not -change?

 I usually do both of them (for framework embedding). E.g to make a framework
 embeddable

Usually? I smell a cargo cult.

  install_name_tool -change /Library/Frameworks/$EXECUTABLE_PATH
 @executable_path/../Frameworks/$EXECUTABLE_PATH $EXECUTABLE_NAME
  install_name_tool -id @executable_path/../Frameworks/$EXECUTABLE_PATH
 $EXECUTABLE_NAME

 I think one option is about install path while the other is about
 identification

The man page says exactly what the options are for, no thought
required. :-) The -id option sets the install name for a framework.
The -change option is used when you want to modify something that's
been linked to the framework.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFKit guidance

2008-06-20 Thread Torsten Curdt


On Jun 20, 2008, at 02:40, John Calhoun wrote:


On Jun 19, 2008, at 4:35 PM, Torsten Curdt wrote:
I would like to convert a PDF of any size so it fits to A4/Letter.  
I would also like to reduce it to gray scale. This all without  
displaying anything.


PDFKit gives you -[PDFPage setBounds:forBox] which would easily give  
you A4/Letter size if that is what you specified.  However, no  
scaling is done.  A PDFPage subclass could be fairly easily written  
that would do the scaling though


Look at QuartzFilters (in Quartz.framework) — this is where you can  
create a filter for converting to greyscale.  PDFDocument allows you  
to pass in a QuartzFilter in the save methods (in the options  
dictionary) if you want to apply this Quartz Filter on saving.


So, PDF Kit can I think do what you want.


Awesome! Thanks for the pointers, John.

cheers
--
Torsten___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFKit guidance

2008-06-20 Thread Torsten Curdt


On Jun 20, 2008, at 03:35, Joel Norvell wrote:


Torsten,

John Calhoun wrote:


So, PDF Kit can I think do what you want.


I stand corrected!

But (to salvage a little face :-)


lol ...don't worry


you can't go wrong by reading the Cocoa
Drawing Guide.


Surely will read through that. Because frankly speaking I didn't think  
this was Quartz related.


cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: install_name_tool

2008-06-20 Thread Sherm Pendley
On Fri, Jun 20, 2008 at 3:12 AM, Martin [EMAIL PROTECTED] wrote:

 Thanks for your answers but it's still not working here. Plus I don't really
 see why I should use -id option since what I really want to do is *change*
 one of the paths.

Straight from man install_name_tool:

   -change old new
  Changes the dependent shared library install name old to new  in
  the specified Mach-O binary.  More than one of these options can
  be specified.  If the Mach-O binary does  not  contain  the  old
  install  name  in  a  specified  -change  option  the  option is
  ignored.

   -id name
  Changes the shared library  identification  name  of  a  dynamic
  shared  library  to name.  If the Mach-O binary is not a dynamic
  shared library and the -id option is specified it is ignored.

You *have* read the man page for the tool you're using, right? :-)

 $ install_name_tool -change
 /Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo
 @executable_path../../Frameworks/Foo.framework/Versions/A/Foo
 Foo.framework/Foo

What you're doing here is, wherever Foo.framework/Foo is *linked to* a
dependent shared library at the first path, change that reference to
refer to the second path instead. That is, the -change option doesn't
change the install name of the target. It changes the target's
references to *other* libraries.

If any applications have linked against your framework using the old
install_name, you could use the -change option to update the apps'
references to your framework.

 There are no error messages given by install_name_tool, it just silently
 does nothing...

That's what it's documented to, when -change is used and
Foo.framework/Foo has no external references to the given path.

As others have suggested, the easiest way to set the install name for
a framework is to get info on the target in Xcode and enter it
there. That's simple, automatic, and painless. That said, if the above
is copy  pasted, and its the same path you tried with the -id option,
you're missing a slash after @executable_path, and looking a directory
too far up the tree. It should be:

install_name_tool -id
@executable_path/../Frameworks/Foo.framework/Versions/A/Foo

Suggested reading:


http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/install_name_tool.1.html


http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html
- especially the section titled Embedding a Private Framework in Your
Application Bundle.

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa can be used to execute arbitrary (privileged) code !

2008-06-20 Thread Jean-Daniel Dupas


Le 20 juin 08 à 06:09, Ken Thomases a écrit :


On Jun 19, 2008, at 10:39 PM, Jens Alfke wrote:

It might not be a bad idea to proactively disarm this vulnerability  
on your own machine(s), as I just did:


	sudo chmod -s System/Library/CoreServices/RemoteManagement/ 
ARDAgent.app/ARDAgent


That's

	sudo chmod -s /System/Library/CoreServices/RemoteManagement/ 
ARDAgent.app/Contents/MacOS/ARDAgent


-Ken


You may also use an exploit that correct the hole, so no sudo  
require ;-)


osascript -e 'tell app ARDAgent to do shell script chmod -s /System/ 
Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/MacOS/ 
ARDAgent'






smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: PDFKit guidance

2008-06-20 Thread Antonio Nunes

On 20 Jun 2008, at 11:07, Torsten Curdt wrote:


you can't go wrong by reading the Cocoa
Drawing Guide.


Surely will read through that. Because frankly speaking I didn't  
think this was Quartz related.


Well, you need to know how to generally draw in Cocoa, and you need to  
know how to take advantage of PDFKit, so both John Calhoun and Joel  
Norvell provided useful pointers.


The scaling is done when a PDFPage needs to be drawn, so you need to  
implement it in your subclass's drawWithBox: method. Use an affine  
transform set up to serve your needs and apply it to the current  
graphics context within the drawWithBox: method before drawing the page.


António


I try to take one day at a time, but sometimes, several days attack me  
all at once!




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFKit guidance

2008-06-20 Thread Torsten Curdt


On Jun 20, 2008, at 13:09, Antonio Nunes wrote:


On 20 Jun 2008, at 11:07, Torsten Curdt wrote:


you can't go wrong by reading the Cocoa
Drawing Guide.


Surely will read through that. Because frankly speaking I didn't  
think this was Quartz related.


Well, you need to know how to generally draw in Cocoa, and you need  
to know how to take advantage of PDFKit, so both John Calhoun and  
Joel Norvell provided useful pointers.


The scaling is done when a PDFPage needs to be drawn, so you need to  
implement it in your subclass's drawWithBox: method. Use an affine  
transform set up to serve your needs and apply it to the current  
graphics context within the drawWithBox: method before drawing the  
page.


Right. The point though is - I don't really want to display it. So I  
did not look into the drawing side of things. But I guess I just read  
up on the Quartz stuff and then get back to you guys (if needed). I  
assume one could also draw in memory - without displaying. Just didn't  
know that's the right direction.


cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Bindings: NSTreeController sends redundant selection keypath KVO notifications

2008-06-20 Thread Milen Dzhumerov

Hi all,

I'm building a 3-pane interface and I have a NSTreeController managing  
the sidebar. My actual content displayed in the main view is bound to  
the selection of the tree controller. When I insert a new object  
into the tree controller (I've disabled selection of inserted  
objects), I can see the new object added and the controller also  
preserves the selection visually. But it actually sends a KVO that  
selection changed - but it has not (even logging the selection object  
returns the same _NSControllerObjectProxy instance). The problem is  
that when selection changes, my main view interpolates / animates it's  
new state - so it fades-in and fades-out without changing its  
appearance. Is there a way to tell the controller not to send KVO  
notifications when the selection has not actually changed? Otherwise I  
would have to keep a flag in the main view whether any changes are  
real or just redundant.


Thanks,
M
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFKit guidance

2008-06-20 Thread Antonio Nunes

On 20 Jun 2008, at 12:47, Torsten Curdt wrote:

The scaling is done when a PDFPage needs to be drawn, so you need  
to implement it in your subclass's drawWithBox: method. Use an  
affine transform set up to serve your needs and apply it to the  
current graphics context within the drawWithBox: method before  
drawing the page.


Right. The point though is - I don't really want to display it. So I  
did not look into the drawing side of things. But I guess I just  
read up on the Quartz stuff and then get back to you guys (if  
needed). I assume one could also draw in memory - without  
displaying. Just didn't know that's the right direction.


Even if you just want to save to file, the drawWithBox: method is  
going to be called. I.o.w. a PDFDocument is rendered when saved to  
file. This is what gives you the opportunity to implement such tricks  
as scaling.


António

---
What you have inside you expresses itself through both your
choice of words and the level of energy you assign to them.
The more healed, whole and connected you feel inside,
the more healing your words will be.

--Rita Goswami
---


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Problems with a Layer backed NSView in a NSScrollView

2008-06-20 Thread Moray Taylor
I've made a bit of progress on this, it's the right way up now, at the main 
layer redraws just fine, however, sublayers disappear when I scroll (they 
reappear when you resize the window, as this is presumably triggering a redraw).

I've put a test app here...

http://s3.amazonaws.com/TempStuff/LayerDebug.zip

Which should be useful to anyone who wants to put a layer backed view into a 
scrollview, and even more helpful for anyone who wants to tell me how to get 
the sublayers to redraw ;-)

Cheers

MT



--- On Thu, 19/6/08, Gordon Apple [EMAIL PROTECTED] wrote:

 From: Gordon Apple [EMAIL PROTECTED]
 Subject: Re: Problems with a Layer backed NSView in a NSScrollView
 To: cocoa-dev@lists.apple.com
 Cc: Moray Taylor [EMAIL PROTECTED]
 Date: Thursday, 19 June, 2008, 10:14 PM
 As I stated in my recent post, I implemented my own
 transform to flip
 the layer since nothing else worked.  That worked, and my
 view is in a
 scrolling window.  What I'm currently having trouble
 with is scaling the
 view.  My window is similar to that in Sketch, with a popup
 scale factor in
 the lower scroll bar.  I've tried a variety of things
 including regenerating
 the CALayers, but so far haven't been able to get the
 layers to scale to the
 coordinates of the underlying view.  Again, I'll
 probably figure it out
 eventually, but this stuff just shouldn't be that
 difficult.  IMHO, there is
 not enough automatic coupling adjustments between the view
 and its layer
 parameters to handle these issues.
 
  I've tried
  
  [[[self pageScrollView] contentView]
 setWantsLayer:YES];
  
  This results in a still flipped display, and very
 badly corrupted, lots of
  artifacts etc
  
  [[self pageScrollView] setWantsLayer:YES];
  
  Nice display, but still flipped.
  
  The transform that used to work before I tried the
 above line makes no
  difference if I set the scrollview to be layer backed.
  
  Any ideas?


  __
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFKit guidance

2008-06-20 Thread Adam R. Maxwell


On Jun 20, 2008, at 7:47 AM, Torsten Curdt wrote:



On Jun 20, 2008, at 13:09, Antonio Nunes wrote:


On 20 Jun 2008, at 11:07, Torsten Curdt wrote:


you can't go wrong by reading the Cocoa
Drawing Guide.


Surely will read through that. Because frankly speaking I didn't  
think this was Quartz related.


Well, you need to know how to generally draw in Cocoa, and you need  
to know how to take advantage of PDFKit, so both John Calhoun and  
Joel Norvell provided useful pointers.


The scaling is done when a PDFPage needs to be drawn, so you need  
to implement it in your subclass's drawWithBox: method. Use an  
affine transform set up to serve your needs and apply it to the  
current graphics context within the drawWithBox: method before  
drawing the page.


Right. The point though is - I don't really want to display it. So I  
did not look into the drawing side of things. But I guess I just  
read up on the Quartz stuff and then get back to you guys (if  
needed). I assume one could also draw in memory - without  
displaying. Just didn't know that's the right direction.


If you want to draw in memory, I think you have to drop down to  
Quartz; using PDFKit would likely be easier, but it looks like you can  
only specify a Quartz filter when saving to a file?.


You should be able to create your own CGPDFContext with  
kCGPDFXDestinationOutputProfile set to an ICC-based grayscale  
colorspace, then draw your PDF pages into that context.  If you use  
CGPDFDocument, be careful when you use CGContextDrawPDFPage, since it  
only scales down, not up; you'll need to add an appropriate scale  
transform to the context (and deal with rotated pages).


--
Adam
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Problems with a Layer backed NSView in a NSScrollView

2008-06-20 Thread Kai

Hi,

I am not sure whether this is relevant for your problem, but it might  
be useful to know that the content view of a scroll view gets a  
CATiledLayer instead of a normal CALayer via [setWantsLayer:YES].


The reasoning is that the content view can be potentially large and  
easily exceed the max size of OpenGL textures. Besides being tiled,  
CATiledLayer updates its contents lazily and in some background  
thread, if I remember correctly. In any case, it is different.


Best
Kai

On 19.6.2008, at 19:54, Moray Taylor wrote:


Thanks for the reply...

I've tried

[[[self pageScrollView] contentView] setWantsLayer:YES];

This results in a still flipped display, and very badly corrupted,  
lots of artifacts etc


[[self pageScrollView] setWantsLayer:YES];

Nice display, but still flipped.

The transform that used to work before I tried the above line makes  
no difference if I set the scrollview to be layer backed.


Any ideas?


--- On Thu, 19/6/08, Scott Anguish [EMAIL PROTECTED] wrote:


From: Scott Anguish [EMAIL PROTECTED]
Subject: Re: Problems with a Layer backed NSView in a NSScrollView
To: [EMAIL PROTECTED]
Date: Thursday, 19 June, 2008, 5:50 PM
have you tried just setting the contentview of the scroll
view to
layer backed?

otherwise you can remvoe the extra transofrm you added to
the view
itself.


On Jun 19, 2008, at 11:38 AM, Moray Taylor wrote:


Hi there!

I've been tearing my hair out trying to figure

this out, so

hopefully someone will take pity!

Basicaly, I've a CALayer-backed custom view, which

works pretty

great, I use a transform to flip it, and it works

fine, the problem

happens when I put it in a NSScrollView

If I put it in the scrollview, and set the

scrollview's

setWantsLayer to YES,  then it works good, very fast

and smooth

scrolling, BUT, it's completely upside down!

If I setWantsLayer to NO, then it's the right way

up, but jerky and

generally doesn't work (i.e. the scroll bar

doesn't do anything in

the scrollview)

I've tried flipping and unflipping the view,

applying a transform to

the CALayer (I had a transform to begin with, removed

it, no

difference), nothing I do will flip it back!

Please help!

Thanks

Moray




__

Sent from Yahoo! Mail.
A Smarter Email

http://uk.docs.yahoo.com/nowyoucan.html

___

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

Please do not post admin requests or moderator

comments to the list.

Contact the moderators at

cocoa-dev-admins(at)lists.apple.com


Help/Unsubscribe/Update your Subscription:


http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com


This email sent to [EMAIL PROTECTED]



 __
Sent from Yahoo! Mail.
A Smarter Email http://uk.docs.yahoo.com/nowyoucan.html
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/kai%40granus.net

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSReponder chain and controllers

2008-06-20 Thread Robert Douglas
Cool.  I'll probably end up doing something more like Cathy  
recommended but forwardInvocation looks  very powerful and useful.

Rob

On 19-Jun-08, at 7:02 PM, Graham Cox wrote:

Sometimes dispatching from First Responder to some other object is  
necessary.


But there is an easy way to do it other than capturing each  
individual message and forwarding it - just use invocation  
forwarding which will do that automatically.


http://www.cocoadev.com/index.pl?NSInvocation

http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_13_section_5.html#/ 
/apple_ref/doc/uid/TP30001163-CH9-SW5




hth,

Graham



On 20 Jun 2008, at 8:19 am, Robert Douglas wrote:

Thanks for the reminder about NSViewController.  I make heavy use  
of the NSArrayController methods but I suppose  I can move most of  
my code over simply by using an outlet and changing self to  
myArrayController.   But having two controllers simply to handle  
menu actions  still doesn't seems elegant, but it is better than  
what I'm doing now.

-Rob

On 19-Jun-08, at 12:33 PM, Cathy Shive wrote:

NSArrayController isn't an NSResponder, so you can't add your  
subclasses to the responder chain.  I think the problem is that  
you should be using NSWindowController and NSViewControllers to  
handle menu actions, not NSArrayController.  Those objects can be  
added to the responder chain so you don't have to worry about  
dispatching anything in your code.


On Jun 19, 2008, at 3:05 PM, Adam Knight wrote:

Add your controllers to the responder chain when appropriate and  
then put the IBAction methods in the relevant controllers.  If  
you duplicate methods (like delete: or cancel:) take care as to  
what order you add them into the chain because the first to  
respond wins (though it can always send it to its next responder  
if it doesn't make sense at the moment, like cancel: without an  
operation running).


Adam Knight
Every man is guilty of all the good he didn't do.  -- Voltaire



On Jun 19, 2008, at 1:20 PM, Robert Douglas wrote:

My code is getting ugly so I suspect I'm doing something wrong.   
I'm trying to hook up menu items in my main menu to actions that  
I've defined in my controllers.  I have a Core Data doc with a  
multiple master-detail view hierarchy, and for testing purposes  
have buttons connected to  a wide variety of methods.  The  
NSArrayController subclasses are not in the responder chain so  
I'm connecting the menu items to the first responder, catching  
the action messages in my document and then dispatch them to the  
correct controller.  That translates into a lot of simple  
dispatch code.  I could move all the intelligence to the  
document level but that strikes me as  equally ugly.  Any  
suggestions?




___

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

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

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

This email sent to [EMAIL PROTECTED]


SSCrypto Framework

2008-06-20 Thread Trygve Inda
I am considering using the SSCrypto Framework:

http://septicus.com/products/opensource/

I would embed a public key in my app and encrypt a data file on our site
that the software needs to download periodically. This is mostly to ensure
that file can not be modified or substituted except by us.

Has anyone used this in a shipping app? Any thoughts or comments about how
well it is implemented and how robust it will be going into the future?

I am trying to avoid a support nightmare.

Thanks,

Trygve


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SSCrypto Framework

2008-06-20 Thread Jason Coco
You could use the keychain for this... I think it would be the easiest  
way to support your application. Either install your certificate into  
the system keychain or provide a keychain file that your application  
accesses exclusively.


On Jun 20, 2008, at 11:45 , Trygve Inda wrote:


I am considering using the SSCrypto Framework:

http://septicus.com/products/opensource/

I would embed a public key in my app and encrypt a data file on our  
site
that the software needs to download periodically. This is mostly to  
ensure

that file can not be modified or substituted except by us.

Has anyone used this in a shipping app? Any thoughts or comments  
about how
well it is implemented and how robust it will be going into the  
future?


I am trying to avoid a support nightmare.

Thanks,

Trygve


___

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

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

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

This email sent to [EMAIL PROTECTED]


Quartz Composer file in IB

2008-06-20 Thread Dan Uff

Hi,
I am trying to make a Cocoa application using a Quartz Composer file  
as output.  Everything works fine when I Simulate the app in IB, but  
when I actually compile the app in Xcode, I get the following error:


__TERMINATING DUE TO UNCAUGHT EXCEPTION___

Any ideas?
-Dan Uff
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SSCrypto Framework

2008-06-20 Thread Jason Coco
Yeah, I understand that... you don't need to actually buy a  
certificate for that. You can just install your certificate that you  
generate yourself and then use it internally to check the integrity of  
your data files or whatever else you'd like to do with it.


On Jun 20, 2008, at 12:04 , Trygve Inda wrote:

You could use the keychain for this... I think it would be the  
easiest

way to support your application. Either install your certificate into
the system keychain or provide a keychain file that your application
accesses exclusively.


Except I don't want to buy a certificate - rather I just need to  
generate a
public/private key on my end and embed the public key. The concern  
is not
that the users know the file is really from us, the concern is from  
our

point of view, that the user can't modify the file.

Trygve




___

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

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

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

This email sent to [EMAIL PROTECTED]


Dragging an item from my table view onto another app.

2008-06-20 Thread Eloy Duran

Hi,

I'm still very new to all the DND stuff, so here goes:

I want to be able to drag an item from my table view onto, for  
instance a texteditor, and have it open the file that the item  
represents.
(Also having it drop on Terminal and inserting the path to the file  
would be nice, but that might be something completely different.)


Some stuff I tried in my table view data source is (RubyCocoa code btw):

  def tableView_writeRowsWithIndexes_toPasteboard(tableView, rows,  
pboard)

pboard.declareTypes_owner([OSX::NSFilenamesPboardType], self)
pboard.setPropertyList_forType(['/etc/hosts'],  
OSX::NSFilenamesPboardType)

true
  end

OR:

  def tableView_writeRowsWithIndexes_toPasteboard(tableView, rows,  
pboard)

url = OSX::NSURL.URLWithString(/etc/hosts)
pboard.addTypes_owner([OSX::NSURLPboardType], nil)
url.writeToPasteboard pboard
true
  end

So the drag operation is initiated, but that's only because I return  
true.
Most stuff I read about dragging from the tableview is about promising  
files,

which, if I understand it correctly, is not what I need.

Does anyone know where in the docs I should RTFM?
Or a OSS app or example that implements such behaviour?

Kind regards,
Eloy
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SSCrypto Framework

2008-06-20 Thread Joel Norvell
Dear Trygve,

Another resource is Wade Tregaskis' Keychain Framework, which I've used.  I've
just taken a cursory glance at the SSCrypto Framework and they seem to overlap.
 Keychain seems more extensive, but the SSCrypto API does look very clean, as
far as it goes.  

Sincerely,
Joel

http://sourceforge.net/projects/keychain/




  
___

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

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

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

This email sent to [EMAIL PROTECTED]


hitTest question

2008-06-20 Thread Eugen Belyakov
Somebody knows how NSView's hitTest method works internally?
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hitTest question

2008-06-20 Thread Shawn Erickson
On Fri, Jun 20, 2008 at 10:29 AM, Eugen Belyakov
[EMAIL PROTECTED] wrote:
 Somebody knows how NSView's hitTest method works internally?

Yes folks inside Apple do.

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSReponder chain and controllers

2008-06-20 Thread Kyle Sluder
On Fri, Jun 20, 2008 at 11:01 AM, Robert Douglas [EMAIL PROTECTED] wrote:
 Cool.  I'll probably end up doing something more like Cathy recommended but
 forwardInvocation looks  very powerful and useful.

I'd say that's almost an understatement.  It's the core of the Cocoa
implementation of the delegate pattern, in fact.  There are certain
cases where it will be invaluable -- and there will be many more cases
where it's the more complicated alternative to a problem that has a
simpler solution.  :)  The key is to understand when you need the
power of the message-oriented aspect of Objective-C.

--Kyle Sluder
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hitTest question

2008-06-20 Thread Kyle Sluder
On Fri, Jun 20, 2008 at 1:29 PM, Eugen Belyakov
[EMAIL PROTECTED] wrote:
 Somebody knows how NSView's hitTest method works internally?

This is not the question you mean to ask.  The question you want to
ask is one or more of the following:
1) I need to implement X, kind of like what -hitTest does.
[Explanation of X here.]  Could anyone with knowledge of how -hitTest
works point me in the right direction?
2) I am having a problem using -hitTest.  [Snippet of your code.]  Can
anyone spot what I might be doing wrong?
3) What does -hitTest do?  I have read the documentation, looked at
sample code, searched the mailing list archives, and done a web
search, but I am still confused.
4) I think I have found a bug/performance problem in -hitTest.  Here
is the output of Shark or Instruments that seems to indicate this is
the case.  Has anyone experienced this problem before?

--Kyle Sluder
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jim Turner
On Fri, Jun 20, 2008 at 10:56 AM, Jesse Grosjean
[EMAIL PROTECTED] wrote:
 I'm having a hard time figuring out how to construct a query. The objects
 involved are:

 Entry
- has many tags

 Tag
- name (string)
- value (string)

 I want to construct searches such as:

- find all entries that have a the tag named priority with the
 value 1.

 I can use [NSPredicate predicateWithFormat:@ANY tags.name = %@, tag.name]
 to find all entries that have a particular tag... but I don't know how to
 also figure in the value.

 I don't need this predicate to work with a database, these queries are all
 just being run in memory, with my own custom model objects (not using Core
 Data). If there is no way to do this in a format string, is there some way
 to do it by directly constructing a predicate object?

 Thanks,
 Jesse
 ___


Jesse,

I'm thinking NSCompoundPredicate is what you're looking for.  You
should be able to do something like this:

NSPredicate *tagPredicate = [NSPredicate predicateWithFormat:@ANY
tags.name = %@, tag.name];
NSPredicate *valuePredicate = [NSPredicate predicateWithFormat:@ANY
tags.value = %@, tag.value];

NSPredicate *combinedPredicate = [NSComparisonPredicate
andPredicateWithSubpredicates:[NSArray arrayWithObjects:tagPredicate,
valuePredicate,nil]];

If the simple predicateWithFormat: predicates don't work,
NSComparisonPredicates will definitely do what you need (I've never
tried creating a compound predicate with predicateWithFormat:
predicates)

-- 
Jim
http://nukethemfromorbit.com
___

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

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

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

This email sent to [EMAIL PROTECTED]


OT: Announcing Pi, the Phoenix iPhone Developer Group

2008-06-20 Thread Brad O'Hearne

All,

Please pardon the fact that this is in regards to a new user group  
based in Phoenix, AZ. While most of you may not be local to Phoenix  
and be able to attend our meetings, please feel free to join anyway,  
to take part in iPhone development discussion. Perhaps your area does  
not have an iPhone user group yet, but if not, there's no reason you  
have to do without -- hook up with our group.


For the better part of the past year, I've been an iPhone user, and  
have kept a close eye on the developments of the iPhone, iPhone web  
development, and the iPhone SDK. I attended the Apple World Wide  
Development Conference (WWDC) last week, and as most of you probably  
know, Apple announced the 3G iPhone and the iPhone SDK 2.0. For those  
unable to attend, I can summarize last week by saying that the iPhone  
is not merely a mobile device; it is essentially a brand new OS  
platform, and the most advanced mobile technology in the world. Apple  
has created a huge opportunity for development, and rarely in a  
technical career does one get the opportunity to get in on the ground  
floor.


I am an independent software developer based in Gilbert, I am  
developing applications for the iPhone to be marketed soon when the  
iPhone Application Store opens. This is a major career direction I've  
been planning, and as such, I have had plans to launch an iPhone  
developer group following the WWDC. That day is here. I'm announcing  
the Phoenix iPhone Developer Group, otherwise known as Pi, due to a  
play on the letters of the group name, and the anticipation of this  
new, exciting direction going on, and on, and on (that's nerd  
humor for those following along...). You may join this group at the  
Google Group at the following URL:


Phoenix iPhone Developer Group: 
http://groups.google.com/group/phoenix-iphone-developer-group

These URLS also resolve to the same location presently:

http://phoenix-iphone.com
http://phoenix-iphone.org

I will be supporting this group through email posts, attempting to  
facilitate meetings (which will be spontaneous, as members are  
available, and at convenient locations), and my blog just opened at:


NeuroFire (blog entitled Burning Embers): http://www.neurofire.com/

I welcome everyone to join. I look forward to collaborating with you,  
and growing the iPhone Developer Community in Phoenix. I would be very  
grateful if you could forward this email to any work associates, and  
other user groups you may be a part of -- spread the word!


Sincerely,

Brad

Brad O'Hearne
NeuroFire

___

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

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

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

This email sent to [EMAIL PROTECTED]


Contract Job for Cocoa Developer in Simi Valley CA

2008-06-20 Thread Jerry Isdale
I am in need of help building a large control system built in Cocoa  
(Xcode 3.0, ObjC 2.0, Leopard, etc).
The company has agreed to hire some contract help for 3-9 months (with  
possible extensions).

Job is in Simi Valley CA - northwest of Los Angeles.

Here is the posting the company is putting out

SOFTWARE ENGINEER
GO LRE

Position Overview:
This software engineer will help support the design, development,  
integrating, and testing of software applications used in support of  
UAS programs.  You will be a part of a team of engineers known for  
their unlimited creativity and can-do environment. You will work with  
the team that built and flew the Helios Prototype to the world record  
altitude of nearly 100,000 ft. You will write, support and validate  
ground control station software for our next endeavor – Global  
Observer. You will work with other software engineers in documentation  
and configuration of ground station software.


We are looking for a team player who thrives on aggressive schedules  
and works well in a RD environment. Your ability to deliver solid  
work on tight schedules will be tested. Because you will work with a  
small team of software engineers, we will rely on your self-motivation  
to work independently and to identify, define, and complete required  
tasks.


Duties  Responsibilities:
·   This software developer will be responsible for the design,  
development, integrating, and testing of software applications used in  
support of UAS programs.

·   Develop and validate software for ground control systems.
·   Develop simulation and interfacing applications for the  
testing of distributed software.
·   Will work closely with a small team of software developers  
supporting on-going R  D programs.


Qualifications  Background:
·   BS in Computer Science, Engineering, or related discipline
·   A minimum of 3-5 years experience in application software  
lifecycle development including:

o  programming and testing
o  configuration management
·   Fluency in C or Objective-C is required
·   Experience with Mac OS X strongly desired, exposure to other  
OS platforms a plus

·   Familiarity with Cocoa strongly desired
·   Experience with object-oriented paradigm strongly desired
·   Experience in software architecture, defining, and documenting  
requirements a plus.

·   Experience with Web Services and SOA a plus
·   Experience in GUI/HMI development a plus
·   Experience integrating 3rd party software packages a plus
·   Technical knowledge and experience with the following  
standards are desired:

o  Serial communications protocols (RS232, USB, etc),
o  Network communications (TCP/IP, UDP, etc)
·   Familiarity with Matlab/Simulink, Real-Time Workshop, and/or  
LabView a plus

·   U.S. Citizenship is required

Inquires should be directed to [EMAIL PROTECTED]


Jerry Isdale
Principal Software Engineer
AeroVironment Inc.
Simi Valley, CA
http://www.avinc.com





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hitTest question

2008-06-20 Thread Eugen Belyakov
I need to implement custom visual component system in OpenGL. And I want to
use hitTest-like behavior ( with rotated frame rectangles and so on) to
determine component under cursor.
Could anyone with knowledge of how -hitTest works point me in the right
direction?


2008/6/20 Kyle Sluder
[EMAIL PROTECTED][EMAIL PROTECTED]
:

 On Fri, Jun 20, 2008 at 1:29 PM, Eugen Belyakov
 [EMAIL PROTECTED] wrote:
  Somebody knows how NSView's hitTest method works internally?

 This is not the question you mean to ask.  The question you want to
 ask is one or more of the following:
 1) I need to implement X, kind of like what -hitTest does.
 [Explanation of X here.]  Could anyone with knowledge of how -hitTest
 works point me in the right direction?
 2) I am having a problem using -hitTest.  [Snippet of your code.]  Can
 anyone spot what I might be doing wrong?
 3) What does -hitTest do?  I have read the documentation, looked at
 sample code, searched the mailing list archives, and done a web
 search, but I am still confused.
 4) I think I have found a bug/performance problem in -hitTest.  Here
 is the output of Shark or Instruments that seems to indicate this is
 the case.  Has anyone experienced this problem before?

 --Kyle Sluder

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Dragging an item from my table view onto another app.

2008-06-20 Thread Eloy Duran
Ok so the problem was that I missed the part about letting the table  
view know it should allow external drag operations... :)


In the initialization code I added:  
@applicationsTableView 
.setDraggingSourceOperationMask_forLocal(OSX::NSDragOperationGeneric,  
false)
And now it works great. Dragging a row onto a texteditor opens the  
file at the path I return in  
tableView_writeRowsWithIndexes_toPasteboard.


Cheers,
Eloy

On 20 jun 2008, at 19:12, Eloy Duran wrote:


Hi,

I'm still very new to all the DND stuff, so here goes:

I want to be able to drag an item from my table view onto, for  
instance a texteditor, and have it open the file that the item  
represents.
(Also having it drop on Terminal and inserting the path to the file  
would be nice, but that might be something completely different.)


Some stuff I tried in my table view data source is (RubyCocoa code  
btw):


 def tableView_writeRowsWithIndexes_toPasteboard(tableView, rows,  
pboard)

   pboard.declareTypes_owner([OSX::NSFilenamesPboardType], self)
   pboard.setPropertyList_forType(['/etc/hosts'],  
OSX::NSFilenamesPboardType)

   true
 end

OR:

 def tableView_writeRowsWithIndexes_toPasteboard(tableView, rows,  
pboard)

   url = OSX::NSURL.URLWithString(/etc/hosts)
   pboard.addTypes_owner([OSX::NSURLPboardType], nil)
   url.writeToPasteboard pboard
   true
 end

So the drag operation is initiated, but that's only because I return  
true.
Most stuff I read about dragging from the tableview is about  
promising files,

which, if I understand it correctly, is not what I need.

Does anyone know where in the docs I should RTFM?
Or a OSS app or example that implements such behaviour?

Kind regards,
Eloy


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jesse Grosjean

I want to construct searches such as:

  - find all entries that have a the tag named priority with  
the

value 1.



NSPredicate *tagPredicate = [NSPredicate predicateWithFormat:@ANY
tags.name = %@, tag.name];
NSPredicate *valuePredicate = [NSPredicate predicateWithFormat:@ANY
tags.value = %@, tag.value];

NSPredicate *combinedPredicate = [NSComparisonPredicate
andPredicateWithSubpredicates:[NSArray arrayWithObjects:tagPredicate,
valuePredicate,nil]];


Thanks, but I don't think this quite works. The problem is that the  
two ANY predicates aren't forced to match against the same tag. So if  
the potential matching entry has multiple tags this query will match  
if any of those tags match the tag name, and if any of the tags values  
match the tag name, but there's no constraint that a the same tag  
value pair matches both constraints.


Jesse
___

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

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

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

This email sent to [EMAIL PROTECTED]


[Moderator] Re: OT: Announcing Pi, the Phoenix iPhone Developer Group

2008-06-20 Thread Scott Anguish

the iPhone SDK is still under NDA.

folks can't get together and discuss it outside of their own company,  
nor can you legally do so on a third party mailing list or site.


Whether or not your intentions are good, this is violating the NDA.

On Jun 20, 2008, at 2:11 PM, Brad O'Hearne wrote:


All,

Please pardon the fact that this is in regards to a new user group  
based in Phoenix, AZ. While most of you may not be local to Phoenix  
and be able to attend our meetings, please feel free to join anyway,  
to take part in iPhone development discussion. Perhaps your area  
does not have an iPhone user group yet, but if not, there's no  
reason you have to do without -- hook up with our group.


For the better part of the past year, I've been an iPhone user, and  
have kept a close eye on the developments of the iPhone, iPhone web  
development, and the iPhone SDK. I attended the Apple World Wide  
Development Conference (WWDC) last week, and as most of you probably  
know, Apple announced the 3G iPhone and the iPhone SDK 2.0. For  
those unable to attend, I can summarize last week by saying that the  
iPhone is not merely a mobile device; it is essentially a brand new  
OS platform, and the most advanced mobile technology in the world.  
Apple has created a huge opportunity for development, and rarely in  
a technical career does one get the opportunity to get in on the  
ground floor.


I am an independent software developer based in Gilbert, I am  
developing applications for the iPhone to be marketed soon when the  
iPhone Application Store opens. This is a major career direction  
I've been planning, and as such, I have had plans to launch an  
iPhone developer group following the WWDC. That day is here. I'm  
announcing the Phoenix iPhone Developer Group, otherwise known as  
Pi, due to a play on the letters of the group name, and the  
anticipation of this new, exciting direction going on, and on, and  
on (that's nerd humor for those following along...). You may  
join this group at the Google Group at the following URL:


Phoenix iPhone Developer Group: 
http://groups.google.com/group/phoenix-iphone-developer-group

These URLS also resolve to the same location presently:

http://phoenix-iphone.com
http://phoenix-iphone.org

I will be supporting this group through email posts, attempting to  
facilitate meetings (which will be spontaneous, as members are  
available, and at convenient locations), and my blog just opened at:


NeuroFire (blog entitled Burning Embers): http://www.neurofire.com/

I welcome everyone to join. I look forward to collaborating with  
you, and growing the iPhone Developer Community in Phoenix. I would  
be very grateful if you could forward this email to any work  
associates, and other user groups you may be a part of -- spread the  
word!


Sincerely,

Brad

Brad O'Hearne
NeuroFire

___

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

Please do not post 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/scott%40cocoadoc.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Quartz Composer file in IB

2008-06-20 Thread Omar Qazi


On Jun 20, 2008, at 9:09 AM, Dan Uff wrote:


Hi,
I am trying to make a Cocoa application using a Quartz Composer file  
as output.  Everything works fine when I Simulate the app in IB, but  
when I actually compile the app in Xcode, I get the following error:


__TERMINATING DUE TO UNCAUGHT EXCEPTION___

Any ideas?
-Dan Uff



I think that there's a framework you have to link against to get the  
Quartz Compositions to show up.


Omar Qazi
Hello, Galaxy!
1.310.294.1593



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: PDFKit guidance

2008-06-20 Thread John Calhoun


On Jun 20, 2008, at 5:21 AM, Adam R. Maxwell wrote:
If you want to draw in memory, I think you have to drop down to  
Quartz; using PDFKit would likely be easier, but it looks like you  
can only specify a Quartz filter when saving to a file?.


I think there may be some confusion with regards to drawing

Antonio is correct that PDFPage has a -[drawWithBox:] method that is  
used not simply for displaying to screen but also for rendering into a  
PDF context for saving to file as well.  So, you can still use  
PDFPage, override -[drawWithBox:] in an app that has no intention of  
displaying the PDF to screen.


The saving method is in PDFDocument.  When called it walks through  
each PDFPage in the document and calls it to render into a PDF  
context.  (Printing within PDF Kit does something similar, BTW.)   
Optionally too, you can pass a QuartzFilter to the save method in  
PDFDocument and get, for example, grayscale output.


You can also do something similar in Quartz with CGPDFDocumentRefs and  
CGPDFPageRefs.  The QuartzFilter stuff should work for CGContexts as  
well.


There is I think a perception that PDF Kit is only for displaying  
PDF's and I like to try to dispell that when I can. :-)


John Calhoun—___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: hitTest question

2008-06-20 Thread Brian Christensen

On Jun 20, 2008, at 2:50 , Eugen Belyakov wrote:

I need to implement custom visual component system in OpenGL. And I  
want to
use hitTest-like behavior ( with rotated frame rectangles and so on)  
to

determine component under cursor.
Could anyone with knowledge of how -hitTest works point me in the  
right

direction?


I don't have knowledge of how hitTest: is implemented, but I can tell  
you what I would do if I were implementing something like it. Assuming  
you have an NSView-style hierarchy of your visual components, the  
hitTest: method you'll implement should first check if the point is  
inside itself. If so, continue iterating through all of its sub- 
components (by invoking hitTest: on each one) until you've located the  
deepest component that still contains the point. You should send the  
hitTest: method to the root component in your hierarchy. Something  
like the following (pseudo-code written in Mail, so standard  
disclaimer applies):


- (Component *)hitTest:(NSPoint)point
{
if (!NSPointInRect( point, [self frame] ))
return nil;

Component *match = self;

for (Component *subcomponent in [hitComponent subcomponents])
{
Component *nextComponentToTest = [subcomponent hitTest:point];

if (nextComponentToTest)
match = nextComponentToTest;
}

return match;
}

You may need to do coordinate conversions as well, depending on  
whether or not your components maintain their own coordinate spaces  
relative to their supercomponents. If you need to take rotation into  
account, then you'll still use NSPointInRect() to find out if the  
point is at least within the bounding rectangle. Beyond that you'll  
probably need to work out some vector algebra to get a more accurate  
hit result.


/brian



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: hitTest question

2008-06-20 Thread Brian Christensen

On Jun 20, 2008, at 4:04 , Brian Christensen wrote:


for (Component *subcomponent in [hitComponent subcomponents])


Sorry, that line should be:

for (Component *subcomponent in [match subcomponents])
{
// ...
}

/brian



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: hitTest question

2008-06-20 Thread Erik Buck
You are off to a good start by trying to mimic something as well conceived and 
implemented as Cocoa's -hitTest: approach.
   
  Now, because you want to re-invent the solution, you will need to know a lot 
of details about graphics programming and associated mathematics.  Determining 
whether a 2D point is inside a co-planar 2D rectangle is easy.  I will leave 
that up to you.  Transforming a 2D point from one 2D coordinate system to 
another is trivial if you have a proper grounding in graphics programming 
including affine transform matrixes and associated math.  I will simply direct 
you to google with the terms coordinate system transformation  A standard and 
popular text book is Computer Graphics: Principles and Practice in C (2nd 
Edition) by James D. Foley (Author), Andries van Dam (Author), Steven K. Feiner 
(Author), John F. Hughes (Author).
   
  Hint: Bounding rectangles aren't rotated.  Coordinate systems are rotated.  
Transform your hit point into the correct coordinate system and then use the 
standard rectangle contains point test.
   
  So, now you know whether your 2D point is within a 2D rectangle that might be 
in a rotated, scaled, skewed, or transformed coordinate system (e.g. affine 
transforms).  That gives you the NSView base class like implementation of 
-hitTest:.  You might want to determine whether the 2D point hits an opaque 
portion of a 2D drawing.  I will leave that as an exercise but caution that it 
can be quite difficult and actually hasn't been completely solved in a general 
way other than via rasterization which you will want to avoid in openGL.
   
  Now, since you are using openGL, you might want to test 3D point intersection 
with 3D volumes.  OpenGL provides a picking solution that might meet your 
needs.  Other than that, you are going to have to investigate general collision 
detection algorithms which are fortunately a highly researched area of computer 
science.  Start with wikipedia for that: 
http://en.wikipedia.org/wiki/Collision_detection
   
___

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

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

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

This email sent to [EMAIL PROTECTED]


How is an NSDecimalNumber an incompatible type for argument 1 of 'decimalNumberWithDecimal:'?

2008-06-20 Thread Michael Swan
Perhaps someone else has seen this before but it makes no sense to me.  
The included code is from a NSManagedObject subclass and is part of a  
method to return a readonly property that is based on the value of two  
attributes (amount  frequency).

With the this code: (I removed irrelevant code to save space)

- (NSDecimalNumber *)monthly
{
NSDecimalNumber * tmpValueA;
[self willAccessValueForKey:@amount];
tmpValueA = [self primitiveAmount];
[self didAccessValueForKey:@amount];
...
NSDecimalNumber * tmpValueC;
...
switch ([tmpValueB intValue])
{
...
case 2:
tmpValueC = [NSDecimalNumber 
decimalNumberWithDecimal:tmpValueA];
break;
...
}
return tmpValueC;
}

I get this error:
error: incompatible type for argument 1 of 'decimalNumberWithDecimal:'

The documentation says that decimalNumberWithDecimal: takes an  
NSDecimalNumber as its argument and tmpValueA is an NSDecimalNumber  
unless I am missing something.
I guess I could pull the decimal number out of the NSDecimalNumber and  
dump it into  a string and then use decimalNumberWithString: but that  
seems really inefficient.

If anyone has any ideas as to what I am doing wrong please let me know.

Thank You,
Mike Swan
ETCP Certified Entertainment Electrician







Every experience in your life is an opportunity to learn something  
new and to make a change for your ultimate benefit.




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: PDFKit guidance

2008-06-20 Thread Kai


On 20.6.2008, at 13:47, Torsten Curdt wrote:



On Jun 20, 2008, at 13:09, Antonio Nunes wrote:


On 20 Jun 2008, at 11:07, Torsten Curdt wrote:


you can't go wrong by reading the Cocoa
Drawing Guide.


Surely will read through that. Because frankly speaking I didn't  
think this was Quartz related.


Well, you need to know how to generally draw in Cocoa, and you need  
to know how to take advantage of PDFKit, so both John Calhoun and  
Joel Norvell provided useful pointers.


The scaling is done when a PDFPage needs to be drawn, so you need  
to implement it in your subclass's drawWithBox: method. Use an  
affine transform set up to serve your needs and apply it to the  
current graphics context within the drawWithBox: method before  
drawing the page.


Right. The point though is - I don't really want to display it. So I  
did not look into the drawing side of things. But I guess I just  
read up on the Quartz stuff and then get back to you guys (if  
needed). I assume one could also draw in memory - without  
displaying. Just didn't know that's the right direction.


You just should be aware that Quartz rewrites the PDF from scratch  
when using this approach. That is, while still showing the same  
grafics, the result is a completely new PDF file with potentially very  
different structure. Plus, since Quartz is about displaying, some non- 
display properties of the original PDF may be lost. Its a while ago  
that I last checked (Tiger, I think), but I would be surprised if  
Quartz became perfect in this respect in the meantime.


Depending on your application, this may be between no problem and  
inacceptable.


Greetings
Kai

___

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

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

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

This email sent to [EMAIL PROTECTED]


Linking with OpenSSL

2008-06-20 Thread Alexander Hartner
I am using gSoap to integrate with a webservice. To enable SSL support  
I had to add this flag to the process -DWITH_OPENSSL


g++ -DWITH_OPENSSL myclient.cpp stdsoap.cpp soapC.cpp soapClient.cpp - 
lxnet -lsocket -lnsl -lssl -lcrypto


as described here :

http://www.cs.fsu.edu/~engelen/soapdoc2.html#tth_sEc18.20

I set both the Other C Flags and Other C++ Flags to -DWITH_OPENSSL  
in XCode


However since I added this I now get errors linking.

Undefined symbols:
  _SSL_free, referenced from:
  _tcp_disconnect in stdsoap2.o
  _tcp_disconnect in stdsoap2.o
  _tcp_disconnect in stdsoap2.o
  _X509_EXTENSION_get_object, referenced from:
  _tcp_connect in stdsoap2.o
  _SSL_accept, referenced from:
  _soap_ssl_accept in stdsoap2.o
  _SSL_get_error, referenced from:
  _frecv in stdsoap2.o
  _soap_ssl_error in stdsoap2.o
  _fsend in stdsoap2.o
  _tcp_connect in stdsoap2.o
  _soap_ssl_accept in stdsoap2.o
  _SSL_get_peer_certificate, referenced from:
  _tcp_connect in stdsoap2.o
  _soap_ssl_accept in stdsoap2.o
...

It seems to me that the linker can't find the OpenSSL libraries. I  
already added the Security Framework to my application, this did not  
make any difference.


Any suggestion what I need to configure to get this to compile.

Thanks in advance
Alex



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How is an NSDecimalNumber an incompatible type for argument 1 of 'decimalNumberWithDecimal:'?

2008-06-20 Thread glenn andreas


On Jun 20, 2008, at 3:26 PM, Michael Swan wrote:

The documentation says that decimalNumberWithDecimal: takes an  
NSDecimalNumber as its argument and tmpValueA is an NSDecimalNumber  
unless I am missing something.




The documentation says:

+ (NSDecimalNumber *)decimalNumberWithDecimal:(NSDecimal)decimal


I.e., it take an NSDecimal structure, not a pointer to an  
NSDecimalNumber.



Since NSDecimalNumber is an immutable value, your code can just do:

tmpValueC = tmpValueA;



Glenn Andreas  [EMAIL PROTECTED]
The most merciful thing in the world ... is the inability of the human  
mind to correlate all its contents - HPL


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Linking with OpenSSL

2008-06-20 Thread Trygve Inda

 It seems to me that the linker can't find the OpenSSL libraries. I
 already added the Security Framework to my application, this did not
 make any difference.
 
 Any suggestion what I need to configure to get this to compile.
 
 Thanks in advance
 Alex

Try adding these to the project:

/usr/lib/libssl.dylib

And possibly

/usr/lib/libcrypto.dylib

Trygve


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jim Turner
On Fri, Jun 20, 2008 at 2:06 PM, Jesse Grosjean
[EMAIL PROTECTED] wrote:
 I want to construct searches such as:

  - find all entries that have a the tag named priority with the
 value 1.

 NSPredicate *tagPredicate = [NSPredicate predicateWithFormat:@ANY
 tags.name = %@, tag.name];
 NSPredicate *valuePredicate = [NSPredicate predicateWithFormat:@ANY
 tags.value = %@, tag.value];

 NSPredicate *combinedPredicate = [NSComparisonPredicate
 andPredicateWithSubpredicates:[NSArray arrayWithObjects:tagPredicate,
 valuePredicate,nil]];

 Thanks, but I don't think this quite works. The problem is that the two ANY
 predicates aren't forced to match against the same tag. So if the potential
 matching entry has multiple tags this query will match if any of those tags
 match the tag name, and if any of the tags values match the tag name, but
 there's no constraint that a the same tag value pair matches both
 constraints.

 Jesse


You are correct, it doesn't work.  And in trying to figure this out,
I've come to realize that I've used predicates the hard way in some
of my code.  Try this instead:

NSPredicate *pred = [NSPredicate predicateWithFormat:@(SUBQUERY(
tags, $x, $x.name = %@ AND $x.value = %@)[EMAIL PROTECTED] != 0),
@aNameToMatch, @aValueToMatch];

Appears that this was a problem in 10.4 and fixed in 10.5.
NSExpression's documentation for
expressionForSubquery:usingIteratorVariable:predicate: has some
discussion about it.

-- 
Jim
http://nukethemfromorbit.com
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SSCrypto Framework

2008-06-20 Thread Jason Coco
There would be a couple of ways that you could do it... you could  
place your certificate in the System keychain and then add it so that  
it can be read by your application anytime. This should work okay and  
if you do this during installation, the user should only have to  
authenticate then. But, the user could mess with this... delete the  
certificate or remove your application from the list of applications  
that can read it without authenticating...


The other option is to just create a private keychain that you put  
anything you want into and lock it yourself. It would get deployed  
with your application bundle and only your application would ever  
access it. Don't even give the user the key so they can't mess with it  
at all (Microsoft uses this strategy with its distribution of Office  
2008).


/jason

On Jun 20, 2008, at 15:06 , Trygve Inda wrote:


Yeah, I understand that... you don't need to actually buy a
certificate for that. You can just install your certificate that you
generate yourself and then use it internally to check the integrity  
of

your data files or whatever else you'd like to do with it.



How would I go about doing this... And does the user have to do  
anything
(like authorize with a password)? I want to sign/encrypt on my end  
and have

my app decrypt with no user action required - so it is completely
transparent.

Thanks,

Trygve




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSPredicate for a ANY match based on two properties at once

2008-06-20 Thread Jesse Grosjean

You are correct, it doesn't work.  And in trying to figure this out,
I've come to realize that I've used predicates the hard way in some
of my code.  Try this instead:

NSPredicate *pred = [NSPredicate predicateWithFormat:@(SUBQUERY(
tags, $x, $x.name = %@ AND $x.value = %@)[EMAIL PROTECTED] != 0),
@aNameToMatch, @aValueToMatch];


Wow, that's it! Somehow I missed the whole SUBQUERY possibility. Thank  
you very much!


Jesse
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SSCrypto Framework

2008-06-20 Thread Trygve Inda
 There would be a couple of ways that you could do it... you could
 place your certificate in the System keychain and then add it so that
 it can be read by your application anytime. This should work okay and
 if you do this during installation, the user should only have to
 authenticate then. But, the user could mess with this... delete the
 certificate or remove your application from the list of applications
 that can read it without authenticating...
 
 The other option is to just create a private keychain that you put
 anything you want into and lock it yourself. It would get deployed
 with your application bundle and only your application would ever
 access it. Don't even give the user the key so they can't mess with it
 at all (Microsoft uses this strategy with its distribution of Office
 2008).
 
 /jason

How which this work? The app need to download a binary xml file while would
have an encrypted NSData in it. I need to encrypt it here and the app of
coursed need to DL it from our server and decrypt it.

Is there some sample code for doing this w/o requiring any user interaction
with keychains/passwords?

Thanks,

Trygve


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Quartz Composer file in IB

2008-06-20 Thread Chris Pavicich

IIRC, you need to link against Quartz.

On Jun 20, 2008, at 12:46 PM, Omar Qazi wrote:



On Jun 20, 2008, at 9:09 AM, Dan Uff wrote:


Hi,
I am trying to make a Cocoa application using a Quartz Composer  
file as output.  Everything works fine when I Simulate the app in  
IB, but when I actually compile the app in Xcode, I get the  
following error:


__TERMINATING DUE TO UNCAUGHT EXCEPTION___

Any ideas?
-Dan Uff



I think that there's a framework you have to link against to get the  
Quartz Compositions to show up.


Omar Qazi
Hello, Galaxy!
1.310.294.1593

___

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

Please do not post 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/cmp%40apple.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SSCrypto Framework

2008-06-20 Thread Jens Alfke


On 20 Jun '08, at 8:45 AM, Trygve Inda wrote:

I would embed a public key in my app and encrypt a data file on our  
site
that the software needs to download periodically. This is mostly to  
ensure

that file can not be modified or substituted except by us.


A good way to do this would be to use SSL. Create a self-signed cert  
and install it and the private key on your web server as the SSL cert.  
Copy the cert into your app. Now the app can download its file using  
HTTP over SSL.


The only wrinkle is verifying the cert. Unfortunately NSURLConnection  
doesn't give you much control over certs; it will complain because the  
cert is self-signed, unless it's been added to the user's keychain and  
marked as trusted. You can use the Keychain APIs in the Security  
framework to add the cert and change its trust settings when your app  
first runs.


—Jens

PS: I used SSCrypto at first, then switched to Keychain.framework. The  
latter covers a much broader range of tasks, is more mature, and has  
IMHO better design (SSCrypto just uses these singleton objects with a  
flat procedural interface, wile Keychain.framework has classes for  
individual certs, keys, keychains, etc.) However, for just adding a  
cert to the keychain, I think you can get away with just using the  
system APIs directly.

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Creating a Bundle via Code

2008-06-20 Thread Grant Limberg

Is there a way to create a new bundle from in Cocoa?

What I'd like to do is have a bundle in my app's Application Support  
folder to store some data generated by the user in my app.  I see  
plenty of methods to call to load bundles and check if a folder is a  
bundle, but not creating them.


Do I simply just create a folder and set a bit on it that the OS  
identifies as being a bundle or is there anything else special I have  
to do?


Thanks in advance,

Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.net

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: install_name_tool

2008-06-20 Thread Martin
Sometimes you just need someone to tell you to read *again* the man  
page and actually try to understand what the words mean ;-)


Thanks Sherm!

-Martin

On Jun 20, 2008, at 12:25 PM, Sherm Pendley wrote:

On Fri, Jun 20, 2008 at 3:12 AM, Martin [EMAIL PROTECTED]  
wrote:


Thanks for your answers but it's still not working here. Plus I  
don't really
see why I should use -id option since what I really want to do is  
*change*

one of the paths.


Straight from man install_name_tool:

  -change old new
 Changes the dependent shared library install name old  
to new  in
 the specified Mach-O binary.  More than one of these  
options can
 be specified.  If the Mach-O binary does  not  contain   
the  old
 install  name  in  a  specified  -change  option  the   
option is

 ignored.

  -id name
 Changes the shared library  identification  name  of   
a  dynamic
 shared  library  to name.  If the Mach-O binary is not  
a dynamic
 shared library and the -id option is specified it is  
ignored.


You *have* read the man page for the tool you're using, right? :-)


$ install_name_tool -change
/Users/martin/Library/Frameworks/Foo.framework/Versions/A/Foo
@executable_path../../Frameworks/Foo.framework/Versions/A/Foo
Foo.framework/Foo


What you're doing here is, wherever Foo.framework/Foo is *linked to* a
dependent shared library at the first path, change that reference to
refer to the second path instead. That is, the -change option doesn't
change the install name of the target. It changes the target's
references to *other* libraries.

If any applications have linked against your framework using the old
install_name, you could use the -change option to update the apps'
references to your framework.

There are no error messages given by install_name_tool, it just  
silently

does nothing...


That's what it's documented to, when -change is used and
Foo.framework/Foo has no external references to the given path.

As others have suggested, the easiest way to set the install name for
a framework is to get info on the target in Xcode and enter it
there. That's simple, automatic, and painless. That said, if the above
is copy  pasted, and its the same path you tried with the -id option,
you're missing a slash after @executable_path, and looking a directory
too far up the tree. It should be:

   install_name_tool -id
@executable_path/../Frameworks/Foo.framework/Versions/A/Foo

Suggested reading:

   http://developer.apple.com/documentation/Darwin/Reference/ManPages/man1/install_name_tool.1.html 



   http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Tasks/CreatingFrameworks.html 


- especially the section titled Embedding a Private Framework in Your
Application Bundle.

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Ken Thomases

On Jun 20, 2008, at 4:43 PM, Grant Limberg wrote:


Is there a way to create a new bundle from in Cocoa?

What I'd like to do is have a bundle in my app's Application Support  
folder to store some data generated by the user in my app.


Since it's just data, I think you want a package rather than a bundle,  
as such.  A package is a directory which the Finder and other system  
GUI presents to the user as a file.



Do I simply just create a folder and set a bit on it that the OS  
identifies as being a bundle or is there anything else special I  
have to do?


Sort of.  You don't set a bit on the folder.  You declare a document  
type in your application's Info.plist.  That document type would  
specify your custom folder name extension and indicate that it's a  
package document type.  This informs Launch Services (and the Finder,  
which relies on LS) that the folder is a package.


See the Bundle Programming Guide.  In particular, see the chapter on  
Document Packages, but don't limit yourself to that chapter.


http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/
http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Concepts/DocumentBundles.html

Cheers,
Ken
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Matt Long

This might help: 
http://www.cimgf.com/2008/05/13/from-hacker-to-microisv-custom-file-formats/

In essence you create a folder and set attributes on it as you  
suspected. Though these are referred to as packages instead of  
bundles. Take a look at NSFileManager. You can create a directory that  
hides the file extension.  You then have your open and save panels  
treat the file as a single file rather than a directory. You can also  
register a file extension with the OS so that when the file/bundle is  
double clicked it will open in your app.


Not sure if that's exactly what you wanted, but I'm not sure your  
storing user generated data this way in the Application Support folder  
is the best approach either. You probably want to support saving to  
files or use Core Data instead if you don't want custom file formats.


-Matt



On Jun 20, 2008, at 3:43 PM, Grant Limberg wrote:


Is there a way to create a new bundle from in Cocoa?

What I'd like to do is have a bundle in my app's Application Support  
folder to store some data generated by the user in my app.  I see  
plenty of methods to call to load bundles and check if a folder is a  
bundle, but not creating them.


Do I simply just create a folder and set a bit on it that the OS  
identifies as being a bundle or is there anything else special I  
have to do?


Thanks in advance,

Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.net

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/matt.long%40matthew-long.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Grant Limberg
Initially I was storing the data in Core Data.  In my app, the user  
has the ability to attach an image to a record in Core Data.   
Unfortunately, changing from a JPEG to NSData inflates a 1.5MB JPEG to  
over 20 MB.  In talking with some folks at the local Cocoaheads  
meeting on wednesday, one person suggested making a bundle or package  
in Application Support to store the images and just have a referencing  
URL in the Core Data store. This is what I'm trying to do now.


Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.net

On Jun 20, 2008, at 3:22 PM, Matt Long wrote:


This might help: 
http://www.cimgf.com/2008/05/13/from-hacker-to-microisv-custom-file-formats/

In essence you create a folder and set attributes on it as you  
suspected. Though these are referred to as packages instead of  
bundles. Take a look at NSFileManager. You can create a directory  
that hides the file extension.  You then have your open and save  
panels treat the file as a single file rather than a directory. You  
can also register a file extension with the OS so that when the file/ 
bundle is double clicked it will open in your app.


Not sure if that's exactly what you wanted, but I'm not sure your  
storing user generated data this way in the Application Support  
folder is the best approach either. You probably want to support  
saving to files or use Core Data instead if you don't want custom  
file formats.


-Matt



On Jun 20, 2008, at 3:43 PM, Grant Limberg wrote:


Is there a way to create a new bundle from in Cocoa?

What I'd like to do is have a bundle in my app's Application  
Support folder to store some data generated by the user in my app.   
I see plenty of methods to call to load bundles and check if a  
folder is a bundle, but not creating them.


Do I simply just create a folder and set a bit on it that the OS  
identifies as being a bundle or is there anything else special I  
have to do?


Thanks in advance,

Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.net

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/matt.long%40matthew-long.com

This email sent to [EMAIL PROTECTED]




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread j o a r


On Jun 20, 2008, at 3:28 PM, Grant Limberg wrote:

Initially I was storing the data in Core Data.  In my app, the user  
has the ability to attach an image to a record in Core Data.  
Unfortunately, changing from a JPEG to NSData inflates a 1.5MB JPEG  
to over 20 MB.  In talking with some folks at the local Cocoaheads  
meeting on wednesday, one person suggested making a bundle or  
package in Application Support to store the images and just have a  
referencing URL in the Core Data store. This is what I'm trying to  
do now.



It doesn't sound to me that you actually need to have a bundle. You  
can just store the image data as files in the file system.


I'm also curious as to why you decompress the JPEG file? If you got  
the image as a compressed JPEG, why not store it as is?


j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Jerry Krinock

On 2008 Jun, 20, at 15:28, Grant Limberg wrote:

Initially I was storing the data in Core Data.  In my app, the user  
has the ability to attach an image to a record in Core Data.   
Unfortunately, changing from a JPEG to NSData inflates a 1.5MB JPEG  
to over 20 MB.


I was planning on doing something like that, but your results indicate  
a serious problem with Core Data if you've got very many of those  
images.  Are you storing it as an attribute of type Transformable, and  
not specifying a transformer so that it uses the default/archiver?


Jerry

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Grant Limberg
As far as I know, you can't store a raw jpeg in Core Data directly  
without turning it into an NSData object first which in turn  
decompresses it.


Someone correct me if I'm wrong!

Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.net

On Jun 20, 2008, at 3:38 PM, j o a r wrote:



On Jun 20, 2008, at 3:28 PM, Grant Limberg wrote:

Initially I was storing the data in Core Data.  In my app, the user  
has the ability to attach an image to a record in Core Data.  
Unfortunately, changing from a JPEG to NSData inflates a 1.5MB JPEG  
to over 20 MB.  In talking with some folks at the local Cocoaheads  
meeting on wednesday, one person suggested making a bundle or  
package in Application Support to store the images and just have a  
referencing URL in the Core Data store. This is what I'm trying to  
do now.



It doesn't sound to me that you actually need to have a bundle. You  
can just store the image data as files in the file system.


I'm also curious as to why you decompress the JPEG file? If you got  
the image as a compressed JPEG, why not store it as is?


j o a r




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread j o a r


On Jun 20, 2008, at 3:43 PM, Grant Limberg wrote:

As far as I know, you can't store a raw jpeg in Core Data directly  
without turning it into an NSData object first which in turn  
decompresses it.



It sounds quite possible that Core Data only support images in the  
form of NSData. That said, I see no reason why you would have to  
decompress the JPEG to generate this NSData.


We need to know more about your application to provide more detailed  
assistance. Where do you get your JPEG images from? Over the network?  
From files in the file system? Pasted into an image view by the user?


It sounds like you go from JPEG - NSImage - NSData? Instead of  
creating a NSImage, how about just storing the JPEG as is to the file  
system first, and only later generating NSImages as needed for display  
in your application.


j o a r


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Grant Limberg
Currently, the user drags an existing image from their filesystem to  
an NSImageView bound to an NSData attribute in the sqlite data store.   
This causes the decompression from 1.5MB to 20MB.  As you can see,  
this isn't exactly efficient.   Hence the question on package/bundle  
creation.  I'm wanting to just store the jpeg directly to disk and  
just store a URL to it in the sqlite data store.


Grant Limberg
[EMAIL PROTECTED]
LinkedIn: http://www.linkedin.com/in/grantlimberg
http://www.glsoftware.net

On Jun 20, 2008, at 3:53 PM, j o a r wrote:



On Jun 20, 2008, at 3:43 PM, Grant Limberg wrote:

As far as I know, you can't store a raw jpeg in Core Data directly  
without turning it into an NSData object first which in turn  
decompresses it.



It sounds quite possible that Core Data only support images in the  
form of NSData. That said, I see no reason why you would have to  
decompress the JPEG to generate this NSData.


We need to know more about your application to provide more detailed  
assistance. Where do you get your JPEG images from? Over the  
network? From files in the file system? Pasted into an image view by  
the user?


It sounds like you go from JPEG - NSImage - NSData? Instead of  
creating a NSImage, how about just storing the JPEG as is to the  
file system first, and only later generating NSImages as needed for  
display in your application.


j o a r




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread j o a r


On Jun 20, 2008, at 4:00 PM, Grant Limberg wrote:

Currently, the user drags an existing image from their filesystem to  
an NSImageView bound to an NSData attribute in the sqlite data  
store.  This causes the decompression from 1.5MB to 20MB.  As you  
can see, this isn't exactly efficient.   Hence the question on  
package/bundle creation.  I'm wanting to just store the jpeg  
directly to disk and just store a URL to it in the sqlite data store.



You can always re-compress the image file before writing it out to the  
file system. But that seems kind of silly...


I would suggest that you intercept the drag operation and copy the  
file directly. You should be able to do this quite easily if you  
subclass the image view:


http://developer.apple.com/documentation/Cocoa/Conceptual/DragandDrop/DragandDrop.html 



j o a r



___

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

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

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

This email sent to [EMAIL PROTECTED]


SplashScreen issues

2008-06-20 Thread Damien Cooke

Hi all,
When creating a splash screen what condition do you use to decide when  
to close your splash screen?  Is there some obvious event that is  
triggered that I can use? do I use [window orderOut:self] to close it?  
Or is there a better way?


Thanks and Regards
Damien
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Creating a Bundle via Code

2008-06-20 Thread Jens Alfke


On 20 Jun '08, at 4:00 PM, Grant Limberg wrote:

Currently, the user drags an existing image from their filesystem to  
an NSImageView bound to an NSData attribute in the sqlite data  
store.  This causes the decompression from 1.5MB to 20MB.


That's an issue with NSImageView — when an image is dragged into it,  
it converts it into an NSImage (in most cases, an uncompressed  
pixmap). It does not store the original image data at all. So the  
binding has no alternative but to convert from the NSImage back into  
data. I would guess it uses TIFF for that. PNG would give somewhat  
better compression, but it won't be close to JPEG. (But it would be a  
bad idea for it to use JPEG, because that would decrease image quality  
and eliminate the alpha channel.)


If you want to use an NSImageView but keep the original image data,  
you'll need to subclass it. I've done this once before. Basically you  
need to override the drag-and-drop methods and handle the drag  
yourself. At the end of the drag you convert the data into an NSImage  
and put that into the view, but you hang onto the data itself in the  
form of an NSData* instance variable. You can then write that data  
into the CoreData store.


—Jens



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Mysterious Redo crash

2008-06-20 Thread Graham Cox
I'm getting a crash sometimes when performing a Redo. Stack trace is  
below - seems as if it's something internal to the Undo Manager  
putting together the invocation. Any thoughts on how I can investigate  
this further? The Undos and Redos up until this point work fine as far  
as I can see.



#0  0x9358f6e8 in objc_msgSend
#1  0x92351306 in CFRetain
#2  0x922e15c4 in _CFArrayReplaceValues
#3  0x913299a3 in -[NSCFArray insertObject:atIndex:]
#4  0x91329914 in -[NSCFArray addObject:]
#5  0x923cd729 in __NSI3
#6  0x923ce2b5 in -[NSInvocation setArgument:atIndex:]
#7  0x923ce526 in -[NSInvocation invokeWithTarget:]
#8  0x91400e7c in -[_NSUndoInvocation invoke]
#9  0x91400be4 in -[_NSUndoStack popAndInvoke]
#10 0x914cbf07 in -[NSUndoManager redo]
#11 0x00230272 in -[DKUndoManager redo] at DKUndoManager.m:189
#12 0x90435c23 in -[NSApplication sendAction:to:from:]
#13 0x904e4660 in -[NSMenu performActionForItemAtIndex:]


tia,


Graham
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: SplashScreen issues

2008-06-20 Thread Jens Alfke


On 20 Jun '08, at 4:13 PM, Damien Cooke wrote:

When creating a splash screen what condition do you use to decide  
when to close your splash screen?  Is there some obvious event that  
is triggered that I can use?


Your app delegate's -applicationDidFinishLaunching: method is probably  
the best place. That's the final callback you're going to get from  
NSApplication during the launch process; it happens after any  
documents/URLs are opened.



do I use [window orderOut:self] to close it? Or is there a better way?


That's how you close a window.

That said, I think splash screens are largely unnecessary. Often the  
presence of a splash screen is a sign that the app launches too  
slowly. Notice that Photoshop Elements 6 has a splash screen, which  
stays up for about 30 seconds while it launches, and helpfully shows  
the names of all the things it's loading. By comparison, Pixelmator  
comes up in about three seconds on my machine, without showing a  
splash screen. Guess which app I'm more likely to use?


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Mysterious Redo crash

2008-06-20 Thread Ken Thomases

On Jun 20, 2008, at 6:27 PM, Graham Cox wrote:

I'm getting a crash sometimes when performing a Redo. Stack trace is  
below - seems as if it's something internal to the Undo Manager  
putting together the invocation. Any thoughts on how I can  
investigate this further? The Undos and Redos up until this point  
work fine as far as I can see.



#0  0x9358f6e8 in objc_msgSend
#1  0x92351306 in CFRetain
#2  0x922e15c4 in _CFArrayReplaceValues
#3  0x913299a3 in -[NSCFArray insertObject:atIndex:]
#4  0x91329914 in -[NSCFArray addObject:]
#5  0x923cd729 in __NSI3
#6  0x923ce2b5 in -[NSInvocation setArgument:atIndex:]
#7  0x923ce526 in -[NSInvocation invokeWithTarget:]
#8  0x91400e7c in -[_NSUndoInvocation invoke]
#9  0x91400be4 in -[_NSUndoStack popAndInvoke]
#10 0x914cbf07 in -[NSUndoManager redo]
#11 0x00230272 in -[DKUndoManager redo] at DKUndoManager.m:189
#12 0x90435c23 in -[NSApplication sendAction:to:from:]
#13 0x904e4660 in -[NSMenu performActionForItemAtIndex:]


Looks to me like a memory management bug.  Inside of NSInvocation,  
it's trying to deal with an object of yours that has since been  
deallocated.  It's memory has probably since been used for something  
else, and when objc_msgSend tries to access its innards, it gets sent  
off to la-la-land.


I suspect that NSZombieEnabled will actually mask this crash, but you  
might discover the zombie later.


Another approach is to use MallocStackLoggingNoCompact.  Then, when it  
crashes, sniff the stack a bit to determine which address is being  
treated like an object when it isn't, and use malloc_history to see  
what object has been there in the past.


On x86, you can find the address using:

(gdb) frame 4
(gdb) p *(id*)($ebp+16)


Cheers,
Ken

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Bindings: NSTreeController sends redundant selection keypath KVO notifications

2008-06-20 Thread Hamish Allan
On Fri, Jun 20, 2008 at 1:00 PM, Milen Dzhumerov [EMAIL PROTECTED] wrote:

 I'm building a 3-pane interface and I have a NSTreeController managing the
 sidebar. My actual content displayed in the main view is bound to the
 selection of the tree controller. When I insert a new object into the tree
 controller (I've disabled selection of inserted objects), I can see the new
 object added and the controller also preserves the selection visually. But
 it actually sends a KVO that selection changed - but it has not (even
 logging the selection object returns the same _NSControllerObjectProxy
 instance).

I think that NSTreeController (and NSArrayController and
NSObjectController) send a notification for pretty much everything
that can change any time anything changes... and rely their observers
to actually work out if anything really did change. And even more
annoyingly, the proper change dictionaries are not included with these
notifications.

 The problem is that when selection changes, my main view
 interpolates / animates it's new state - so it fades-in and fades-out
 without changing its appearance. Is there a way to tell the controller not
 to send KVO notifications when the selection has not actually changed?
 Otherwise I would have to keep a flag in the main view whether any changes
 are real or just redundant.

I'm afraid that's about the size of it. Note that in Leopard, you can
register for NSKeyValueObservingOptionPrior which makes this easier
(you'd want to observe selectionIndexPath or something because, as you
noted, the selection object is just a proxy that never changes).

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Linking with OpenSSL [Resolved]

2008-06-20 Thread Alexander Hartner

Thanks, this worked like a charm.

On 21 Jun 2008, at 00:02, Trygve Inda wrote:


Thanks for your quick response. Sorry to ask such a stupid question,
but how do I add those. As frameworks?

Alex
On 20 Jun 2008, at 21:45, Trygve Inda wrote:




It seems to me that the linker can't find the OpenSSL libraries. I
already added the Security Framework to my application, this did  
not

make any difference.

Any suggestion what I need to configure to get this to compile.

Thanks in advance
Alex


Try adding these to the project:

/usr/lib/libssl.dylib

And possibly

/usr/lib/libcrypto.dylib


Yes. From the Project menu, choose Add to Project then in the nav  
box,
type / which will let you type in the /usr/lib and press return.  
Then scroll

down the list to find the lib you want to add.

Cheers,

Trygve




___

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

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

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

This email sent to [EMAIL PROTECTED]


Instance or Class Methods?

2008-06-20 Thread Brian Norwood

This isn't a question of difference; it's about usage.

In many cases, a class has both a generator class method (one that  
returns an initialized instance of the class), as well as an instance  
method that initializes an existing instance, and the two are  
otherwise identical in usage. For example, NSString. I can call:


NSString *stuff = [NSString stringWithString:otherStuff];

or

NSString *stuff = [[NSString alloc] initWithString:otherStuff];

The question is this: is there an advantage to one over the other, and  
why? If so, is this something I should determine on a case by case  
basis? Is +stringWithString: just a shortcut for +alloc and - 
initWithString:?

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Instance or Class Methods?

2008-06-20 Thread Stephen J. Butler
On Fri, Jun 20, 2008 at 9:11 PM, Brian Norwood [EMAIL PROTECTED] wrote:
 NSString *stuff = [NSString stringWithString:otherStuff];

 or

 NSString *stuff = [[NSString alloc] initWithString:otherStuff];

Those aren't equivalent statements, unless you're running under
garbage collection.

 The question is this: is there an advantage to one over the other, and why?
 If so, is this something I should determine on a case by case basis? Is
 +stringWithString: just a shortcut for +alloc and -initWithString:?

It's a shortcut for [[[NSString alloc] initWithString:aString] autorelease].
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Save animation to QuickTime movie?

2008-06-20 Thread Yung-Luen Lan
Hi Rick,

Thanks, it's a good suggestion, but not my case.
The problem is, I have to batch convert thousands of slideshows.
The text information is not just subtitle, I have to highlight
different portion of text depend on time.
For example, text in parenthesis need to be highlighted:

00:13 (AA)AA  
00:15 (AAA)A  
00:16 ( B)BBB 

I don't think iMove or QT text track could do this.

Regards,
yllan

On Sat, Jun 21, 2008 at 5:44 AM, Rick Sustek [EMAIL PROTECTED] wrote:
 Depending on exactly what you have in mind, you may be better served by not
 doing programming at all.
 For example, use iPhoto or iMovie, or a billion other products to produce
 the basic slide show image track into a QT mov file.
 Then add the text overlays via another step with another tool, such as
 titling within iMovie, or text tracks in QT Player Pro, or

 Just a suggestion!
 -Rick


___

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

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

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

This email sent to [EMAIL PROTECTED]


getting the selected object from an NSTableView causes problems

2008-06-20 Thread Daniel Richman

Hi All,

I've got an NSTableView that displays the data in an NSMutableArray. 
(The program is a to-do list.) I just tried adding a function to allow 
you to delete an item: you select the item in the table and then click 
delete. My code is as follows:


- (IBAction)deleteItem:(id)sender
{
   int selectedRow = [((NSNumber *)[tableView selectedRow]) intValue];
   NSLog(@Selected row is %d, selectedRow);
  
   if (selectedRow != -1) {

   NSLog(@Deleting '%@', [toDoList objectAtIndex:selectedRow]);
   [toDoList removeObjectAtIndex:selectedRow];
   [tableView reloadData];
   }
}

The problem is that if I try to delete any item other than the very 
first one (index 0), the program crashes. I did some log work, which 
revealed that the first line is causing problems (int selectedRow...). 
But that doesn't explain why the deleting the first item works ok. I'm 
stumped. Any ideas?


My project is online at 
http://danielrichman.com/tmp/DataSourceChallence_ToDoList.zip .


Thanks,
--Daniel
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: getting the selected object from an NSTableView causes problems

2008-06-20 Thread Graham Cox

I ran into a very similar problem just today.

There is an error in your code though, unrelated to my problem, but is  
probably yours:



int selectedRow = [((NSNumber *)[tableView selectedRow]) intValue];



-selectedRow simply returns an int, so all that casting to an  
NSNumber* and fetching its -intValue is bogus. You want:


int selectedRow = [tableView selectedRow];

(Aside: I think the addition in Leopard of the NSInteger data type is  
confusing a lot of people - it's just a typedef for 'int', it's not an  
object, and definitely not an NSNumber. But I've seen a few errors  
confusing the two lately that didn't seem to happen before).


hth,


Graham




On 21 Jun 2008, at 12:51 pm, Daniel Richman wrote:

I've got an NSTableView that displays the data in an NSMutableArray.  
(The program is a to-do list.) I just tried adding a function to  
allow you to delete an item: you select the item in the table and  
then click delete. My code is as follows:


- (IBAction)deleteItem:(id)sender
{
  int selectedRow = [((NSNumber *)[tableView selectedRow]) intValue];
  NSLog(@Selected row is %d, selectedRow);
if (selectedRow != -1) {
  NSLog(@Deleting '%@', [toDoList objectAtIndex:selectedRow]);
  [toDoList removeObjectAtIndex:selectedRow];
  [tableView reloadData];
  }
}

The problem is that if I try to delete any item other than the very  
first one (index 0), the program crashes. I did some log work, which  
revealed that the first line is causing problems (int  
selectedRow...). But that doesn't explain why the deleting the first  
item works ok. I'm stumped. Any ideas?


___

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

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

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

This email sent to [EMAIL PROTECTED]


Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Jason Wiggins

Hi everyone,

If possible, could someone please educate me on the fundamental  
mistake in my understanding of use of classes/instances/encapsulation/ 
messaging. I have reread the Object-Oriented Programming with  
Objective-C but didn't find my answer.
I have written a test program with three classes- Model, View and  
Controller and a Window with a button and a popup button. There are  
setters and getters to test getting data in/out of the Model Class,  
which works as expected. Both the Controller and View Classes are  
connected to the popup button in IB. What I want to do is have the  
View Class to return the value of the selected index of the popup  
button, but all I ever get is 0. I get the value OK from the  
Controller Class though. I am obviously doing something fundamentally  
wrong or misunderstanding something.

Here is the program:

ftp://[EMAIL PROTECTED]:21/xcode/TestCase.zip

The console output I get is as such:
[Session started at 2008-06-20 22:39:25 +1000.]
2008-06-20 22:39:25.780 TestCase[1439:10b] AwakeFromNib called
2008-06-20 22:39:25.784 TestCase[1439:10b] AwakeFromNib called
2008-06-20 22:39:25.784 TestCase[1439:10b] AwakeFromNib dataString is:  
Initial Value


// Select the second item from the popup button and press the button

2008-06-20 22:40:12.004 TestCase[1439:10b] dataString is: Initial Value
2008-06-20 22:40:12.005 TestCase[1439:10b] dataString is:
2008-06-20 22:40:12.006 TestCase[1439:10b] dataString is: TESTING...
2008-06-20 22:40:12.007 TestCase[1439:10b] popUpButtonSelectedIndex  
called and index of selected item is 0

2008-06-20 22:40:12.007 TestCase[1439:10b] View selected index is: 0
2008-06-20 22:40:12.008 TestCase[1439:10b] Controller selected index  
is: 1


Any help would be greatly appreciated.

Jason

___

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

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

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

This email sent to [EMAIL PROTECTED]


Bindings on Custom View (Initial Value)

2008-06-20 Thread Stefan Arentz


With help from mmalc's binding examples I pretty much got the bindings  
on my custom view working.


I uploaded the app to:

 http://kip.sateh.com/BindableGradientViewWithObjectController/
 http://kip.sateh.com/BindableGradientViewWithObjectController.zip

(First link is source, second is an archive that contains source 
+project+compiled app)


It's a pretty basic example .. there is a GradientView that takes two  
bindings, startingColor and endingColor. These are set with two Color  
Wells and everything is connected with an NSObjectController. Click a  
color well and select a color to see the gradient change.


The only thing that I am not sure about is that I need to have the  
following in my GradientView's bind: method:


- (void) bind: (NSString*) name toObject: (id) object withKeyPath:  
(NSString*) path

options: (NSDictionary*) options
{
// ... do the binding ...

// ??? Without this setValue the initial values are not  
passed to the view

[self setValue: [object valueForKeyPath: path] forKey: name];

// Refresh the view
[self setNeedsDisplay: YES];
}

The binding examples from mmalc are not doing the setValue but without  
it my view keeps it's default colors instead of the colors that I am  
explicitely setting in my controller. The Color Wells are picking up  
this color.


I'm binding the GradientView with:

- (void) awakeFromNib
{
[gradientView bind: @startingColor toObject: objectController  
withKeyPath: @selection.startingColor options:
[NSDictionary dictionaryWithObject: [NSNumber  
numberWithBool:YES]

forKey: @NSContinuouslyUpdatesValue]];  

[gradientView bind: @endingColor toObject: objectController  
withKeyPath: @selection.endingColor options:
[NSDictionary dictionaryWithObject: [NSNumber  
numberWithBool:YES]

forKey: @NSContinuouslyUpdatesValue]];  
}

Is there maybe an option that I need to set to force an initial update?

 S.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Graham Cox
Downloading your file produces an empty (zero bytes) file at least  
when clicking your link and using Finder.


But one observation, in an MVC model with a pop-up button, the pop-up  
button *is* the view, so I'm not sure in what way you have connected  
this additional view - that sounds wrong.


Graham


On 20 Jun 2008, at 10:48 pm, Jason Wiggins wrote:

 Both the Controller and View Classes are connected to the popup  
button in IB.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Henry McGilton (Starbase)


On Jun 20, 2008, at 5:48 AM, Jason Wiggins wrote:


Hi everyone,

If possible, could someone please educate me on the fundamental  
mistake in my understanding of use of classes/instances/ 
encapsulation/messaging. I have reread the Object-Oriented  
Programming with Objective-C but didn't find my answer.
I have written a test program with three classes- Model, View and  
Controller and a Window with a button and a popup button. There are  
setters and getters to test getting data in/out of the Model Class,  
which works as expected.


Okay, so you have a model, and you have a Controller, and you have a  
View.

Where is this View ?Is it a sub-view of the window's content view ?

Both the Controller and View Classes are connected to the popup  
button in IB.


Connected in what way ?Do you have a connection *from* the  
Controller and
*from* the View to the popup button ?If so, why ?What do you  
expect to

happen ?And what is the other button expected to do ?

Sounds like the connections are going in the wrong direction.

Let's ask the fundamental question: when the popup button changes  
state, what do

you want to happen inside the program ?

If I were doing something like this, I would expect that the popup  
button
changing state would send an action message to the controller to tell  
the controller

there's been a change.

The controller would then tell the model to update its state, and  
finally, the
controller would send the new state to the view and possibly tell the  
view to

re-display itself.

What I want to do is have the View Class to return the value of the  
selected index of the popup button, but all I ever get is 0. I get  
the value OK from the Controller Class though. I am obviously doing  
something fundamentally wrong or misunderstanding something.

Here is the program:

ftp://[EMAIL PROTECTED]:21/xcode/TestCase.zip


That  .zip  file is a zero-length file . . .

The log below is not too helpful because it doesn't indicate which  
object is

generating the log.


The console output I get is as such:
[Session started at 2008-06-20 22:39:25 +1000.]
2008-06-20 22:39:25.780 TestCase[1439:10b] AwakeFromNib called
2008-06-20 22:39:25.784 TestCase[1439:10b] AwakeFromNib called
2008-06-20 22:39:25.784 TestCase[1439:10b] AwakeFromNib dataString  
is: Initial Value


// Select the second item from the popup button and press the button

2008-06-20 22:40:12.004 TestCase[1439:10b] dataString is: Initial  
Value

2008-06-20 22:40:12.005 TestCase[1439:10b] dataString is:
2008-06-20 22:40:12.006 TestCase[1439:10b] dataString is: TESTING...
2008-06-20 22:40:12.007 TestCase[1439:10b] popUpButtonSelectedIndex  
called and index of selected item is 0

2008-06-20 22:40:12.007 TestCase[1439:10b] View selected index is: 0
2008-06-20 22:40:12.008 TestCase[1439:10b] Controller selected  
index is: 1



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Jason Wiggins
Thanks Henry for your response. I'll have to read that a couple times  
to let it sink into my thick skull. Not sure why the DL link is zero  
length. Here is a better link: http://members.optusnet.com.au/jwiggins/xcode/TestCase.zip
The reason I connected things in the way I did was to understand what  
was and wasn't happening. But then again, as stated, I'm doing  
something fundamentally wrong.


Regards,
Jason


On 21/06/2008, at 2:35 PM, Henry McGilton (Starbase) wrote:



On Jun 20, 2008, at 5:48 AM, Jason Wiggins wrote:


Hi everyone,

If possible, could someone please educate me on the fundamental  
mistake in my understanding of use of classes/instances/ 
encapsulation/messaging. I have reread the Object-Oriented  
Programming with Objective-C but didn't find my answer.
I have written a test program with three classes- Model, View and  
Controller and a Window with a button and a popup button. There are  
setters and getters to test getting data in/out of the Model Class,  
which works as expected.


Okay, so you have a model, and you have a Controller, and you have a  
View.
Where is this View ?Is it a sub-view of the window's content  
view ?


Both the Controller and View Classes are connected to the popup  
button in IB.


Connected in what way ?Do you have a connection *from* the  
Controller and
*from* the View to the popup button ?If so, why ?What do you  
expect to

happen ?And what is the other button expected to do ?

Sounds like the connections are going in the wrong direction.

Let's ask the fundamental question: when the popup button changes  
state, what do

you want to happen inside the program ?

If I were doing something like this, I would expect that the popup  
button
changing state would send an action message to the controller to  
tell the controller

there's been a change.

The controller would then tell the model to update its state, and  
finally, the
controller would send the new state to the view and possibly tell  
the view to

re-display itself.

What I want to do is have the View Class to return the value of the  
selected index of the popup button, but all I ever get is 0. I get  
the value OK from the Controller Class though. I am obviously doing  
something fundamentally wrong or misunderstanding something.

Here is the program:

ftp://[EMAIL PROTECTED]:21/xcode/TestCase.zip


That  .zip  file is a zero-length file . . .


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Jason Wiggins

Graham,

You observation is helpful. I thought that I needed to create a view  
class. I also thought that with this view class it would have an  
IBAction (the popup button connected to this) with a switch function,  
with each case setting an ivar which would be returned to the  
controller class through getter in the controller when the button was  
pressed. I you get what I mean. Am I going the long way round by  
doing this?

So have I gone too far with the idea of abstraction?
By your observation, I should lose the view class I created and  
connect an IBAction in the controller to the popup button?


Regards,
Jason


On 21/06/2008, at 2:05 PM, Graham Cox wrote:

Downloading your file produces an empty (zero bytes) file at least  
when clicking your link and using Finder.


But one observation, in an MVC model with a pop-up button, the pop- 
up button *is* the view, so I'm not sure in what way you have  
connected this additional view - that sounds wrong.


Graham


On 20 Jun 2008, at 10:48 pm, Jason Wiggins wrote:

Both the Controller and View Classes are connected to the popup  
button in IB.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Graham Cox


On 21 Jun 2008, at 2:56 pm, Jason Wiggins wrote:


http://members.optusnet.com.au/jwiggins/xcode/TestCase.zip



OK, it's downloading now. However, it's an Xcode 3.1 project which  
isn't compatible with Xcode 3. If you want help, you need to help *us*  
to help you. Set the project to be Xcode 2.4 compatible.



Graham
___

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

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

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

This email sent to [EMAIL PROTECTED]


Bindings Concept Question

2008-06-20 Thread Alex Wait
I know this is probably a really basic question about binding but it's sure
tripping me up right now.

I am making my way through Cocoa Programming for Mac OS X by Aaron
Hillegrass. It's an excellent book btw.

However the first time he has discusses binding is in the context of a
NSDocument arch.

I am trying to make an app on my own. On the window I have a TableView with
two columns, two edit fields, and a button.

My desired behavior is for the user to type in both of the fields, click the
add button and poof it appears in the table.
I have done this exercise before but I made my AppController class the
dataSource and provided the methods. I would like to this time use
the NSArrayController to handle it for me.

Right now I have NSArrayController binded to App Controller and the
arrayOfData array. In my init method for Appcontroller,
I add one Data object (which contains two strings) to my NSMutableArray.
This array is the array that my ArrayController is bound to.

When the app starts, I see the data as expected. However, when I call my add
function, which gets the strings from the textFields and makes the
new Data object and adds it to the array, I do not see it in the table.

I tried calling the table's reloadData function but that did not work. (I
bounded it of course and I threw in a check to make sure it's not nill with
a NSLog to prove it to me)

What am I doing wrong?

--Thanks for reading this fairly long winded post. I am greatly enjoying
this new methodology of Cocoa programming. It's very exciting and I am eager
to learn more!

Alex Wait

-- 
If you can't be kind, at least have the decency to be vague.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Graham Cox
You observation is helpful. I thought that I needed to create a view  
class. I also thought that with this view class it would have an  
IBAction (the popup button connected to this) with a switch  
function, with each case setting an ivar which would be returned to  
the controller class through getter in the controller when the  
button was pressed. I you get what I mean. Am I going the long way  
round by doing this?

So have I gone too far with the idea of abstraction?
By your observation, I should lose the view class I created and  
connect an IBAction in the controller to the popup button?



Looking at your nib file (which at least I can open), the pop-up  
button is not connected to anything at all, which is probably why it's  
not doing anything.


Also, you have a generic custom object set to View. That's incorrect  
- Views are any specific widget or control (in fact any NSView  
subclass) that you use in IB, so your Button and the Pop-up are  
already views. You don't need to instantiate one as a standalone  
custom object - remove it.


Your pop-up button should send its action to the controller. That's  
where the popUpChoice: method (or whatever) would go. You don't need  
a View object as you have created it. The controller in turn will  
invoke methods on the model to set its state. Generally controllers  
contain lots of glue code which interprets stuff coming from the  
views (controls) and translate that to state changes in the data  
model, and vice versa.


Custom views are often created, but not in the way you've done it.  
Instead you drag a custom view to a window (typically) and set its  
class. However at this stage I don't think you need to know about this.



Graham



On 21 Jun 2008, at 2:56 pm, Jason Wiggins wrote:

Thanks Henry for your response. I'll have to read that a couple  
times to let it sink into my thick skull. Not sure why the DL link  
is zero length. Here is a better link: http://members.optusnet.com.au/jwiggins/xcode/TestCase.zip
The reason I connected things in the way I did was to understand  
what was and wasn't happening. But then again, as stated, I'm doing  
something fundamentally wrong.



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Fundamental mistake in my understanding of use of classes/instances/encapsulation/messaging

2008-06-20 Thread Jason Wiggins
Apologies, I was using the defaults when I started Xcode. I have re- 
uploaded with the setting changed as required.


Jason



On 21/06/2008, at 3:08 PM, Graham Cox wrote:



On 21 Jun 2008, at 2:56 pm, Jason Wiggins wrote:


http://members.optusnet.com.au/jwiggins/xcode/TestCase.zip



OK, it's downloading now. However, it's an Xcode 3.1 project which  
isn't compatible with Xcode 3. If you want help, you need to help  
*us* to help you. Set the project to be Xcode 2.4 compatible.



Graham


___

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

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

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

This email sent to [EMAIL PROTECTED]