need to run a ln command for every boot

2011-10-05 Thread kiran kumar
Hi All,

I need to run this  ln -s /Applications/test.app ~/Desktop/  command for every 
boot on Mac OS 10.6.
Please can any one suggest me how to do this  .



Regards,
Kiran


The information contained in this email and any attachments is confidential and 
may be subject to copyright or other intellectual property protection. If you 
are not the intended recipient, you are not authorized to use or disclose this 
information, and we request that you notify us by reply mail or telephone and 
delete the original message from your mail system.
___

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

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

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

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


Re: Quicklook not working for network volume items

2011-10-05 Thread Norbert M. Doerner

Chris,

I am trying to get Quicklook working in an app 
of mine. I'm not sure all these details are 
relevant, but better to have more than less 
info. I have a table that shows the number of 
files in certain folders on a network volume. In 
one column is the number of files, another 
column shows the first couple files names, as a 
string that was concatenated. My data object for 
each row has an array that stores NSURL's of all 
of the files.ÝI want the quicklook to show 
previews for all the files in the folder.


So far I am successful in storing the NSURL's 
and to retrieve them. When I bring up the 
quicklook panel, I can see the number of items, 
it displays a generic icon of the first file, 
and I can cycle through to other files, and it 
displays the name of each file correctly. BUT, 
the preview panel will not show me a real icon 
or preview of any file, only the generic blank 
white page icon. If I override the panel methods:
- (id 
)previewPanel:(QLPreviewPanel 
*)panel previewItemAtIndex:(NSInteger)index

and
- (NSURL *)previewItemURL

to return an NSURL to a file on my hard drive, 
then the quicklook preview works properly and I 
see the actual image of the PDF. If I override 
those methods to use a hard coded NSURL to the 
same file on a network volume, the generic blank 
white-document icon shows up.
So, what am I missing? I don't understand why 
this works locally but not on a network volume. 
The Finder shows the network item's quicklook 
preview properly.


Do you get any error messages in Console.app when 
you try to display the network file in Quicklook?


I have found that this framework sometimes emits 
helpful messages if there are problems...


Yours,
--
Norbert M. Doerner
CEO, West-Forest-Systems
In der Trift 13
56459 Langenhahn, Germany
Fon: +49 (2663) 91 70 128   (Central European Time Zone...)
Fax: +49 (2663) 91 70 126
AIM (iChat), Skype: cdfinderceo
Twitter: http://www.twitter.com/cdfinder
Facebook:
http://www.facebook.com/pages/CDFinder-The-Search-Is-Over/173297504827
---
CDFinder - The Search Is Over!  http://www.cdfinder.de/
Catalog and organize your photos, music, videos, disks, data, anything...
NEW:  CDFinder 5.7.3 for Mac OS X 10.7 Lion
 Also catalogs PDF, RAW, MS Word, Quark XPress, Adobe Illustrator, ...
---
___

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

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

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

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


Re: Use Subclass in Interface Builder

2011-10-05 Thread Andy Lee
Yeah, I don't know if there's a logical reason why the "Custom View" object in 
IB is treated specially or if it's a historical artifact.

--Andy

On Oct 5, 2011, at 2:51 AM, Dong Feng wrote:

> Thank you, Andy.
> 
> But slightly wired that NSOpenGLView isn't considered as a custom view, 
> considering it itself is a subclass of NSView. Anyway at least I can count on 
> the way it works. :-)
> 
> 
> 
> 2011/10/5 Andy Lee 
> See "The Object Loading Process":
> 
> 
> > a. Standard Interface Builder objects (and custom subclasses of those 
> > objects) receive an initWithCoder: message.
> [...]
> > b. Custom views in Mac OS X receive an initWithFrame: message.
> 
> Your Method 1 corresponds to the "a" case. Your Method 2 corresponds to the 
> "b" case.
> 
> --Andy
> 
> 
> On Oct 5, 2011, at 1:32 AM, Dong Feng wrote:
> 
> > I have a subclass of NSOpenGLView which named POpenGLView. I tried two ways
> > to use it in IB:
> >
> > Method 1:
> > To create an OpenGL view in IB directly, and set its class type
> > "POpenGLView".
> >
> > Method 2:
> > To create a NSView in IB, and set its class type "POpenGLView".
> >
> > The most significant difference between the two ways is
> >  - in Method 2, initWithFrame: is invoked.
> >  - in Method 1, initWithCoder: is invoked.
> >
> > I checked Apple examples and found this one:
> > http://developer.apple.com/library/mac/#samplecode/GLEssentials/Listings/main_m.html#//apple_ref/doc/uid/DTS40010104-main_m-DontLinkElementID_31
> >
> > Apple's example takes Method 2 and relies on the behavior of invoking
> > initWithFrame: .
> >
> > What's the rule of IB/XIB regarding picking instantiate method?
> >
> > Thanks,
> > Dong
> 

___

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

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

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

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


Re: need to run a ln command for every boot

2011-10-05 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/5/11 12:16 AM, kiran kumar wrote:
> Hi All,
> 
> I need to run this  ln -s /Applications/test.app ~/Desktop/  command for 
> every boot on Mac OS 10.6.
> Please can any one suggest me how to do this  .

1) This has nothing to do with Cocoa.

2) Symlinking at every boot between two fixed paths seems really unusual
(unless ~/Desktop is getting wiped every time for some reason).  It
should also be noted that ~ doesn't mean a whole lot at boot time since
it is determined by the logged-in user.  My first guess is that you are
using autologin to a guest account of some sort that does not persist
files, in which case there are likely better ways to accomplish whatever
result is intended from your question.

3) If you are interested in the general topic of automated execution,
Google "login items" (for an easy user-configurable method) or "launchd"
(OS X's full-featured Swiss army knife of automated execution, roughly a
replacement for the System V init/cron scripts and more).

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6MEeYACgkQaOlrz5+0JdWRkgCdFYLARGwbGAHkf3hWhWLcpxAg
1igAn1ULFrirdhH8lfb8hpnwo2bKTvlQ
=bfv3
-END PGP SIGNATURE-
___

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

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

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

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


Re: need to run a ln command for every boot

2011-10-05 Thread kiran kumar
thanks for u r reply Conrad Shultz

i am using this below script for creating a shortcut icon for my test 
application on my desktop, when i install my package.

#!/bin/sh
`chmod -R 777 /Applications/test.app`
`ln -s /Applications/test.app ~/Desktop/`

First time when i install my package it creates a shortcut icon on desktop 
,when i uninstall and install again (second time)
there is no shortcut icon on my desktop.

Regards,
Kiran

On Oct 5, 2011, at 1:44 PM, Conrad Shultz wrote:

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/5/11 12:16 AM, kiran kumar wrote:
Hi All,

I need to run this  ln -s /Applications/test.app ~/Desktop/  command for every 
boot on Mac OS 10.6.
Please can any one suggest me how to do this  .

1) This has nothing to do with Cocoa.

2) Symlinking at every boot between two fixed paths seems really unusual
(unless ~/Desktop is getting wiped every time for some reason).  It
should also be noted that ~ doesn't mean a whole lot at boot time since
it is determined by the logged-in user.  My first guess is that you are
using autologin to a guest account of some sort that does not persist
files, in which case there are likely better ways to accomplish whatever
result is intended from your question.

3) If you are interested in the general topic of automated execution,
Google "login items" (for an easy user-configurable method) or "launchd"
(OS X's full-featured Swiss army knife of automated execution, roughly a
replacement for the System V init/cron scripts and more).

- --
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.8 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAk6MEeYACgkQaOlrz5+0JdWRkgCdFYLARGwbGAHkf3hWhWLcpxAg
1igAn1ULFrirdhH8lfb8hpnwo2bKTvlQ
=bfv3
-END PGP SIGNATURE-



The information contained in this email and any attachments is confidential and 
may be subject to copyright or other intellectual property protection. If you 
are not the intended recipient, you are not authorized to use or disclose this 
information, and we request that you notify us by reply mail or telephone and 
delete the original message from your mail system.
___

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

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

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

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


Re: PDF viewing

2011-10-05 Thread Michael Dautermann

On Oct 4, 2011, at 4:26 AM, Dan Hopwood wrote:

> Hi all,
> 
> Is there any way to open a PDF without using a UIWebView i.e. like the Mail
> app?


Another way to do it would be via lower level calls in Quartz 2D (which is 
available in iOS).  You could load the document via CGPDFDocumentCreateWithURL 
and then draw it into a graphics context.

Here's the documentation:



hth,

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


[MEET] Toronto Cocoaheads / tacow - October 11

2011-10-05 Thread Karl Moskowski
tacow's next quarterly meeting is scheduled for 6:30 PM on Tuesday, October 11, 
2011 in room 303 of Metro Hall.

We'll be having a SecondConf recap, and a presentation iOS testing. Details, 
directions, etc. at .

All are welcome, and we look forward to seeing you there.


Karl Moskowski 
Voodoo Ergonomics Inc. 



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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


Re: need to run a ln command for every boot

2011-10-05 Thread Fritz Anderson
On 5 Oct 2011, at 3:53 AM, kiran kumar wrote:

> i am using this below script for creating a shortcut icon for my test 
> application on my desktop, when i install my package.
> 
> #!/bin/sh
> `chmod -R 777 /Applications/test.app`
> `ln -s /Applications/test.app ~/Desktop/`
> 
> First time when i install my package it creates a shortcut icon on desktop 
> ,when i uninstall and install again (second time)
> there is no shortcut icon on my desktop.

You may be caught in the distinction between post-update, post-install, and 
post-flight scripts in installer packages. Refer your question to 
installer-...@lists.apple.com for more guidance.

Bear in mind that an installer package may not have access to users' home 
directories. $HOME may not be defined (or may be defined as /var/root) at 
install time. Accessing user directories in an installer is not recommended.

One way to accomplish what you literally intend is to install a global launch 
agent that performs your script upon user logins.


However, if you mean to do what I think you mean, DO NOT PURSUE THIS. 

This is not Windows. Forcing an alias into the user's directory structure, 
especially into the Desktop, is a hostile act in the Mac user experience. You 
will get angry support calls. People will delete your application. People will 
go on message boards and Twitter recommending that nobody purchase your 
product. The user is the master of the Mac desktop. Nothing — not even system 
icons — appears there without his consent. If you want the user to find your 
application immediately upon installation, there are ways to call attention to 
it, such as by having Finder open the parent directory and select the icon.

Installing a launch agent just to promote your product is an outright 
declaration of war. Users who want to opt out of your forcing them to run your 
script will find that they have to do some abstruse deletions and shell 
commands. This will lead to more forum and mailing-list posts, and your 
customers will be livid with rage.

In-house applications that are mandatory for all employees might be an 
exception. Having an inexperienced manager with a fetish for making everything 
work like Windows is not.

— F

___

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

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

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

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


Codesign non-AppStore build with AppStore signing identity

2011-10-05 Thread Trygve Inda
One of our apps (distributed via our website) is not signed. It seems that
Parental Controls signs our app behind our back to do what it does.

This obviously alters our app and breaks some integrity checks.

A Tech Note says that simply signing it will fix this.

Can we just sign it the same way we do the version built for the App Store,
using the same digital signature?

> TN2206
> The Parental Controls, MCX, and Application Firewall subsystems in Leopard,
> when encountering an unsigned program, will ad hoc sign the program in order
> to track its identity from launch to launch. This will usually modify the
> program on disk, and can happen without apparent user input, e.g., when the
> Application Firewall first notices that your program is trying to accept an
> inbound network connection. If your program can be damaged by signing, it is
> imperative that you ship a signed version as soon as practical. Programs
> signed by their manufacturer are not modified in this way.

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


UIWebView not updating picker when picking dynamically populated select items

2011-10-05 Thread Ron Wagner
I have an app with a UIWebView. The contents of the UIWebView contains two html 
 items. When the first select item is changed, javascript on that 
  item populates the second   time according to the selection 
of the first   item.

The problem I am experiencing is that when tapping on the first   item, 
Safari brings up a Picker for the   item, along with a view above the 
Picker containing Previous and Next buttons. When clicking on the Next button, 
the Picker stays in place and the second   item is focused, but the 
Picker doesn't update to display the newly updated contents of the second 
  item, which was populated by the first  item's onChange 
javascript.

I am about to file a bug report against WebKit for this, but am looking for a 
workaround. I realize that this might be more of a Safari list question, but 
since it is in an app using a UIWebView I'm willing to attack it from either 
side if anyone has any ideas.

Thanks
Ron Wagner___

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

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

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

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


Re: UIWebView not updating picker when picking dynamically populated select items

2011-10-05 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/5/11 12:04 PM, Ron Wagner wrote:
> I have an app with a UIWebView. The contents of the UIWebView 
> contains two html  items. When the first select item is 
> changed, javascript on that   item populates the second 
>   time according to the selection of the first  
> item.
> 
> The problem I am experiencing is that when tapping on the first 
>   item, Safari brings up a Picker for the   item, 
> along with a view above the Picker containing Previous and Next 
> buttons. When clicking on the Next button, the Picker stays in
> place and the second   item is focused, but the Picker
> doesn't update to display the newly updated contents of the second
>  item, which was populated by the first  item's
> onChange javascript.
> 
> I am about to file a bug report against WebKit for this, but am 
> looking for a workaround. I realize that this might be more of a 
> Safari list question, but since it is in an app using a UIWebView
> I'm willing to attack it from either side if anyone has any ideas.

There are undoubtedly people on the list (and elsewhere) far more
skilled than I in these sorts of issues, but I'll throw out a couple
naive ideas.

I presume that you have otherwise tested this behavior and that the
problem only manifests when "Next" is used (instead of tapping on the
page body, thus resigning first responder)?  If so, that does rather
sound like a WebKit bug.  (I'm also assuming that you meant
"UIWebView" instead of "Safari" in your message.)

As a workaround, maybe try using a different event.  Instead of
"onchange" (note: event names are technically supposed to be
non-camel-cased: http://www.w3.org/TR/html4/interact/scripts.html),
what happens if you use "onblur" on the first  or "onfocus" on
the second ?

It might also help (for your bug report if no other reason) to
determine whether the issue is WebKit failing to trigger the
"onchange" event or the second  failing to honor the change.
If you through in an alert() or equivalent into your "onchange" code
it should be pretty easy to distinguish.  If the problem is 
failing to honor the change, you might be SOL (or at least would have
to find some more convoluted approach that does trigger an update).


- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOjK/GaOlrz5+0JdURAtHpAJ9sqeto7O3ElcE9KnbXa7vy2E6EmwCdGFnj
2gcRn68bVR0CCyC2lwcLypg=
=izgR
-END PGP SIGNATURE-
___

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

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

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

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


Writing a simple vector graphics editor - how to implement?

2011-10-05 Thread Nick
Hello!
I have a task to write a simple vector graphics editor, which has a window,
a sheet (which can be bigger than the window), and some objects (triangles,
rectangles) to be placed on this sheet (and then, edited, e.g. rotated,
stretched) by their borders.

I am a beginner in this kind of programs (usually I ended up with placing
few buttons/standard Cocoa controls and implemented rather low level logic
of the application). I need an advice how would experienced developers
implement this basic functionality.

Is it correct to implement all the objects as views, that are the subviews
of the "sheet view"? But since this sheet can be bigger than the window, I
will need some kind of scrolling support.. And I need to have the objects to
be editable by their edges.. Not sure how to do it.

What I mean is to what extent can I use Cocoa primitives for these objects
and the sheet itself? And what I will have to implement "by hand"?

Could you please give me a basic idea of how such kind of editors are
usually implemented? If there are some simple opensource programs, I'd be
thankful for their names.
Thank you!
___

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

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

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

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


Re: UIWebView not updating picker when picking dynamically populated select items

2011-10-05 Thread Ron Wagner

On Oct 5, 2011, at 3:28 PM, Conrad Shultz wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> On 10/5/11 12:04 PM, Ron Wagner wrote:
>> I have an app with a UIWebView. The contents of the UIWebView 
>> contains two html  items. When the first select item is 
>> changed, javascript on that   item populates the second 
>>   time according to the selection of the first  
>> item.
>> 
>> The problem I am experiencing is that when tapping on the first 
>>   item, Safari brings up a Picker for the   item, 
>> along with a view above the Picker containing Previous and Next 
>> buttons. When clicking on the Next button, the Picker stays in
>> place and the second   item is focused, but the Picker
>> doesn't update to display the newly updated contents of the second
>>  item, which was populated by the first  item's
>> onChange javascript.
>> 
>> I am about to file a bug report against WebKit for this, but am 
>> looking for a workaround. I realize that this might be more of a 
>> Safari list question, but since it is in an app using a UIWebView
>> I'm willing to attack it from either side if anyone has any ideas.
> 
> There are undoubtedly people on the list (and elsewhere) far more
> skilled than I in these sorts of issues, but I'll throw out a couple
> naive ideas.
> 
> I presume that you have otherwise tested this behavior and that the
> problem only manifests when "Next" is used (instead of tapping on the
> page body, thus resigning first responder)?  If so, that does rather
> sound like a WebKit bug.  (I'm also assuming that you meant
> "UIWebView" instead of "Safari" in your message.)

Yes I have tested by clicking on the second select directly, no change. I did 
mean UIWebView, but Safari slipped because I've also been testing in Safari on 
the iPhone to make sure it wasn't my app that was adding some unintended 
behavior into the mix. Unfortunately Safari and my app have the same behavior 
with this problem.


> 
> As a workaround, maybe try using a different event.  Instead of
> "onchange" (note: event names are technically supposed to be
> non-camel-cased: http://www.w3.org/TR/html4/interact/scripts.html),
> what happens if you use "onblur" on the first  or "onfocus" on
> the second ?

Had tried the onblur on the first select but not onfocus on the second. 
Unfortunately no change in behavior.

Re non-camel-case, I checked my code and they were correctly cased (thanks 
Dreamweaver), but thank you for pointing that out.

> 
> It might also help (for your bug report if no other reason) to
> determine whether the issue is WebKit failing to trigger the
> "onchange" event or the second  failing to honor the change.
> If you through in an alert() or equivalent into your "onchange" code
> it should be pretty easy to distinguish.  If the problem is 
> failing to honor the change, you might be SOL (or at least would have
> to find some more convoluted approach that does trigger an update).

I can see the actual select item on the web page changing when it should. The 
problem is that the Picker items aren't changing along with the select item. 
I've tried a hack to un-focus the second select and then re-focus it, but when 
I re-focus it I can see the select item focused, but the Picker doesn't come 
back up. When hitting the next button or directly clicking on the second 
select, the Picker stays up but doesn't update it's items.

Thanks for your suggestions
Ron Wagner

> 
> 
> - -- 
> Conrad Shultz
> 
> Synthetiq Solutions
> www.synthetiqsolutions.com
> 



___

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

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

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

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


Re: Writing a simple vector graphics editor - how to implement?

2011-10-05 Thread Wim Lewis

On 5 Oct 2011, at 12:39 PM, Nick wrote:
> I have a task to write a simple vector graphics editor, which has a window, a 
> sheet (which can be bigger than the window), and some objects [...] I need an 
> advice how would experienced developers implement this basic functionality.
> 
[]
> What I mean is to what extent can I use Cocoa primitives for these objects
> and the sheet itself? And what I will have to implement "by hand"?
> 
> Could you please give me a basic idea of how such kind of editors are
> usually implemented? If there are some simple opensource programs, I'd be
> thankful for their names.

The "Sketch" example that comes with Xcode should be a decent example of this, 
I think.

Using views for canvas objects is a little too "heavyweight" for a normal 
drawing program. Instead, I would make the canvas be a single view, containing 
an NSArray of (non-NSView) objects; the canvas's drawRect calls a method like 
-drawInView:self on each of the objects; any time an object is changed, there 
needs to be some way for the canvas to -setNeedsDisplay: on both the old and 
new bounds.

Scrolling can be done simply by placing the canvas view into an NSScollView 
though.


___

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

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

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

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


Re: Writing a simple vector graphics editor - how to implement?

2011-10-05 Thread Jens Alfke

On Oct 5, 2011, at 12:39 PM, Nick wrote:

> I have a task to write a simple vector graphics editor, which has a window,
> a sheet (which can be bigger than the window), and some objects (triangles,
> rectangles) to be placed on this sheet (and then, edited, e.g. rotated,
> stretched) by their borders.

Take a look at Graham Cox's DrawKit:
http://apptree.net/drawkitmain.htm

—Jens___

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

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

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

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


Re: Writing a simple vector graphics editor - how to implement?

2011-10-05 Thread Richard Somers
On Oct 5, 2011, at 1:39 PM, Nick wrote:

> I have a task to write a simple vector graphics editor, which has a window, a 
> sheet (which can be bigger than the window), and some objects (triangles, 
> rectangles) to be placed on this sheet (and then, edited, e.g. rotated, 
> stretched) by their borders.

Apple's Sketch+Accessibility sample code would be a good place to start.

 http://developer.apple.com/library/mac/#samplecode/Sketch+Accessibility/

> Is it correct to implement all the objects as views, that are the subviews of 
> the "sheet view"?

No, that would be the wrong approach.

If you study the Sketch sample code it will guide you in the right direction.

--Richard

___

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

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

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

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


Re: Writing a simple vector graphics editor - how to implement?

2011-10-05 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/5/11 12:39 PM, Nick wrote:
> I am a beginner in this kind of programs (usually I ended up with
> placing few buttons/standard Cocoa controls and implemented rather
> low level logic of the application). I need an advice how would
> experienced developers implement this basic functionality.

Good for you!  UI can be frustrating at times, but it can also be a
lot of fun.

> Is it correct to implement all the objects as views, that are the
> subviews of the "sheet view"? But since this sheet can be bigger
> than the window, I will need some kind of scrolling support.. And I
> need to have the objects to be editable by their edges.. Not sure
> how to do it.

You might start by taking a look at NSScrollView, which will enclose
your canvas.

> Could you please give me a basic idea of how such kind of editors
> are usually implemented? If there are some simple opensource
> programs, I'd be thankful for their names.

Graham Cox will probably respond to your message as well, and I
recommend you take a look at his DrawKit framework
(http://apptree.net/drawkit.htm), which includes a nice sample program
putting the pieces together.

Apple's Sketch is probably useful too.

- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOjLnZaOlrz5+0JdURAmUdAJ4/nN/byNUBz6gvWQlbiMG4kMLSsQCeLIM7
SsTuZNVqfiIvKCEF8vggA/I=
=Jobs
-END PGP SIGNATURE-
___

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

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

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

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


Windows _findfirst , _findnext

2011-10-05 Thread koko
In Windows the function

intptr_t _findfirst(CString search, _finddata_t *filedata)

returns in _finddata_t the file information for the first file matching search 
so if I pass /Path/*.ext I get the first file whose extension is extension

_findnext(CString search, _finddata_t *filedata) will continue on 

Is there a best way to get thins done with NSFileManager?

-koko
___

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

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

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

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


Re: Windows _findfirst , _findnext

2011-10-05 Thread Seth Willits
On Oct 5, 2011, at 1:31 PM, koko wrote:

> Is there a best way to get thins done with NSFileManager?


Just the straightforward loop and pathExtension comparison.


--
Seth Willits



___

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

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

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

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


Re: Windows _findfirst , _findnext

2011-10-05 Thread Kyle Sluder
On Wed, Oct 5, 2011 at 1:31 PM, koko  wrote:
> Is there a best way to get thins done with NSFileManager?

NSFileManager has no concept of file extension patterns like Windows
does. If you really need to find all files that have the extension
".exe", then you can do a simple loop and comparison. If what you
really want to do is find all files of a certain type, you should use
UTIs instead.

--Kyle Sluder
___

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

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

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

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


Re: Windows _findfirst , _findnext

2011-10-05 Thread Franklin Marmon
The numbers have been added on this side.

frm

Franklin Marmon
agathe...@agasupport.com
GTalk: agathe...@gmail.com



On Oct 5, 2011, at 3:07 PM, Kyle Sluder wrote:

> On Wed, Oct 5, 2011 at 1:31 PM, koko  wrote:
>> Is there a best way to get thins done with NSFileManager?
> 
> NSFileManager has no concept of file extension patterns like Windows
> does. If you really need to find all files that have the extension
> ".exe", then you can do a simple loop and comparison. If what you
> really want to do is find all files of a certain type, you should use
> UTIs instead.
> 
> --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/agathezol%40agasupport.com
> 
> This email sent to agathe...@agasupport.com

___

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

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

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

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


Re: Windows _findfirst , _findnext

2011-10-05 Thread Lee Ann Rucker
 [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:aPath error:NULL]  
pathsMatchingExtensions:anArrayOfExtensions]

On Oct 5, 2011, at 2:07 PM, Kyle Sluder wrote:

> On Wed, Oct 5, 2011 at 1:31 PM, koko  wrote:
>> Is there a best way to get thins done with NSFileManager?
> 
> NSFileManager has no concept of file extension patterns like Windows
> does. If you really need to find all files that have the extension
> ".exe", then you can do a simple loop and comparison. If what you
> really want to do is find all files of a certain type, you should use
> UTIs instead.
> 
> --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/lrucker%40vmware.com
> 
> This email sent to lruc...@vmware.com

___

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

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

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

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


Re: UIWebView not updating picker when picking dynamically populated select items

2011-10-05 Thread Conrad Shultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On 10/5/11 1:01 PM, Ron Wagner wrote:
> I can see the actual select item on the web page changing when it 
> should. The problem is that the Picker items aren't changing along 
> with the select item. I've tried a hack to un-focus the second
> select and then re-focus it, but when I re-focus it I can see the
> select item focused, but the Picker doesn't come back up. When
> hitting the next button or directly clicking on the second select,
> the Picker stays up but doesn't update it's items.

OK, sorry, I misunderstood your problem.  Are you then saying that the
options in the picker do not match the underlying options in the
 element?  Or that the options match but the selected item
does not match?

It also seems really strange to me that the picker doesn't come up
when you give the  focus.  Are you doing this by just calling
focus() on the element?

Anyhow, this is pretty clearly a WebKit or JavaScript glitch, so this
list is not well suited to the problem.  I'd be happy to continue a
conversation off-list if you want to bounce ideas back and forth.



- -- 
Conrad Shultz

Synthetiq Solutions
www.synthetiqsolutions.com

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFOjMq/aOlrz5+0JdURAt13AJ9MSNlXG09hbVgM3KUCQSLszg5WBQCeIpWV
d6TI7/bz4Xe+iFXKXzS2F4U=
=2JFU
-END PGP SIGNATURE-
___

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

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

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

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


Core Image Capture: ICScanner and brightness/contrast adjustments.

2011-10-05 Thread Robert Tillyard
Hello,

I'm struggling to find documentation on using ICScanner apart from the Scanner 
Browser example which was really great and helped a lot but the images that are 
scanned are too light.

In some scanner apps the user can set the brightness/contrast then scan to get 
a better image.

Do I need to pass some values to the ICScanner to do this? Again can't find any 
documentation on this or anything useful from the ICScanner.h, ICDevice.h or 
ICScannerFunctionalUnit.h headers.

I need to support 10.6 so I don't want to dump all of the code and use another 
framework unless I really have to.

Thanks, regards, Rob.___

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

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

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

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


Re: Windows _findfirst , _findnext

2011-10-05 Thread koko
Thanks for all the input.  I am doing x-platform development and we like to 
keep mainline code identical so I implemented functions _findfirst and 
_findnext using NSFileManager ... it work s pretty cool as follows:



intptr_t _findfirst(CString search, _finddata_t *data)
{
intptr_t rtx = 0;
_breakdown(search);
if([results count])
{
const char* name = [[results objectAtIndex:0] 
cStringUsingEncoding:NSUTF8StringEncoding];
strcpy(data->name,name);
rtx = 1;
}
return rtx;
}

int _findnext(intptr_t& next, _finddata_t *data)
{
int rtx = 0;
if(next < [results count])
{
const char* name = [[results objectAtIndex:next] 
cStringUsingEncoding:NSUTF8StringEncoding];
strcpy(data->name,name);
next++;
}
else rtx = 1;
return rtx;
}

void _breakdown(CString search)
{   
nssearch = [NSString stringWithCString:(const char*)search 
encoding:NSUTF8StringEncoding];
path = [nssearch stringByDeletingLastPathComponent];
fileManager = [NSFileManager defaultManager];
directoryContents = [fileManager contentsOfDirectoryAtPath:path 
error:&error];
lastPathComponent = [nssearch lastPathComponent];
predicate = [NSPredicate predicateWithFormat:@"SELF like [c] %@", 
lastPathComponent];
results = [directoryContents filteredArrayUsingPredicate:predicate];
}
On Oct 5, 2011, at 3:13 PM, Lee Ann Rucker wrote:

> [[[NSFileManager defaultManager] contentsOfDirectoryAtPath:aPath error:NULL]  
> pathsMatchingExtensions:anArrayOfExtensions]
> 
> On Oct 5, 2011, at 2:07 PM, Kyle Sluder wrote:
> 
>> On Wed, Oct 5, 2011 at 1:31 PM, koko  wrote:
>>> Is there a best way to get thins done with NSFileManager?
>> 
>> NSFileManager has no concept of file extension patterns like Windows
>> does. If you really need to find all files that have the extension
>> ".exe", then you can do a simple loop and comparison. If what you
>> really want to do is find all files of a certain type, you should use
>> UTIs instead.
>> 
>> --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/lrucker%40vmware.com
>> 
>> This email sent to lruc...@vmware.com
> 
> 

___

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

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

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

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


Re: Windows _findfirst , _findnext

2011-10-05 Thread Charles Srstka
Another thing that might be helpful is FSCatalogSearch, which can do a *very* 
quick search of a volume. It doesn’t work for searching individual folders, 
though — it’s all or nothing.

Charles___

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

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

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

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


Re: Years-old mysterious bindings crash

2011-10-05 Thread Seth Willits

Ok, this is long but I think I've maybe found an answer to something. I'm 
guessing I'm somehow rarely triggering a bug in Cocoa.



I've had a couple of these exceptions, and this may be more helpful. So 
[AQConnTabController initWithNibName:bundle:windowController:] creates a 
NSObjectController, with nil content. Then it calls [self view] to load the 
nib. The object controller later on in awakeFromNib is given some content and 
then much much later, eventually some things bind to the object controller's 
selection.isProcessing key path. So during the loading of the nib, nothing is 
bound to the object controller at all.

I stuck a breakpoint on setContent: and fired up my app and it's when loading 
this nib it's never called, except when the NSObjectController is allocated 
(with a nil content), and when I call setContent: from awakeFromNib. It's never 
called elsewhere so I'm strongly imaginging that there *should* be a 
-[AQConnTabController awakeFromNib] line between 
nibInstantiateWithOwner:topLevelObjects: and the setContent: in the stack trace 
below, but it's not showing up because it's a tail call or something. It 
doesn't make sense any other way.


So now the interesting part is, in the exception below, it's firing off a 
selection.isProcessing KVO message while the nib is loading. Nothing in the nib 
is at all bound or connected to the object controller that has 
selection.isProcessing on it. So this lends support to the idea that KVO has a 
deallocated object still registered as an observer for selection.isProcessing.

What I'm imaging happened in this case is that the new object controller was 
allocated using the same pointer as an old controller. That old controller was 
deallocated, the old observer was deallocated, but somehow there is still a KVO 
record for the observer being registered for that keypath on an object with 
that pointer. So when this new object controller is created, and its 
setContent: is set to a new content object, it looks in the KVO table, finds it 
has an observer registered with it and attempts to notify it. It throws an 
exception however because the new object which happens to exist at the old 
observer's pointer (which is now the NSThemeFrame in this particular example) 
isn't actually an observer and thus throws this exception.

That seems to make sense, but I don't know how it's possible for both the 
observer and observee to be deallocated, and the KVO registration to still 
exist.

I took a look at the code and I discovered I'm adding an object as an observer 
of selection.isProcessing on the object controller, but not removing that 
registration. I can confirm that the object controller and the observer are 
both being deallocated, but interestingly, I'm not getting that normal KVO 
warning that the object controller is being deallocated while some object is 
still observing it. 

I don't know how this all fits together, but it seems like 1 in a 1,000 times, 
this causes an exception or crash later on. Seems plausible. At any rate, I'll 
remove the observer and then keep an eye out for any new crash logs; If I get 
one, then this wasn't related. :\


Thanks for the feedback, guys.



: An 
-observeValueForKeyPath:ofObject:change:context: message was received but not 
handled.
Key path: selection.isProcessing
Observed object: [object class: 
NSMutableDictionary]
Change: {
kind = 1;
}
Context: 0x0

 __exceptionPreprocess + 180
 objc_exception_throw + 45
 +[NSException raise:format:arguments:] + 103
 +[NSException raise:format:] + 148
 -[NSObject(NSKeyValueObserving) 
observeValueForKeyPath:ofObject:change:context:] + 69
 NSKeyValueNotifyObserver + 338
 -[NSObject(NSKeyValueObservingPrivate) 
_notifyObserversForKeyPath:change:] + 991
 -[NSController _notifyObserversForKeyPath:change:] + 218
 -[NSObjectController setContent:] + 369
 -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:] + 1515
 -[NSNib instantiateNibWithExternalNameTable:] + 564
 -[NSNib instantiateNibWithOwner:topLevelObjects:] + 233
 -[NSViewController loadView] + 180
 -[NSViewController view] + 38
 -[AQConnTabController initWithNibName:bundle:windowController:] + 801
 -[AQConnWindowController newTab:] + 56
 -[NSWindowController _windowDidLoad] + 538
 -[NSWindowController window] + 112
 -[NSWindowController showWindow:] + 47
 -[AQController newConnectionWindow:] + 72





___

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

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

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

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


Keyboard NSEvents and a NSObjectController?

2011-10-05 Thread Robert Monaghan
Hi Everyone,

It seems to me that there isn't an easy way to do this..

I have a bunch of Objects that are in an NSArrayController. My UI is bound to 
an NSObjectController which is then set to work with one of these objects (in 
the ArrayController). The user essentially selects one of the objects in the 
ArrayController using a TableView. This is pretty straight forward stuff.

The wrinkle happens when I want to add non-standard keyboard short cuts. For 
example, I want the user to use a space bar to start and stop a "play" process 
on my object. I would want to use other keys to modify the object, too.

What is the best way to pass these Keyboard events through an 
NSObjectController to my target object? Am I just going to have to write a boat 
load of spaghetti code to these events directly to the objects in question?

Suggestions appreciated!

bob.

___

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

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

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

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


Re: Keyboard NSEvents and a NSObjectController?

2011-10-05 Thread Quincey Morris
On Oct 5, 2011, at 17:28 , Robert Monaghan wrote:

> I have a bunch of Objects that are in an NSArrayController. My UI is bound to 
> an NSObjectController which is then set to work with one of these objects (in 
> the ArrayController). The user essentially selects one of the objects in the 
> ArrayController using a TableView. This is pretty straight forward stuff.
> 
> The wrinkle happens when I want to add non-standard keyboard short cuts. For 
> example, I want the user to use a space bar to start and stop a "play" 
> process on my object. I would want to use other keys to modify the object, 
> too.
> 
> What is the best way to pass these Keyboard events through an 
> NSObjectController to my target object? Am I just going to have to write a 
> boat load of spaghetti code to these events directly to the objects in 
> question?

The concept of passing keyboard events through a mediating controller to data 
model objects is so alien to the MVC paradigm that I think you're wasting your 
time to approach it this way.

If you literally want to capture keyboard events (NSEvent objects), you must 
use a NSResponder object such as a view. That is, the thing that knows a key 
has been pressed has to be in your user interface. Additionally, to get a 
keyboard event, that responder object would have to be the current first 
responder, and it would then need to generate an action to a specific or 
non-specific target. Probably the only practical way to do something like this 
would be to subclass the window (because it's the default first responder when 
nothing else is, and so you'd be able to capture keyboard events whenever they 
weren't captured by [say] a text field).

Maybe there are other ways that involve routing keyboard events, but I don't 
really want to think about it because they're all likely to be pretty lousy.

If I wanted to do something along this line, here's the approach I'd try:

1. Make a Play menu item, and give it a key equivalent of the space character.

This has the advantage of making the behavior both discoverable and 
accessibility-accessible. That ain't nuthin'.

2. Give the menu item a unique action, and wire it up to First Responder.

3. Implement the action method in a suitable place that's in the responder 
chain. If this requires a particular kind of window, put it in the window 
controller. Under other circumstances, you might put it in the app delegate.

4. In the action method, query the array controller to find the selected object.

5. Initiate playback with this object.

6. You'd also want a UI validation method in the object with the action method, 
that disables or enables the menu item based on what's selected in the array 
controller.

The above would be a very natural Cocoa way to solve your problem.


P.S. At risk of sounding like a broken record…

There are no objects "in" a NSArrayController. It's a controller, not a 
collection.


___

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

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

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

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


Calling a script with Xcode 4

2011-10-05 Thread cptkrf
Greetings everyone.

I started learning Xcode a while ago and managed to bootstrap myself to a 
position to actually be able to write some code that works.  Xcode isn't 
exactly a beginner friendly suite, to say the least, but with some patience it 
can be learned.  Then I got a new Macbook and it came with Xcode 4 and replaced 
version 3 on my old machine.  I think it is better, but of course it was a huge 
change at the start of a learning curve that had barely started.  

I do (did) most of my coding in Perl, and started using Xcode to replace the 
GUI Perl-Tk.  That lets me do stuff in Perl that I haven't learned yet to do in 
Objective C, but still display results in OSX's pretty GUI.   In Xcode 3, I 
would put the scripts and data in (jobfolder)/build/debug and call it, as with 
--- int result = system("./perlscript.pl");   Worked fine.

Along comes Xcode 4 and no build/debug folder.  The docs say that any file or 
resource is now to be placed in the Supporting Files folder and they will be 
found.  But, a bare call like the above doesn't find the script.  I have to 
hard code the path like --- int result = 
system("/Users/myself/Programming/CocoaLearn/perlscript.pl"); and it works 
fine, but hard coding paths in a program is a mess, of course.   If I hard code 
the path, it doesn't matter if I told the Supporting Files folder about it.

I have put the test script everywhere in the folder chain of the project, used 
the "Add files to project...", played with the Bundle path, used all the Unix 
precursors like ./  and ~ and so forth.  Either I am not finding the proper 
documentation, or am mis-reading it, or maybe just not seeing the forest for 
the trees.  

Anybody?

Thanks.

___

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

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

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

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


[Moderator] Mourning the passing of Steve Jobs

2011-10-05 Thread Scott Anguish
This is the hardest email I’ve ever had to write to this list.

With the passing of Steve Jobs, there may be the wish to express your feelings 
here. While it may seem callous, I ask that you please refrain from doing that. 
It isn’t that I don’t ache at this loss, the man had a huge impact on my life, 
but for the sake of productivity it is important that we keep the list on track.

Thank you.


— 
Scott [Moderator]
Think of what Steve would do and then try and do better. For him.


___

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

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

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

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


Re: Calling a script with Xcode 4

2011-10-05 Thread Jens Alfke

On Oct 5, 2011, at 6:18 PM, cptkrf wrote:

> In Xcode 3, I would put the scripts and data in (jobfolder)/build/debug and 
> call it, as with --- int result = system("./perlscript.pl");   Worked fine.

That may have worked, but it’s kind of bass-ackwards, if you’ll excuse my 
French. The build/ folder is for the output of building; you shouldn’t put any 
source files in there yourself.

If you want a file to become part of the app, add it as a resource to the 
target and it will be copied in. I’m not sure exactly where it goes if you 
build a plain command-line target, but if you build some flavor of application 
it will go into the Contents/Resources subdirectory. The way to find such a 
file is something like
NSString* path = [[NSBundle mainBundle] pathToResource: @“perlscript” 
ofType: @“pl”];

It would be better to use NSTask to run the script instead of calling system(). 
For one thing, it plays better with NSString, and more importantly, it doesn’t 
parse its input as a command line so it won’t fail if the app is run from a 
location whose path contains a space character. (There was, infamously, an 
early iTunes installer that made a similar mistake and ended up erasing your 
home directory if the name of your disk had a space in it.)

—Jens___

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

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

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

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