Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Trygve Inda
> On Jun 3, 2008, at 2:48 PM, Trygve Inda wrote:
> 
>>> Hi, Trygve,
>>> 
>>> With regard to your code duplication, I would use a common
>>> NSWindowController superclass, with a subclass for your main window
>>> and a subclass for your aux window.  Then you can just use the right
>>> nib name in each of them, but leave the rest of the code identical.
>>> 
>>> Cheers,
>>> Andrew
>> 
>> Hmmm... That might not be possible. The Main window is the System
>> Preferences window... So this is also my master app controller.
>> 
>> So in my app controller there are 6 methods tied via IBOutles to the
>> view
>> within System Prefs, and a different controller for aux windows.
>> 
>> Thoughts?
>> 
>> The trouble is that the code is the same, but IBOutlet NSSOmeView
>> myView
>> will point to a control in either the main our aux nib depending on
>> which
>> controller it is from.
>> 
>> Trygve
>> 
> 
> Ah, I see.  I'm afraid that I don't know much about System Preferences
> development -- although, to be honest, I've never heard of using more
> than one window (the main one) for a preference pane, aside from
> possibly a settings sheet.  Apologies that I can't be of more
> assistance on this one.
> 
> Cheers,
> Andrew

The Desktop Pref Pane does.


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to implement window fade-in fade-out effects

2008-06-04 Thread Markus Spoettl

On Jun 3, 2008, at 11:25 PM, Brian Christensen wrote:

On Jun 4, 2008, at 2:01 , Markus Spoettl wrote:
The window's frame is an animatable property, so you could try  
something like this:



WOW that is very impressive. I didn't imagine it was that easy, thanks  
so much for the quick help!


Regards
Markus
--
__
Markus Spoettl



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: Apple Remote and exclusivity

2008-06-04 Thread Jean-Daniel Dupas


Le 4 juin 08 à 01:00, Scott Anguish a écrit :



On Jun 3, 2008, at 5:02 AM, Hamish Allan wrote:

I don't even know what the Cocoa interface to the Apple Remote is,  
let

alone having used it, let alone being able to troubleshoot it, and I
don't imagine everyone here is an expert either...





You can find some tips about it here:  
http://osxbook.com/book/bonus/chapter10/iremoted/

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: [SOLVED] Code to convert NSDictionary to binary plist file?

2008-06-04 Thread Jean-Daniel Dupas



Le 4 juin 08 à 04:13, Ken Thomases a écrit :


On Jun 3, 2008, at 8:49 PM, David Hoerl wrote:

  ret = [manager createFileAtPath:@"/tmp/binary.plist"  
contents:plist attributes:nil];


You can also do [plist writeToFile:...] to write the data object  
out.  There's nothing wrong with what you wrote, but since you were  
already familiar with the writeToFile:... methods, I thought it  
might be conceptually simpler.


Cheers,
Ken


Just to add a point.

All type accepted inproperty list are tool free bridged with  
CoreFundation equivalent, so you can also use CFPropertyList functions  
like CFPropertyListWriteToStream();
It allow you to write directly you dictionary without having to store  
the whole NSData representation into memory (may be usefull if you  
have a lots of data).


And note too that CFWriteStreamRef is interchangeable with  
NSOutputStream, so you can do this using only Obj-C classes ;-)


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread Buddy Kurz
For me it is a hot topic because after researching this subject two  
years ago and reading said archives I started relying on  
NSMailDelivery and now the powers that be have decided that it should  
no longer be available. (wondering why?)
So I have to rewrite functional code and use a third party framework  
or the scripting bridge which by the way isn't backwards compatible  
with Tiger.
Of course I could ignore the deprecation until OS-X 10.11 Meerkat  
(actually not a feline but a mongoose) comes out and my clients start  
calling because their mail no longer works...


Are there actually any guidelines for how long one might expect a  
deprecated class to continue to exist?


(and thanks to those who responded to questions on the topic in recent  
weeks - It's just that I have other things to do than go back and re- 
solve an old problem)


buddy kurz

On Jun 3, 2008, at 8:15 PM, Kyle Sluder wrote:

On Tue, Jun 3, 2008 at 10:45 PM, Frederick C. Lee <[EMAIL PROTECTED] 
> wrote:
I need to send data through the mail from within my Cocoa program.   
This is

to be for general release; so it must be stable.


Why has every single person under the sun decided that they now need
to send mail using Cocoa?  And why does everyone who asks this
question apparently never search the archives?  I am very curious as
to why this is now such a hot topic.

--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/buddykurz%40mac.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: Copying NSTextStorage

2008-06-04 Thread Sherm Pendley
On Tue, Jun 3, 2008 at 12:51 PM, Kyle Sluder
<[EMAIL PROTECTED]> wrote:
> On Tue, Jun 3, 2008 at 11:15 AM, Gordon Apple <[EMAIL PROTECTED]> wrote:
>>I tried exactly that.  It did nothing but a horrendous crash when I
>> tried to type text.  I couldn't even trace it.  I never even got to the copy
>> part.  I got the same result with a totally empty subclass. Shouldn't it
>> have worked the same?s What gives with that?
>
> It might have something to do with the fact that, according to the
> documentation, NSTextStorage is a "semiconcrete subclass of
> NSMutableAttributedString."  What confuses me about this is that the
> words "concrete" and "abstract" have very well-defined meanings...
> "semiconcrete" is bizarre and meaningless.  Doesn't that just mean
> it's abstract?

I interpret it as meaning that NSTextStorage is concrete in the sense
that you can instantiate it directly. But, you can't inherit its
implementations of NSMutableAtributedString's primitive methods; so,
when subclassing NSTextStorage it's considered an abstract superclass
that requires you to implement the primitive methods.

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: NSObjectController needless in "Intro to Bindings"?

2008-06-04 Thread Jochen Moeller

Hello Ken,

thanks for your respond. I already read this link and thought that the  
NSArrayController "Mailbox" represents this intervening NSController  
between the model object and the table view because the table view is  
not bound direct to the model or a custom controller. To reformulate  
my question - Why is a second intervening NSController in form of an  
NSObjectController useful?


Thanks again,
Jochen


Am 04.06.2008 um 03:59 schrieb Ken Thomases:


On Jun 3, 2008, at 6:25 PM, Jochen Moeller wrote:


Both versions run identical, so my question:
Are both approaches equivalent and the NSObjectController is not  
really needed or is there a reason/advantage to hook the  
NSObjectController between MyController and the NSArrayController ?


See this: http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaBindings/Concepts/WhatAreBindings.html#/ 
/apple_ref/doc/uid/20002372-177085


In short, yes, it's possible to get away with binding directly to  
model objects without an intervening NSController.  It's often  
better to use such a controller, though, and the link explains why.


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: totally confused by bindings settings

2008-06-04 Thread Ken Thomases

On Jun 4, 2008, at 12:05 AM, Daniel Child wrote:

I worked out a super basic bindings case where table columns display  
the ivars of a Word class via bindings. Words have three ivars with  
standard accessors. An ArrayController manages a table of these words


Hmm.  An NSArrayController doesn't manage tables, it manages an array  
(as its name implies).  So, do you have an array somewhere with  
instances of the Word class?  Where is it?  For example, is it a  
property of File's Owner, with a key "words"?


, with appropriate bindings between the columns and ivars. It works  
as expected. So far so good.


Now, however, I want to bind the same table to an intervening class,  
WordList, which contains an array of Words.


Contains how?  What is the interface of this WordList class?  What  
properties does it have?



I tried setting the ArrayController's class to WordList, and bound  
the value of individual table columns to  
ArrayController.arrangedObjects.wordList.. (wordList is  
the mutable array in the WordList class.)


That doesn't seem right.  The Class Name should indicate what kind of  
elements are in the array being managed.  That's still Word, unless  
I'm misunderstanding what you're trying to achieve.


Similarly, the Content Array binding of the NSArrayController should  
refer to the array of Words maintained by the WordList instance  
(perhaps as a key path from the File's Owner, or whatever).   
Therefore, it doesn't make sense to have ".arrangedObjects.wordList"  
appear in the key path of the table column bindings.  The  
arrangedObjects are already the words in the WordList instance.


Let's suppose that File's Owner has a property "wordList" that is a to- 
one relationship to a WordList instance.  Let's also suppose that the  
WordList class has a property "words" which is the to-many  
relationship to some instances of Word.  Then, the NSArrayController's  
Content Array binding should be bound to File's Owner with Model Key  
Path "wordList.words".  That is, this array controller is managing  
access to the words of the wordList of File's Owner.  Now, the table  
columns would be bound to the NSArrayController, with the Controller  
Key "arrangedObjects" and Model Key Path being whichever property of  
an individual Word instance should be presented in the column.  Note  
that the table column bindings are pretty much unchanged from the case  
without the WordList class.  This is a reflection of the encapsulation  
provided by the MVC design pattern and KVC/KVO/bindings.  If the model  
changes -- in this case, the array of words moving from being a direct  
property of File's Owner to being a property of a WordList object held  
by the File's Owner -- the controller which mediates between the view  
and the model may have to changed, but the view itself need not.




That didn't work. It appears I can add and remove lines to the  
table, but the values I type in do not display after I tab out to  
the next column.


It's hard to know for sure what's going on without knowing the details  
of the WordList class.  I suspect, from what you described, that the  
columns were trying to map to WordList objects, but that they had no  
idea how to convert what you type (a string) into a WordList.



More importantly, could someone clarify the rhyme and reason for  
choosing when to:


- binding the content arrangedObjects   versus
- binding the value (of table cells) to arrangedObjects.versus
- binding the contentArray to selection.

Apple's Figure 13 of Cocoa Bindings Programming Topics takes a huge  
leap from the trivial case of two simple controls (slider and  
textfield) to a maze of connections between and among columns and  
controllers. I simply don't see when to choose among the various  
options, or what they stand for.


In many cases, there's only one binding to make.  For example, a table  
column has a Value binding, but not a Content or Content Array binding.


For an NSArrayController, there are Content Array, Content Array For  
Multiple Selection, Content Object, and Content Set bindings, which  
can be confusing.  You'll need to look in the Cocoa Bindings Reference  
for the page on the NSArrayController bindings.  The most common case  
is to bind Content Array.


An NSPopUpButton also has a variety of content bindings.  Again, check  
the page for NSPopUpButton in the Cocoa Bindings Reference.  In this  
case, it's useful to do a full-text search for the combined keywords  
"contentObject contentValues" (without the quotes) to find some  
additional documentation.  In particular, the 10.4 AppKit release  
notes (of all places) have important guidelines on using those  
bindings.  They say:


Selection widgets (NSPopUpButton/NSPopUpButtonCell and NSMatrix) now  
offer a contentObjects binding in addition to the content and  
contentValues bindings (the contentObjects binding becomes available  
only if content is bound). This allows you to bind t

Re: How to implement window fade-in fade-out effects

2008-06-04 Thread Ken Thomases

On Jun 4, 2008, at 2:13 AM, Markus Spoettl wrote:


On Jun 3, 2008, at 11:25 PM, Brian Christensen wrote:

On Jun 4, 2008, at 2:01 , Markus Spoettl wrote:
The window's frame is an animatable property, so you could try  
something like this:



WOW that is very impressive. I didn't imagine it was that easy,  
thanks so much for the quick help!


There's actually an even simpler method which predates Core Animation,  
setFrame:display:animate:.


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: NSObjectController needless in "Intro to Bindings"?

2008-06-04 Thread Ken Thomases

On Jun 4, 2008, at 3:18 AM, Jochen Moeller wrote:

I already read this link and thought that the NSArrayController  
"Mailbox" represents this intervening NSController between the model  
object and the table view because the table view is not bound direct  
to the model or a custom controller. To reformulate my question -  
Why is a second intervening NSController in form of an  
NSObjectController useful?


I believe (although I'm not certain) that it allows a single place to  
send the -commitEditing message to commit the editing of all relevant  
views, chained through the array controllers.  Without that single  
object controller, you'd have to send -commitEditing to each of the  
array controllers separately.


Also, there's no downside to using the NSObjectController.  It may  
have just been the author's habit.  It might be considered future- 
proofing.


As you note, it's not strictly necessary in that example.

Regards,
Ken
___

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

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

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

This email sent to [EMAIL PROTECTED]


make print scale disable

2008-06-04 Thread norio

Hi,

I'd like to make Print Scale to be disable for a purpose.
Is there any ways to do that?

Thanks in advance.
Norio
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


sync with filemaker

2008-06-04 Thread Pandit Pakhurde



Hello List,

I am getting one serious problem regarding my application.

Basically , in my application I able to sync iCalendar events with my xCode app 
named as CalendarItems. Now I have one another application which is FileMaker 
Pro 9. I am using it as my database. I have to sync this FileMaker database 
with iCalendar as well as xCode app(i.e. CalendarItems). For this first of all 
I chose apple script . I also write one script to update the FileMaker 
database. but this updation is very time consuming. It is taking reasonable 
time to update the database because in the script I am deleting all the records 
of FileMaker and again adding all the records from first record to last record. 
And this is why if the number of events increased in the iCal then again 
database updating will be more time consuming. So I stop this way of 
implementation.

Since frameworks are provided for the addressbook as well as iCalendar , I can 
easily put an observer on them and able to trace the events occurring on it and 
able to add the events/record into them as well as able to retrieve information 
from them. But here in case of FileMaker , I don't have any framework provided 
by them so by using it I can do syncing of FileMaker with my xCode app. Can 
anyone suggest me what should i do for this?

Every suggestion will be appreciable...

Thanks,
Pandit Pakhurde


_
Watch hottest Bollywood videos, clips, movie tailors, star interviews, songs 
and more on MSN videos.
http://video.msn.com/?mkt=en-in___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread Torsten Curdt


On Jun 4, 2008, at 05:15, Kyle Sluder wrote:

On Tue, Jun 3, 2008 at 10:45 PM, Frederick C. Lee <[EMAIL PROTECTED] 
> wrote:
I need to send data through the mail from within my Cocoa program.   
This is

to be for general release; so it must be stable.


Why has every single person under the sun decided that they now need
to send mail using Cocoa? And why does everyone who asks this
question apparently never search the archives?  I am very curious as
to why this is now such a hot topic.


Because it's one of the basic things to learn? XML parsing, sending  
email, HTTP uploads, downloads, XMLRPC/SOAP interactions. No surprises  
here.


Anyway! I made a quick write-up about sending mails from Cocoa

 http://vafer.org/blog/20080604120118

Of course they will have to search for it to find it too ;)

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]


NSAppleScript question

2008-06-04 Thread Matthew Delves

Greetings and salutations,
Is there a way to pass arguments into an AppleScript file using  
NSAppleScript and other cocoa/obj-c classes?


The reason that I ask is I am wanting to find out the path to a song  
in iTunes. I have a script which does this for hard coded values,  
though am uncertain as to how to accomplish it (or if it is indeed  
possible) using NSAppleScript.


Thanks,
Matthew Delves
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSAppleScript question

2008-06-04 Thread Vijay Malhan
Yess you can pass arguments through AppleScript. See Scripting Commands for
this.
http://developer.apple.com/documentation/Cocoa/Conceptual/ScriptableCocoaApplications/SApps_script_cmds/chapter_8_section_1.html

 You can visually see the commands/properties available for iTunes in it's
Scripting dictionary which can be accessed by ScriptEditor.app Open
ScriptEditor->File> Open Dicitionary-> In the list of app's select iTunes.

for eg: you can explore "file track" command for what you are trying to do.


- Vijay


On Wed, Jun 4, 2008 at 4:39 PM, Matthew Delves <[EMAIL PROTECTED]>
wrote:

> Greetings and salutations,
> Is there a way to pass arguments into an AppleScript file using
> NSAppleScript and other cocoa/obj-c classes?
>
> The reason that I ask is I am wanting to find out the path to a song in
> iTunes. I have a script which does this for hard coded values, though am
> uncertain as to how to accomplish it (or if it is indeed possible) using
> NSAppleScript.
>
> Thanks,
> Matthew Delves
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/vijay.malhan%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: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread Kyle Sluder
On Wed, Jun 4, 2008 at 7:09 AM, Torsten Curdt <[EMAIL PROTECTED]> wrote:
> Because it's one of the basic things to learn? XML parsing, sending email,
> HTTP uploads, downloads, XMLRPC/SOAP interactions. No surprises here.

It's just very surprising that all of a sudden we've gotten a
sustained flurry of e-mails regarding the topic.  I was just curious
as to why, especially because it could be an indication of authoring
OS X business applications, which often use mail, SOAP, etc.

(Though the abuse of mail is of course troublesome in these types of
software :P)

--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: make print scale disable

2008-06-04 Thread Kyle Sluder
On Wed, Jun 4, 2008 at 6:14 AM, norio <[EMAIL PROTECTED]> wrote:
> I'd like to make Print Scale to be disable for a purpose.
> Is there any ways to do that?

Did you read the NSPrintPanel documentation, specifically the
NSPrintPanelShowsScaling bitflag in the NSPrintPanelOptions enum,
which is used as the argument to -[NSPrintPanel options]?

In case you didn't, it's right here:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSPrintPanel_Class/Reference/Reference.html

--Kyle Sluder
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread Ludovic Marcotte

Torsten Curdt wrote:
Because it's one of the basic things to learn? XML parsing, sending 
email, HTTP uploads, downloads, XMLRPC/SOAP interactions. No surprises 
here.


Anyway! I made a quick write-up about sending mails from Cocoa

 http://vafer.org/blog/20080604120118

Of course they will have to search for it to find it too ;)


Thanks Torsten for this example - I'm sure it'll help newcomers.

As you know, I'm the developer of the Pantomime framework. 
Unfortunately, I haven't had the chance to dedicate much time to it in 
the past few months but I would like that to change and I would 
eventually like to release a new version real soon.


It would be nice to get the input of the list members interested in 
NSMailDelivery, Pantomime or just sending mails in general. Feature 
requests or enhancements that would make Pantomime better and easier to 
use for all Cocoa developers. Among what I've received over the past few 
months, there are :


- small synchronous API on top of the asynchronous one for sending mails
- samples on how to send HTML mails and attachments
- multi-connections support in the IMAP code
- move the PGP code from GNUMail to Pantomime
- AppleScript support

together with the usual small bug fixes. Feel free to share your ideas 
with the other list members, or send them to me privately.


Thanks,

Ludo

--
Live as if you were to die tomorrow.
Learn as if you were to live forever.
- Gandhi

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread Craig Hunter
> Message: 8
> Date: Tue, 3 Jun 2008 22:45:49 -0400
> From: "Frederick C. Lee" <[EMAIL PROTECTED]>
> Subject: What's the NSMailDelivery replacement for Leopard and Beyond?
> To: Cocoa Developers 
> Message-ID: <[EMAIL PROTECTED]>
> Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes
> 
> I need to send data through the mail from within my Cocoa program.
> This is to be for general release; so it must be stable.
> NSMailDelivery appear to be a candidate; unfortunately it's deprecated
> in Leopard+.
> 
> So what does Apple intend us to use as the replacement?
> 
> I've scanned the discussion groups and I haven't found a consensus
> yet.  I would prefer to use an Apple  or  framework.
> All I need to do is send textual data to a mail server with no binary
> attachments.  So I'm looking for a simple ObjC - level method.

Others have already noted the lack of this capability in the OS (and even
when it was there, it depended on some level of configuration by the user,
making it kind of imperfect for many needs).  It's been mentioned before,
but if you simply need to send a canned e-mail with specific inputs and a
fixed format, it's quite easy to submit data to a PHP script on your own
server, and let it send out the mail (some relatively simple safeguards need
to be put in place to make it secure).

I would avoid attempting to script Mail.app or other mail programs; it can
be a never-ending headache.

Craig

-- 
Dr. Craig Hunter
NASA Langley Research Center
Configuration Aerodynamics Branch
[EMAIL PROTECTED]
(757) 864-3020

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread David Hoerl

There is an open source option in the works. Look at EDMessage on:

http://www.mulle-kybernetik.com/software/EDFrameworks/

You will see three open source frameworks. EDMessage provides 
equivalent if not more functionality than NSMailDelivery by directly 
interacting with a SMTP server.


EDCommon has gotten continued support over the years, while EDMessage 
(which relies on it) has languished. In fact the project on the web 
site will currently not build.


I reconstructed that EDMessage and it now builds. Also, I back ported 
some enhancements made to it in OPMessageServices 
(http://sourceforge.net/projects/opmservices/) to support new SMTP 
service extensions such as authentication.


At this time, the code builds without error, sends mail with or 
without attachments to .MAC using authentication and can use port 22 
or 587. If anyone would like to experiment with it, just ask and I'll 
send you EDMessage and a test project (you will need to get EDCommon 
off the URL above).


I propose to continue support of EDMessage, and am in discussions 
with the original author (Erik Doernenburg) as to how to best 
accomplish that.


David
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


Itunes video wall core animation

2008-06-04 Thread Davide Scheriani
just wonder where can I find the famous Itunes Wall Video project  
source..

IF apple have released somewhere.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


garbage collection and WebKit plugins

2008-06-04 Thread Duncan Robertson
When trying to view a webpage in an app using WebKit I ran into an  
unexpected problem viewing content that required a plugin (Flash in  
this case). When NOT using garbage collection the plugin displayed  
content as expected, but when garbage collection is activated, the  
plugin only appeared as a blue question mark.


Is this expected behavior?

Thanks,
Duncan
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


ArrayController Out of Bounds

2008-06-04 Thread Gerriet M. Denkmann


I have an NSTableView with one column which creates exceptions when  
sorted. 10.4.11.


[ tableColumn infoForBinding: @"value" ] -->
   NSObservedKeyPath = "arrangedObjects.kMDItemPath";
NSObservedObject = [object class:  
NSMetadataItem, number of selected objects: 1];

NSOptions = {
NSAllowsEditingMultipleValuesSelection = 1;
NSAlwaysPresentsApplicationModalAlerts = 0;
NSConditionallySetsEditable = 1;
NSConditionallySetsEnabled = 0;
NSContinuouslyUpdatesValue = 0;
NSCreatesSortDescriptor = 1;
NSMultipleValuesPlaceholder = "Mehrere Werte";
NSNoSelectionPlaceholder = "Nichts ausgew\U00e4hlt";
NSNotApplicablePlaceholder = "Nicht anwendbar";
NSNullPlaceholder = ;
NSRaisesForNotApplicableKeys = 1;
NSValidatesImmediately = 0;
NSValueTransformer = ;
NSValueTransformerName = ;
};
}

[ arrayController infoForBinding: @"contentArray" ] -->
NSObservedKeyPath = "query.results";
NSObservedObject = ;
NSOptions =
{
NSAlwaysPresentsApplicationModalAlerts = 0;
NSConditionallySetsEditable = 1;
NSDeletesObjectsOnRemove = 0;
NSHandlesContentAsCompoundValue = 0;
NSMultipleValuesPlaceholder = ;
NSNoSelectionPlaceholder = ;
NSNotApplicablePlaceholder = ;
NSNullPlaceholder = ;
NSRaisesForNotApplicableKeys = 1;
NSSelectsAllWhenSettingContent = 0;
NSValidatesImmediately = 0;
NSValueTransformer = ;
NSValueTransformerName = ;
};

query is an NSMetadataQuery.

When this table contains some rows and I click on the table column  
header I always get:

*** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5)
where 5 is the correct number of rows displayed.

What am I doing wrong?
This is on Tiger 10.4.11

Kind regards,

Gerriet.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to implement window fade-in fade-out effects

2008-06-04 Thread colo
Just curious if some frameworks have been thought of for Animation. In
the likes of Jquery or others. For example
window.show(fade_in, slow);

That way animations can be very clean and simple to write and test.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Frame rate check

2008-06-04 Thread Shawn Erickson
On Tue, Jun 3, 2008 at 11:38 PM, Davide Scheriani
<[EMAIL PROTECTED]> wrote:
> yes I was looking just to see the times draawREct get called.
> is it a weay to set a limit framerate as well? mean 25fps or to
> ask from the cpu/gpu 120fps?

When you are asked to draw (drawRect:) you really must draw what is asked.

If you want to reduce how much you draw consider either caching what
you render in someway and only composite/blit what is asked or ensure
that calls to setNeedsDisplay:, etc. only happen periodically (NSTimer
firing at 25 HZ for example.) assuming you are trying to do some type
of animation.

-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: How to implement window fade-in fade-out effects

2008-06-04 Thread Jean-Daniel Dupas


Le 4 juin 08 à 16:10, colo a écrit :


Just curious if some frameworks have been thought of for Animation. In
the likes of Jquery or others. For example
window.show(fade_in, slow);

That way animations can be very clean and simple to write and test.


Isn't what CoreAnimation does ?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: ArrayController Out of Bounds

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann
<[EMAIL PROTECTED]> wrote:

> When this table contains some rows and I click on the table column header I
> always get:
> *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5)
> where 5 is the correct number of rows displayed.
>
> What am I doing wrong?
> This is on Tiger 10.4.11

Need to see some code likely... Are you using a data source? or
controller layer (bindings)?

You can set a break point on the above method and make it conditional
on the index being -1 to see the code path that is hitting this. Also
I think that is an exception so you can set a break point on ... humm
sorry cannot recall the low level throw method on 10.4 (not enough
coffee yet).

-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: ArrayController Out of Bounds

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 7:50 AM, Shawn Erickson <[EMAIL PROTECTED]> wrote:
> On Wed, Jun 4, 2008 at 6:18 AM, Gerriet M. Denkmann
> <[EMAIL PROTECTED]> wrote:
>
>> When this table contains some rows and I click on the table column header I
>> always get:
>> *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5)
>> where 5 is the correct number of rows displayed.
>>
>> What am I doing wrong?
>> This is on Tiger 10.4.11
>
> Need to see some code likely... Are you using a data source? or
> controller layer (bindings)?
>
> You can set a break point on the above method and make it conditional
> on the index being -1 to see the code path that is hitting this. Also
> I think that is an exception so you can set a break point on ... humm
> sorry cannot recall the low level throw method on 10.4 (not enough
> coffee yet).

Doh sorry it looks like you are using an array controller... was
thinking those happened be descriptions of the data array.

-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: How to implement window fade-in fade-out effects

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 7:10 AM, colo <[EMAIL PROTECTED]> wrote:
> Just curious if some frameworks have been thought of for Animation. In
> the likes of Jquery or others. For example
> window.show(fade_in, slow);
>
> That way animations can be very clean and simple to write and test.

Core Animation available on Mac OS X 10.5 and later.




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


invoking quicklook via code

2008-06-04 Thread Memo Akten


Hi All, I"m building a little cocoa app, its mainly a quartz composer
composition + custom plugin, which I'm embedding and controlling via
QCRenderer.

I'm writing a Quartz Composer plugin which creates a few buttons and
when you click one I would like to launch a quicktime file, but I
would like it to look just like the quicklook QT view.

Is it possible to somehow just launch the quicklook window for a
quicktime file? 

 I'm quite new to Cocoa / ObjC so some basic things are a bit
complicated for me.

Cheers,

Mehmet S. [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: ArrayController Out of Bounds

2008-06-04 Thread Keary Suska
6/4/08 8:50 AM, also sprach [EMAIL PROTECTED]:

>> When this table contains some rows and I click on the table column header I
>> always get:
>> *** -[NSCFArray objectAtIndex:]: index (-1) beyond bounds (5)
>> where 5 is the correct number of rows displayed.
>> 
>> What am I doing wrong?
>> This is on Tiger 10.4.11
> 
> Need to see some code likely... Are you using a data source? or
> controller layer (bindings)?
> 
> You can set a break point on the above method and make it conditional
> on the index being -1 to see the code path that is hitting this. Also
> I think that is an exception so you can set a break point on ... humm
> sorry cannot recall the low level throw method on 10.4 (not enough
> coffee yet).

I believe breaking on -[NSException raise] works in Tiger. Otherwise,
breaking on objc_exception_throw does.

I suspect this doesn't have much to do with the controller. Any call to
-clickedRow will return -1 if the click was in the header, so there may be
other code involved.

HTH,

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

This email sent to [EMAIL PROTECTED]


CALayer subclass question

2008-06-04 Thread Huibert Aalbers

Hi,

I am starting to work with Core Animation. I have tried to subclass  
CALayer but I am having problems because for some reason the  
drawInContext method never gets called, even though I invoke  
setNeedsDisplay on the layer.


What is weird though is that if I override the display method I can  
see that it gets called properly. My understanding is that the default  
implementation of the display method invokes drawInContext. So, my  
question is, what could I be doing wrong that could explain this  
behaviour?


This is probably a pretty basic question but I haven't been able to  
find any complete examples on how to properly subclass NSLayer.  
Everyone seems to believe that it is either unnecessary or complex.


Thanks in advance for your help.

Regards,

Huibert Aalbers
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-04 Thread Ross Carter

On Jun 3, 2008, at 9:32 PM, Nick Zitzmann wrote:


On Jun 3, 2008, at 7:25 PM, Steven Moore wrote:

It looks like most of the calls are coming from [NSArray  
indexOfObjectIdenticalTo:], half of which are from  
[NSSubTextStorage release] and [NSTextStorage  
removeLayoutManager:]. I'm not exactly sure why, as I didn't think  
I was directly touching the layout manager.. is it being re-created  
every time I update the string or something?


I don't know, and the only people who probably would are the AppKit  
engineers. But I do know that NSLayoutManager is probably the most  
expensive built-in object to release. Have you tried turning on GC?  
At least that will move object finalization into a background thread.


You might want to look at NSLayoutManager -  
setAllowsNonContiguousLayout:


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Versioning MainMenu.nib

2008-06-04 Thread Jim Puls

On Jun 3, 2008, at 8:12 PM, Chris Outwin wrote:

I have MainMenu.nib and MainMenu(Debug).nib in a Cocoa document app  
using Xcode 3.0.  The (Debug)version has controls only used during  
development.  I am trying to use build settings to dynamically load  
the MainMenu(Debug).nib when PreprocessorMacros has a value  
associated with the debug configuration.


The only example I've found is AppeanceSample:  a Carbon app which  
does not have NSMainNibFile MainMenu in  
the Info.plist.  This key/value pair may be my problem.


How do you dynamically select between two version of MainMenu.nib in  
a Cocoa document app?


Check the very beginning of the docs for NSApplication:
http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html#/ 
/apple_ref/doc/uid/2012-800060
Every application must have exactly one instance of NSApplication  
(or a subclass of NSApplication). Your program’s main() function  
should create this instance by invoking the sharedApplication class  
method. After creating the NSApplication object, the main() function  
should load your application’s main nib file and then start the  
event loop by sending the NSApplication object a run message. If you  
create an Application project in Xcode, this main() function is  
created for you. The main() function Xcode creates begins by calling  
a function named NSApplicationMain(), which is functionally similar  
to the following:


void NSApplicationMain(int argc, char *argv[]) {
[NSApplication sharedApplication];
[NSBundle loadNibNamed:@"myMain" owner:NSApp];
[NSApp run];
}


-> jp




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: How to implement window fade-in fade-out effects

2008-06-04 Thread Sean McBride
On 6/3/08 11:01 PM, Markus Spoettl said:

>I have an existing window which I'd like to show and hide using a
>zooming transition effect. I'd like something similar to the one in
>iCal (on Leopard) when you double click a calendar entry or in Finder
>when you press SPACE on an item an the QuickLook window becomes
>visible (same for hiding). How does one go about that?

Carbon has an API that does this: TransitionWindow().  You can take a
look at its docs.  It supports the genie effect and others.  There is no
equivalent Cocoa API.

Matt Ball wrote some Cocoa code that uses this:


Alas, TransitionWindow() is deprecated and not available in 64.  So
really I don't recommend it.

--

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

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: garbage collection and WebKit plugins

2008-06-04 Thread Sean McBride
On 6/4/08 2:07 PM, Duncan Robertson said:

>When trying to view a webpage in an app using WebKit I ran into an
>unexpected problem viewing content that required a plugin (Flash in
>this case). When NOT using garbage collection the plugin displayed
>content as expected, but when garbage collection is activated, the
>plugin only appeared as a blue question mark.

Probably. :(  Any framework, bundle, or library used by a GC application
must also support GC.  So frameworks like Cocoa.framework are built as
'dual mode' meaning they can be linked into both GC and non-GC apps.
Probably the flash plugin is not dual mode.

--

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

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to implement window fade-in fade-out effects

2008-06-04 Thread Sean McBride
On 6/4/08 2:25 AM, Brian Christensen said:

>The window's frame is an animatable property, so you could try
>something like this:
>
>- (void)showWindow:(id)window
>{
>   NSRect startFrom = NSZeroRect;
>   NSRect endAt = [window frame];
>   CGFloat duration = 5.0;
>
>   [window setFrame:startFrom display:NO];
>   [window orderFrontAndMakeKey:nil];
>
>   [NSAnimationContext beginGrouping];
>   [[NSAnimationContext currentContext] setDuration:duration];
>
>   [[window animator] setFrame:endAt display:YES];
>
>   [NSAnimationContext endGrouping];
>}

That'll work, but in my experience if any of the controls in the window
make use of 'autoresizing springs' then they will resize incorrectly if
starting from a window size smaller that the control's minimum size.

--

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

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: CALayer subclass question

2008-06-04 Thread Brian Christensen

On Jun 4, 2008, at 11:19, Huibert Aalbers wrote:

I am starting to work with Core Animation. I have tried to subclass  
CALayer but I am having problems because for some reason the  
drawInContext method never gets called, even though I invoke  
setNeedsDisplay on the layer.


What is weird though is that if I override the display method I can  
see that it gets called properly. My understanding is that the  
default implementation of the display method invokes drawInContext.  
So, my question is, what could I be doing wrong that could explain  
this behaviour?


Have you tried setting the "needsDisplayOnBoundsChange" property of  
the layer to YES? That should do the trick.


This is probably a pretty basic question but I haven't been able to  
find any complete examples on how to properly subclass NSLayer.  
Everyone seems to believe that it is either unnecessary or complex.


Jens Alfke wrote a turn-based game engine using Core Animation and he  
makes fairly extensive use of CALayer subclassing. It's a great  
starting point, even just to poke around and see how some things can  
be done. You can grab it here: 


/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: CALayer subclass question

2008-06-04 Thread Huibert Aalbers

Brian,

Thanks, but it didn't work. My understanding is that either  
setNeedsDisplay or setNeedsDisplayOnBoundsChange:YES can be used to  
force the layer to draw its content, but something is not working for  
me.


Huibert

On 04/06/2008, at 10:49 a.m., Brian Christensen wrote:


On Jun 4, 2008, at 11:19, Huibert Aalbers wrote:

I am starting to work with Core Animation. I have tried to subclass  
CALayer but I am having problems because for some reason the  
drawInContext method never gets called, even though I invoke  
setNeedsDisplay on the layer.


What is weird though is that if I override the display method I can  
see that it gets called properly. My understanding is that the  
default implementation of the display method invokes drawInContext.  
So, my question is, what could I be doing wrong that could explain  
this behaviour?


Have you tried setting the "needsDisplayOnBoundsChange" property of  
the layer to YES? That should do the trick.


This is probably a pretty basic question but I haven't been able to  
find any complete examples on how to properly subclass NSLayer.  
Everyone seems to believe that it is either unnecessary or complex.


Jens Alfke wrote a turn-based game engine using Core Animation and  
he makes fairly extensive use of CALayer subclassing. It's a great  
starting point, even just to poke around and see how some things can  
be done. You can grab it here: 


/brian



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread [EMAIL PROTECTED]
for simple email, i've used +[NSURL URLWithString:] to create a 
mailto: url:   and then open the url. u 
can also add parameters such as subject and body but i forget the 
details at the moment (i think its something like ?subject=...)


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: CALayer subclass question

2008-06-04 Thread Brian Christensen

On Jun 4, 2008, at 11:57 , Huibert Aalbers wrote:

Thanks, but it didn't work. My understanding is that either  
setNeedsDisplay or setNeedsDisplayOnBoundsChange:YES can be used to  
force the layer to draw its content, but something is not working  
for me.


Some snippets of your code might help narrow down the issue. For  
example, what does your drawInContext: method look like?


/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: Versioning MainMenu.nib

2008-06-04 Thread Kyle Sluder
On Wed, Jun 4, 2008 at 11:23 AM, Jim Puls <[EMAIL PROTECTED]> wrote:
> Check the very beginning of the docs for NSApplication:

I would note that foregoing NSApplicationMain is not the best idea.
Note the "functionally similar" -- no guarantee is made that the code
provided exactly duplicates the functionality of NSApplicationMain.
For example, where are argument-based user defaults processed?  Does
NSApplicationMain do anything special when the app is compiled in
debug?  Without the actual source code to NSApplicationMain, you can't
answer these questions.  An illustration of highlighted portions of
functionality is not sufficient.

--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: Versioning MainMenu.nib

2008-06-04 Thread David Carlisle
Can't you just use NSApplication setMainMenu?  Or are you committed to  
doing it with build settings?


On Jun 3, 2008, at 9:12 PM, Chris Outwin wrote:

I have MainMenu.nib and MainMenu(Debug).nib in a Cocoa document app  
using Xcode 3.0.  The (Debug)version has controls only used during  
development.  I am trying to use build settings to dynamically load  
the MainMenu(Debug).nib when PreprocessorMacros has a value  
associated with the debug configuration.


The only example I've found is AppeanceSample:  a Carbon app which  
does not have NSMainNibFile MainMenu in  
the Info.plist.  This key/value pair may be my problem.


How do you dynamically select between two version of MainMenu.nib in  
a Cocoa document app?


Thank you,
Chris Outwin
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/davidcar1%40mstarmetro.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: Versioning MainMenu.nib

2008-06-04 Thread j o a r


On Jun 3, 2008, at 8:12 PM, Chris Outwin wrote:

I have MainMenu.nib and MainMenu(Debug).nib in a Cocoa document app  
using Xcode 3.0.  The (Debug)version has controls only used during  
development.  I am trying to use build settings to dynamically load  
the MainMenu(Debug).nib when PreprocessorMacros has a value  
associated with the debug configuration.


The only example I've found is AppeanceSample:  a Carbon app which  
does not have NSMainNibFile MainMenu in  
the Info.plist.  This key/value pair may be my problem.


How do you dynamically select between two version of MainMenu.nib in  
a Cocoa document app?



Having extra menu items added to your debug builds is not an uncommon  
practice. Most of the time though, developers choose to not replace  
the whole menu, but rather just add a special "Debug" menu at the end  
of their regular menu bar.


You could load this debug menu from a nib file, but I would probably  
suggest that you just create and insert it programatically. See the  
API in NSApplication (for how to get a reference to the main menu),  
and the API in NSMenu & NSMenuItem (for how to create and insert the  
menu).


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: Key-Value pairs

2008-06-04 Thread john darnell
Hello Mr. Thomases:

   First of all, thank you.  For you, better than any of the others
provided me what I was looking for; the theory behind the system.  That
was what I was looking for.  This meal you served is a hearty one, and I
will not likely be able to consume it all in one sitting, but I will
consume it, even if it takes several readings.

   And secondly, please let me apologize, for I get from your excellent
response that you thought I was complaining, or at the least, grousing
about Cocoa.  I tried in my first email to make sure that you all
understood that I was not.  I guess I failed at that, and that failing
is my fault.  I will attempt to do better.  

   Thanks again for your tutelage.  I appreciate it.

R,
John Darnell


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to implement window fade-in fade-out effects

2008-06-04 Thread Stefan Werner


On Jun 4, 2008, at 8:24 AM, Sean McBride wrote:

Alas, TransitionWindow() is deprecated and not available in 64.  So
really I don't recommend it.


Technically speaking, it's not deprecated (at least it's not marked a  
such in the documentation). If you don't need 64-bit support, it might  
just be the most convenient option.


-Stefan
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to implement window fade-in fade-out effects

2008-06-04 Thread Sean McBride
On 6/4/08 10:18 AM, Stefan Werner said:

>On Jun 4, 2008, at 8:24 AM, Sean McBride wrote:
>> Alas, TransitionWindow() is deprecated and not available in 64.  So
>> really I don't recommend it.
>
>Technically speaking, it's not deprecated (at least it's not marked a
>such in the documentation).

I suppose.  It's 'almost deprecated' then. :)  Eventually, Mac OS will
be 64 bit only, so if something is 32 bit only, I'd stay away.

>If you don't need 64-bit support, it might
>just be the most convenient option.

It might, which is why I brought it up.

--

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

___

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

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

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

This email sent to [EMAIL PROTECTED]


Problem with cblas_sgemm in 64 bit build

2008-06-04 Thread Rick Hoge


I've been tesing a 64 bit build of an application that uses the BLAS  
function cblas_sgemm to multiply two matrices.  The code works fine in  
32 bit builds (building with Xcode 3.0 on Leopard 10.5.3)


There is a strange problem that I think I have isolated to the output  
of the above function - when the matrix dimensions exceed a certain  
size, the output matrix (the product) contains rows that are zeroed  
out.  I feel like it must be some aspect of my code that is not 64 bit  
clean, but I just can't track it down.


The BLAS multiplication function is wrapped in a method of a matrix  
class I have implemented - the code is provided below.  If anyone can  
spot any potential problems lurking in this code, I would be  
grateful.  I have read the 64-bit transition guide and complied with  
all the recommendations as far as I can tell.


I was wondering if it could be some kind of an alignment problem, but  
as the data are 4-byte floats (which don't change size under 64 bits)  
I don't really see how...


Thanks -

Rick


// Here is the code:
-(NLMatrix *)mTimes:(NLMatrix *)matrix2 { // Matrix multiply two  
matrices, return the result


  // Do some error checking
  if (numColumns != [matrix2 numRows]) {
NSLog(@"Error:  columns1 must equal rows2 for matrix  
multiplication");

  }

  float *mat1Data = (float*)[self bytes];
  float *mat2Data = (float*)[matrix2 bytes];

  int numRows2 = [matrix2 numRows]; // This method returns int
  int numColumns2 = [matrix2 numColumns]; // This also returns int
  float *newData = (float*)malloc(numRows * numColumns2 *  
(int)sizeof(float));


  float alpha = 1.0f;
  float beta = 0.0f;

  // NSLog(@"Multiplying a %dx%d matrix by a %dx%d matrix (result is  
%dx%d)",

  // numRows,numColumns,numRows2,numColumns2,numRows,numColumns2);

  // Use cblas_sgemm to compute product:  C = alpha*A * B + beta*C
  cblas_sgemm (CblasColMajor,   // Matrix is in column major order
   CblasNoTrans,// Don't transpose A
   CblasNoTrans,// Don't transpose B
   numRows, // Number of rows in A (and C)
   numColumns2, // Number of columns in B (and C)
   numColumns,  // Number of columns in A (and rows in B)
   alpha,   // Scalar factor multiplying A
   mat1Data,// Pointer to A
   numRows, 	// Length of leading dim of A (number of  
rows for col major)

   mat2Data,// Pointer to B
   numRows2,	// Length of leading dim of B (number of  
rows for col major)

   beta,// Scalar factor multiplying C
   newData, // Pointer to C
   numRows		// Length of leading dim of C (number of rows  
for col major)

   );

  NLMatrix *newMatrix = [[NLMatrix alloc] initWithBytes:newData  
rows:numRows columns:numColumns2];

  free(newData);
  return [newMatrix 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: Problem with cblas_sgemm in 64 bit build

2008-06-04 Thread Kyle Sluder
Take a look at NSInteger and CGFloat, and the 64-Bit Transition Guide
for Cocoa: 
http://developer.apple.com/documentation/Cocoa/Conceptual/Cocoa64BitGuide/ConvertingExistingApp/chapter_4_section_3.html

--Kyle Sluder
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSAppleScript question

2008-06-04 Thread Matt Neuburg
On Wed, 4 Jun 2008 21:09:53 +1000, Matthew Delves <[EMAIL PROTECTED]>
said:
>Greetings and salutations,
>Is there a way to pass arguments into an AppleScript file using
>NSAppleScript and other cocoa/obj-c classes?
>
>The reason that I ask is I am wanting to find out the path to a song
>in iTunes. I have a script which does this for hard coded values,
>though am uncertain as to how to accomplish it (or if it is indeed
>possible) using NSAppleScript.

I think what you're asking to do is what I illustrate on pp. 478-9 of my
AppleScript book (though I can't quite be sure from the way you describe
it). Or you could just google on "executeAppleEvent" to find out more. m.

-- 
matt neuburg, phd = [EMAIL PROTECTED], 
A fool + a tool + an autorelease pool = cool!
One of the 2007 MacTech Top 25: 
AppleScript: the Definitive Guide - Second Edition!




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSAppleScript question

2008-06-04 Thread Ken Ferry
Hi Matthew,

It is possible, but it requires either extra libraries or
understanding apple events to some extent.

An easier way to go, if you can require 10.5, is to use the Scripting
Bridge instead of NSAppleScript.


If you don't want to require 10.5, there are a number of 3rd party
chunks of code that can help you out.  I have one:
.

Using that, you write code that looks like this:

[iTunesControllerScpt executeHandler:@"num_albums_by_artists"
  withParameters:@"Artist1",
@"Artist2", nil];

-Ken

On Wed, Jun 4, 2008 at 4:09 AM, Matthew Delves <[EMAIL PROTECTED]> wrote:
> Greetings and salutations,
> Is there a way to pass arguments into an AppleScript file using
> NSAppleScript and other cocoa/obj-c classes?
>
> The reason that I ask is I am wanting to find out the path to a song in
> iTunes. I have a script which does this for hard coded values, though am
> uncertain as to how to accomplish it (or if it is indeed possible) using
> NSAppleScript.
>
> Thanks,
> Matthew Delves
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/kenferry%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: The KVO Race

2008-06-04 Thread Hamish Allan
On Tue, Jun 3, 2008 at 8:20 PM, Gordon Apple <[EMAIL PROTECTED]> wrote:

>I guess I don't know hw to use that.  The particular situation was a nib
> that is document related, but loaded and opened later by menu.

Ah, okay. But the solution is essentially the same: set up the
observers when you're sure the whole nib has loaded, rather than in
each controller's awakeFromNib. For the main nib, you can use
applicationWillFinishLaunching. For your own nib, you can just set
them up after you've called loadNibNamed:owner:.

Or you could just set up the dependencies as per Keith Duncan's
suggestion. Much cleaner!

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: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Hamish Allan
On Tue, Jun 3, 2008 at 10:21 PM, Trygve Inda <[EMAIL PROTECTED]> wrote:

> Since the IBOutlets in Main point to a different Nib than the IBOutlets in
> Aux (even though they are functionally identical) is there a good, clean way
> to manage this?

Can you not wire the IBOutlets in Aux to the File's Owner, and set
mainWindowController to be the owner of the Aux nib when you load it?
You could still have a controller in Aux just doing the centering
stuff in its awakeFromNib...

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: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Trygve Inda
> On Tue, Jun 3, 2008 at 10:21 PM, Trygve Inda <[EMAIL PROTECTED]> wrote:
> 
>> Since the IBOutlets in Main point to a different Nib than the IBOutlets in
>> Aux (even though they are functionally identical) is there a good, clean way
>> to manage this?
> 
> Can you not wire the IBOutlets in Aux to the File's Owner, and set
> mainWindowController to be the owner of the Aux nib when you load it?
> You could still have a controller in Aux just doing the centering
> stuff in its awakeFromNib...
> 
> Hamish
> 


Hmmm... How would I do this exactly. I have two nibs A & B

I'd need two instances of WindowController. In the first instance the
IBOutlets are wired to objects in Nib A, the second instance needs to be
wired to nib B... And A & B are quite different.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 8:17 PM, Trygve Inda <[EMAIL PROTECTED]> wrote:

> I'd need two instances of WindowController.

The way I see it, you have a choice: either a single instance of a
controller with 2n outlets, or two instances of a controller with n
outlets.

If you want to have "one controller object handle group A regardless
of being main/aux", it's the former, and you end up with two copies of
near-identical code.

If you want to have one controller *class* handle group A, it's the latter.

Which of these is the better option may depend on the rest of your
business logic...

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: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Trygve Inda
> On Wed, Jun 4, 2008 at 8:17 PM, Trygve Inda <[EMAIL PROTECTED]> wrote:
> 
>> I'd need two instances of WindowController.
> 
> The way I see it, you have a choice: either a single instance of a
> controller with 2n outlets, or two instances of a controller with n
> outlets.
> 
> If you want to have "one controller object handle group A regardless
> of being main/aux", it's the former, and you end up with two copies of
> near-identical code.
> 
> If you want to have one controller *class* handle group A, it's the latter.
> 
> Which of these is the better option may depend on the rest of your
> business logic...
> 
> Hamish
> 

I suppose I could have something like:

IBOutlet  NSView  mainView
IBOutlet  NSView  auxView

NSView  myView


Wire the main and aux views to two different nibs, then in the init code,
set myView to either main or aux depending on which nib I am using.

Thoughts?

Can one class be wired like this into two different nibs?

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: garbage collection and WebKit plugins

2008-06-04 Thread Duncan Robertson

On 4 Jun 2008, at 16:30, Sean McBride wrote:


Probably. :(  Any framework, bundle, or library used by a GC  
application

must also support GC.  So frameworks like Cocoa.framework are built as
'dual mode' meaning they can be linked into both GC and non-GC apps.
Probably the flash plugin is not dual mode.


Thanks Sean. Interesting. In this instance it's probably doing me a  
favour, by forcing me to do it the old way and gain a better  
understanding of memory management. 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 [EMAIL PROTECTED]


Drawing over a QTCaptureView

2008-06-04 Thread Ben Lachman
I'm wonder what's the easiest way to draw a simple box over a  
QTCaptureView.  Overriding drawRect doesn't work and putting another  
view over the QTCV doesn't work.  Any Thoughts?


Thanks,
->Ben
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: IBOutlet, multiple nibs, method duplication

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 8:46 PM, Trygve Inda <[EMAIL PROTECTED]> wrote:

> Thoughts?

It sounds like you're going for the "two instances of the same class" approach.

In which case, you have a single combined controller class with your
singe set of outlets and actions. Set your File's Owner in each of the
Main and Aux nibs to be that class, and wire everything up to File's
Owner. Then do something like the following:

CombinedController *mainScreenController = [CombinedController initForScreen:0];
[NSBundle loadNibNamed:@"MainNib" owner:mainController];
CombinedController *secondScreenController = [CombinedController
initForScreen:1];
[NSBundle loadNibNamed:@"AuxNib" owner:secondScreenController];

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]


Newbie Question on a method signature

2008-06-04 Thread James Cicenia

I have the following:

	((ProjectListCell *)cell).budgetHealth.textColor = [self  
returnUIColorForFont:s];


And here is my method:


- (UIColor *) returnUIColorForFont:(NSString *) theString{
if([theString compare:@"1"] == NSOrderedSame){
return [UIColor greenColor];
}else if([theString compare:@"0"] == NSOrderedSame){
return [UIColor yellowColor];
}else if([theString compare:@"-1"] == NSOrderedSame){
return [UIColor redColor];
}else{
return [UIColor grayColor];
}
}


why does it tell me:

 warning: (Messages without a matching method signature will be  
assumed to return 'id' and accept...


Thank you
James Cicenia
t

T


T
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]> wrote:

> why does it tell me:
>
>  warning: (Messages without a matching method signature will be assumed to
> return 'id' and accept...

I'm guessing your method's definition comes after the code that uses
that method, and you haven't declared it in the header file.

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: Newbie Question on a method signature

2008-06-04 Thread Bill Bumgarner

Class names changed to not perpetuate NDA violation...

On Jun 4, 2008, at 1:14 PM, James Cicenia wrote:

I have the following:

	((ProjectListCell *)cell).budgetHealth.textColor = [self  
returnNSColorForFont:s];


And here is my method:

- (NSColor *) returnNSColorForFont:(NSString *) theString{
if([theString compare:@"1"] == NSOrderedSame){
return [NSColor greenColor];
}else if([theString compare:@"0"] == NSOrderedSame){
return [NSColor yellowColor];
}else if([theString compare:@"-1"] == NSOrderedSame){
return [NSColor redColor];
}else{
return [NSColor grayColor];
}
}

why does it tell me:

warning: (Messages without a matching method signature will be  
assumed to return 'id' and accept...


Where do you declare -returnNSColorForFont:?

Have you #imported the header that declares it into the implementation  
file that contains the line of code that warns?


b.bum
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Newbie Question on a method signature

2008-06-04 Thread Michael Vannorsdel
You have to make sure your header has - (UIColor *)  
returnUIColorForFont:(NSString *) theString in it so when you use the  
method in other source files the compiler will know what the arguments  
and return types to returnUIColorForFont: are.  Without this the  
compiler has to make assumptions and is warning you that it is doing so.


Also, to compare if strings are equal you can just do:

if([theString isEqualToString:@"1"])
//do stuff

Just another shorter method eventhough the way you're doing it is  
perfectly fine.



On Jun 4, 2008, at 2:14 PM, James Cicenia wrote:


I have the following:

	((ProjectListCell *)cell).budgetHealth.textColor = [self  
returnUIColorForFont:s];


And here is my method:


- (UIColor *) returnUIColorForFont:(NSString *) theString{
if([theString compare:@"1"] == NSOrderedSame){
return [UIColor greenColor];
}else if([theString compare:@"0"] == NSOrderedSame){
return [UIColor yellowColor];
}else if([theString compare:@"-1"] == NSOrderedSame){
return [UIColor redColor];
}else{
return [UIColor grayColor];
}
}


why does it tell me:

warning: (Messages without a matching method signature will be  
assumed to return 'id' and accept...


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Newbie Question on a method signature

2008-06-04 Thread James Cicenia

Wow..

I didn't know the order of methods was important.

thanks
James

On Jun 4, 2008, at 3:20 PM, Hamish Allan wrote:

On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]>  
wrote:



why does it tell me:

warning: (Messages without a matching method signature will be  
assumed to

return 'id' and accept...


I'm guessing your method's definition comes after the code that uses
that method, and you haven't declared it in the header file.

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: NSPredicateEditorRowTemplate: Custom templateView state

2008-06-04 Thread Peter Ammon

On Jun 3, 2008, at 12:05 PM, Mario Fischer wrote:


Hi -

- I use the NSPredicateEditor with a custom  
NSPredicateEditorRowTemplate

- This custom component should implement something like this:
[Filesize] - [is smaller/greater than] - [Textfield] - [KB/MB/GB]

By overriding templateViews I'm able to add an additional  
NSPopupButton to the existing ones:


- (NSArray *)templateViews
{
NSArray* myviews = [super templateViews];
NSPopUpButton* myButton = [[NSPopUpButton alloc] init];
	[myButton addItemsWithTitles:[NSArray arrayWithObjects:@"KB",  
@"MB", @"GB", nil]];
	return [NSArray arrayWithObjects: [myviews objectAtIndex:0], 
[myviews objectAtIndex:1],[myviews objectAtIndex:2], myButton, nil];

}

But in predicateWithSubpredicates I can't find out, which of the  
entries the user selected:


- (NSPredicate *)predicateWithSubpredicates:(NSArray *)subpredicates
{
	[[[self templateViews] objectAtIndex:1] titleOfSelectedItem]; //  
works
	[[[self templateViews] objectAtIndex:3] titleOfSelectedItem]; // is  
always the first entry, regardless of the user selection..

...
}

What am I missing here / doing wrong?


Hi Mario,

Your code is creating a new instance of NSPopUpButton with every call  
to templateViews.   When you call templateViews again to check the  
value of the last popup, you get a different popup every time.


It looks like maybe you just accidentally declared myButton as a local  
variable instead of an instance variable.


-Peter

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Newbie Question on a method signature

2008-06-04 Thread Andrew Merenbach

Hi, James,

I'd say, though, that the order of methods isn't actually important,  
as long as you've declared them in your @interface context --  
generally in your header file.  Hope this helps. :)


Cheers,
Andrew

On Jun 4, 2008, at 1:26 PM, James Cicenia wrote:


Wow..

I didn't know the order of methods was important.

thanks
James

On Jun 4, 2008, at 3:20 PM, Hamish Allan wrote:

On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]>  
wrote:



why does it tell me:

warning: (Messages without a matching method signature will be  
assumed to

return 'id' and accept...


I'm guessing your method's definition comes after the code that uses
that method, and you haven't declared it in the header file.

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/andrew.merenbach%40ucla.edu

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: Newbie Question on a method signature

2008-06-04 Thread Bill Bumgarner

On Jun 4, 2008, at 1:26 PM, James Cicenia wrote:

I didn't know the order of methods was important.


Objective-C is C + a set of syntactic extensions that yields an object  
model.


As such, you need to follow the rules of C and ensure that things are  
declared prior to use.


b.bum

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Newbie Question on a method signature

2008-06-04 Thread Michael Watson
It's not the method order, it's declaration vs definition. The  
compiler scans the file top to bottom, so you must declare a method's  
prototype before you actually use it anywhere, otherwise the compiler  
will give you a warning because it hasn't seen the protoype yet.



--
m-s

On 04 Jun, 2008, at 16:26, James Cicenia wrote:


Wow..

I didn't know the order of methods was important.

thanks
James

On Jun 4, 2008, at 3:20 PM, Hamish Allan wrote:

On Wed, Jun 4, 2008 at 9:14 PM, James Cicenia <[EMAIL PROTECTED]>  
wrote:



why does it tell me:

warning: (Messages without a matching method signature will be  
assumed to

return 'id' and accept...


I'm guessing your method's definition comes after the code that uses
that method, and you haven't declared it in the header file.

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/mikey-san 
%40bungie.org


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: Newbie Question on a method signature

2008-06-04 Thread Michael Vannorsdel
If the method is defined above the place you use it, you can avoid  
compiler warnings.  But the most common and more correct thing to do  
is declare the method in the header with the rest of your class so  
anyone that imports that header will know the specifics of that method  
(and the compiler won't have to make assumptions).



On Jun 4, 2008, at 2:26 PM, James Cicenia wrote:


Wow..

I didn't know the order of methods was important.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Newbie Question on a method signature

2008-06-04 Thread Shawn Erickson
On Wed, Jun 4, 2008 at 1:26 PM, James Cicenia <[EMAIL PROTECTED]> wrote:
> Wow..
>
> I didn't know the order of methods was important.

They aren't really.

It is just a matter of the compiler seeing the declaration for a
method/function before it is used. You normally do that by declaring
the method in the classes interface block or in a private category
against your class (or class continuation under Objective-C 2.0) that
is included before code that uses the method.

If you omit the declaration but have the definition of method in the
implementation block before code that needs to use the method then the
definition acts as an implicit declaration of that method.

-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: Newbie Question on a method signature

2008-06-04 Thread James Cicenia

OK -

When I put the method ahead of the call it compiled and work.
So I decided to declare it in my header as:

- (UIColor *) returnUIForFont: (NSString *) theString;

Now the compiler complains:

/Users/jcicenia/Documents/iPhone/TOSPhone/ProjectViewController.m:142:  
warning: incomplete implementation of class 'ProjectViewController'
/Users/jcicenia/Documents/iPhone/TOSPhone/ProjectViewController.m:142:  
warning: method definition for '-returnUIForFont:' not found


What the heck is wrong with my declaration?

Thanks
James


Wh
On Jun 4, 2008, at 3:22 PM, Michael Vannorsdel wrote:

You have to make sure your header has - (UIColor *)  
returnUIColorForFont:(NSString *) theString in it so when you use  
the method in other source files the compiler will know what the  
arguments and return types to returnUIColorForFont: are.  Without  
this the compiler has to make assumptions and is warning you that it  
is doing so.


Also, to compare if strings are equal you can just do:

if([theString isEqualToString:@"1"])
//do stuff

Just another shorter method eventhough the way you're doing it is  
perfectly fine.



On Jun 4, 2008, at 2:14 PM, James Cicenia wrote:


I have the following:

	((ProjectListCell *)cell).budgetHealth.textColor = [self  
returnUIColorForFont:s];


And here is my method:


- (UIColor *) returnUIColorForFont:(NSString *) theString{
if([theString compare:@"1"] == NSOrderedSame){
return [UIColor greenColor];
}else if([theString compare:@"0"] == NSOrderedSame){
return [UIColor yellowColor];
}else if([theString compare:@"-1"] == NSOrderedSame){
return [UIColor redColor];
}else{
return [UIColor grayColor];
}
}


why does it tell me:

warning: (Messages without a matching method signature will be  
assumed to return 'id' and accept...


___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/james%40jimijon.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: Drawing over a QTCaptureView

2008-06-04 Thread douglas a. welton

Ben,

check out the documentation for QTCaptureView delegate:

	- (CIImage *)view:(QTCaptureView *)view willDisplayImage :(CIImage  
*)image


this will give you access to the display pipeline.

later,

douglas

On Jun 4, 2008, at 4:01 PM, Ben Lachman wrote:

I'm wonder what's the easiest way to draw a simple box over a  
QTCaptureView.  Overriding drawRect doesn't work and putting another  
view over the QTCV doesn't work.  Any Thoughts?


Thanks,
->Ben

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Newbie Question on a method signature

2008-06-04 Thread Hamish Allan
On Wed, Jun 4, 2008 at 9:38 PM, James Cicenia <[EMAIL PROTECTED]> wrote:

> What the heck is wrong with my declaration?

It's for a method called returnUIForFont:, not returnUIColorForFont:.

Take a few minutes to try to work out what's wrong before asking the
list. Finding your own mistakes is an important part of learning to
code.

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]


[SOLVED2] Code to convert NSDictionary to binary plist file?

2008-06-04 Thread David Hoerl

[For the archives, or anyone else interested in this topic]

Ken Thomases provided a shorter version, by having the NSData 
instance write the file. Jean-Daniel Dupas suggested using 
CFPropertyListWriteToStream to bypass the intermediate NSData object 
(a speed and memory footprint improvement)



int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];

NSString *err = nil;
NSData *plist;
NSDictionary *dict;
char *payload = "This is the payload";

dict = [NSDictionary dictionaryWithObjectsAndKeys:
@"Hello world", @"greeting",
[NSData dataWithBytes:payload length:strlen(payload)], @"payload",
[NSNumber numberWithInt:10], @"result",
nil ];

// 1 - get a XML (text) file representation
[dict writeToFile:@"/tmp/text.plist" atomically:NO];


// get a binary file representation - creates an additional 
NSData in memory object

plist = [NSPropertyListSerialization dataFromPropertyList:dict
format:NSPropertyListBinaryFormat_v1_0
errorDescription:&err];
if(plist == nil) {
NSLog(@"NSPropertyListSerialization error: %@", err);
return -1;
}
// 2 - have the NSData object save a binary representation
[plist writeToFile:@"/tmp/binary1.plist" atomically:NO];


// get a binary file representation - no additional memory footprint
// NOTE: documentation does not state it, but NSOutputStream 
creates the file if it does not yet exist
NSOutputStream *str = [NSOutputStream 
outputStreamToFileAtPath:@"/tmp/binary2.plist" append:NO];

if(str == nil) {
NSLog(@"cannot create output stream");
return -1;
}

// 3 - stream a binary representation
[str open];
CFIndex idx = CFPropertyListWriteToStream(dict, 
(CFWriteStreamRef)str, kCFPropertyListBinaryFormat_v1_0, (CFStringRef 
*)&err);

if(idx == 0) {
NSLog(@"CFPropertyListWriteToStream error: %x %@", err, err);
return -1;
}
[str close];


[pool drain];
return 0;
}
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSPredicateEditorRowTemplate: Custom templateView state

2008-06-04 Thread Mario Fischer

Hi Peter,

yes of course, thanks!

Am 04.06.2008 um 22:27 schrieb Peter Ammon:


On Jun 3, 2008, at 12:05 PM, Mario Fischer wrote:


Hi -

- I use the NSPredicateEditor with a custom  
NSPredicateEditorRowTemplate

- This custom component should implement something like this:
[Filesize] - [is smaller/greater than] - [Textfield] - [KB/MB/GB]

By overriding templateViews I'm able to add an additional  
NSPopupButton to the existing ones:


- (NSArray *)templateViews
{
NSArray* myviews = [super templateViews];
NSPopUpButton* myButton = [[NSPopUpButton alloc] init];
	[myButton addItemsWithTitles:[NSArray arrayWithObjects:@"KB",  
@"MB", @"GB", nil]];
	return [NSArray arrayWithObjects: [myviews objectAtIndex:0], 
[myviews objectAtIndex:1],[myviews objectAtIndex:2], myButton, nil];

}

But in predicateWithSubpredicates I can't find out, which of the  
entries the user selected:


- (NSPredicate *)predicateWithSubpredicates:(NSArray *)subpredicates
{
	[[[self templateViews] objectAtIndex:1] titleOfSelectedItem]; //  
works
	[[[self templateViews] objectAtIndex:3] titleOfSelectedItem]; //  
is always the first entry, regardless of the user selection..

...
}

What am I missing here / doing wrong?


Hi Mario,

Your code is creating a new instance of NSPopUpButton with every  
call to templateViews.   When you call templateViews again to check  
the value of the last popup, you get a different popup every time.


It looks like maybe you just accidentally declared myButton as a  
local variable instead of an instance variable.


-Peter


Mario Fischer | [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: invoking quicklook via code

2008-06-04 Thread Jonathan Dann

Is it possible to somehow just launch the quicklook window for a
quicktime file?


The quicklook framework is private and therefore should cannot be  
reliably used in an app.  There are a few site out there that give  
example code that calls it though.


You could use NSWorkspace to bring forward a Finder window and then  
*somehow* simulate a spacebar event on the file but I don't know how.   
Sorry.


Jon

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: 10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing

2008-06-04 Thread Corbin Dunn


On Jun 3, 2008, at 8:57 PM, Jerry Krinock wrote:

I use an NSOutlineView.  I have implemented an action, myAction,  
which is targetted by a main menu item, which is in turn assigned  
the keyboard shortcut cmd+upArrow.


In some situations, myAction is not allowed, so -validateMenuItem:  
in my window controller subclass returns NO.  I see that - 
validateMenuItem: is invoked whenever the menu is displayed, and it  
is also invoked whenever cmd+upArrow is typed.


When validateMenuItem: returns NO for myAction, the menu behaves as  
expected: Item is disabled.  And when I run my app in Mac OS  
10.4.11, the keyboard shortcut behaves as expected: NSBeep with no  
action.


But running in 10.5.3, upon typing cmd+upArrow, when - 
validateMenuItem: returns NO, there is no NSBeep and instead a  
different action happens: The selection is moved up.  Of course,  
this is the action that NSOutlineView normally performs in response  
to upArrow without the cmd key modifier.


So, it's like NSOutlineView steps in and says, "So sorry he couldn't  
do what you want, but here's a similar action of mine you might like!"


Is this a bug or a feature?  I've read through the "Numerous  
NSTableView and NSOutlineView enhancements" in the Leopard AppKit  
Release Notes [1] but can't find this one.


Feature!

First off, great job reading the release notes. That makes me happy!

Second, I suggest reading them further :)

http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSMenu

Disabled key equivalents passed throughPrior to Leopard, key  
equivalents corresponding to disabled menu items would be ignored.  
In Leopard, your application now has a chance to handle these. For  
example, a key equivalent for control-K on a disabled menu item will  
no longer block the emacs shortcut in an NSTextView, in Leopard.




-corbin
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSObjectController needless in "Intro to Bindings"?

2008-06-04 Thread Jochen Moeller

Thanks a lot for your explanation :-)

Cheers,
Jochen


Am 04.06.2008 um 11:21 schrieb Ken Thomases:


On Jun 4, 2008, at 3:18 AM, Jochen Moeller wrote:

I already read this link and thought that the NSArrayController  
"Mailbox" represents this intervening NSController between the  
model object and the table view because the table view is not bound  
direct to the model or a custom controller. To reformulate my  
question - Why is a second intervening NSController in form of an  
NSObjectController useful?


I believe (although I'm not certain) that it allows a single place  
to send the -commitEditing message to commit the editing of all  
relevant views, chained through the array controllers.  Without that  
single object controller, you'd have to send -commitEditing to each  
of the array controllers separately.


Also, there's no downside to using the NSObjectController.  It may  
have just been the author's habit.  It might be considered future- 
proofing.


As you note, it's not strictly necessary in that example.

Regards,
Ken


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: invoking quicklook via code

2008-06-04 Thread Nick Zitzmann


On Jun 4, 2008, at 3:48 PM, Jonathan Dann wrote:

The quicklook framework is private and therefore should cannot be  
reliably used in an app.  There are a few site out there that give  
example code that calls it though.



Since when was this? QuickLook is not a private framework, and it is  
possible for third-party apps to use it as a client without using any  
private APIs.


What third-party apps can't do is get a QuickLook QuickTime preview,  
which is what the Finder does when looking at QuickTime files. And I  
suspect the Finder is not using QuickLook on QuickTime files, but is  
instead using QuickTime directly.


Nick Zitzmann


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: invoking quicklook via code

2008-06-04 Thread Memo Akten
Thanks for the replies guys. What I would like to do, may be a lot  
simpler than what i may have explained. I just want my app to launch  
the quicktime movie, in what looks like exactly like the finder  
quicklook window - in fact if its possible to even somehow do it with  
an applescript or something - i.e. just tell finder to launch it! Is  
that possible?



Memo (Mehmet S. Akten)

www.memo.tv

[EMAIL PROTECTED]



On 4 Jun 2008, at 23:18, Nick Zitzmann wrote:



On Jun 4, 2008, at 3:48 PM, Jonathan Dann wrote:

The quicklook framework is private and therefore should cannot be  
reliably used in an app.  There are a few site out there that give  
example code that calls it though.



Since when was this? QuickLook is not a private framework, and it is  
possible for third-party apps to use it as a client without using  
any private APIs.


What third-party apps can't do is get a QuickLook QuickTime preview,  
which is what the Finder does when looking at QuickTime files. And I  
suspect the Finder is not using QuickLook on QuickTime files, but is  
instead using QuickTime directly.


Nick Zitzmann


___

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

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

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

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: invoking quicklook via code

2008-06-04 Thread Charles Steinman
--- Memo Akten <[EMAIL PROTECTED]> wrote:

> Is it possible to somehow just launch the quicklook
> window for a
> quicktime file? 

The publicly available way to activate Quick Look is
to call the qlmanage command line tool. Why they
didn't make the QuickLookUI framework public is beyond
me (I spent hours looking for a public API before I
realized it just wasn't there), but you can do
something similar with qlmanage -p.

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

Cheers,
Chuck


  
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: invoking quicklook via code

2008-06-04 Thread Nick Zitzmann


On Jun 4, 2008, at 4:25 PM, Memo Akten wrote:

Thanks for the replies guys. What I would like to do, may be a lot  
simpler than what i may have explained. I just want my app to launch  
the quicktime movie, in what looks like exactly like the finder  
quicklook window - in fact if its possible to even somehow do it  
with an applescript or something - i.e. just tell finder to launch  
it! Is that possible?



I'm pretty sure that can't be done with AppleScript unless  
accessibility is turned on. That setting is off by default, probably  
for security reasons.


Making your own window that looks precisely like the Finder's would be  
possible but difficult, since adding a play/pause button is not  
difficult, but the movie view slider is apparently impossible to  
duplicate using just QTKit. So some Carbon use will be necessary, and  
you can forget about 64-bit support... It may be easier to just use  
QTMovieView.


Nick Zitzmann


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: 10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing

2008-06-04 Thread Jerry Krinock


On 2008 Jun, 04, at 14:53, Corbin Dunn wrote:


http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSMenu

Disabled key equivalents passed throughPrior to Leopard, key  
equivalents corresponding to disabled menu items would be ignored.  
In Leopard, your application now has a chance to handle these. For  
example, a key equivalent for control-K on a disabled menu item


Thank you, Corbin.  I understand the pass-through now, but I still  
have an issue:

"cmd+upArrow" != "upArrow"

When I type cmd-upArrow, and myAction is disabled, the NSOutlineView  
executes the action (moving the selection up) which I thought was  
assigned to upArrow.


This seems to be incorrect, unless BOTH keyboard equivalents upArrow  
^and^ cmd+upArrow are assigned to NSTable/OutlineView's  
"moveSelectionUp" action.  I'm not sure, because I cannot find any  
documentation on precisely what are keyboard equivalents in NSTable/ 
OutlineView.  I realize that upArrow is not really a keyboard  
equivalent, more an over-ride of -keyDown, but the idea is the same.


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: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-04 Thread Steven Moore
 Have you tried turning on GC? At least that will move object  
finalization into a background thread.




You might want to look at NSLayoutManager -  
setAllowsNonContiguousLayout:


With both of these changes in place, and a bit of optimization on my  
part (apparently, [[myTextView textStorage] paragraphs] comes with a  
lot of overhead.. not surprising, when I think about it), my app is in  
much better shape. I think the garbage collection helped the most..  
pretty nifty stuff!


Thanks,
Steven
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: invoking quicklook via code

2008-06-04 Thread Jonathan Dann


On 4 Jun 2008, at 23:18, Nick Zitzmann wrote:



On Jun 4, 2008, at 3:48 PM, Jonathan Dann wrote:

The quicklook framework is private and therefore should cannot be  
reliably used in an app.  There are a few site out there that give  
example code that calls it though.



Since when was this? QuickLook is not a private framework, and it is  
possible for third-party apps to use it as a client without using  
any private APIs.


What third-party apps can't do is get a QuickLook QuickTime preview,  
which is what the Finder does when looking at QuickTime files. And I  
suspect the Finder is not using QuickLook on QuickTime files, but is  
instead using QuickTime directly.


Yeah sorry, should have been clearer, I was referring to the private  
QuickLookUI framework.


Jon

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: What's the NSMailDelivery replacement for Leopard and Beyond?

2008-06-04 Thread has


Buddy Kurz wrote:


For me it is a hot topic because after researching this subject two
years ago and reading said archives I started relying on
NSMailDelivery and now the powers that be have decided that it should
no longer be available. (wondering why?)
So I have to rewrite functional code and use a third party framework
or the scripting bridge which by the way isn't backwards compatible
with Tiger.


What's wrong with third-party frameworks? There's some excellent work  
out there and, assuming a compatible license, they're trivial to  
include in your application bundle for distribution. As for having to  
rewrite functional code; well, NSMailDelivery is only deprecated, not  
removed, at this point, so in principle you can continue using it for  
now (although it's probably good idea to look for an alternative  
sooner rather than later).


BTW, I wouldn't recommend using SB unless you specifically intend to  
interact with a particular mail client (or clients, bearing in mind  
that not every Mac user uses the same email client), given that it's  
hardly a transparent process: at the very least, users will notice  
when your app launches their mail client. I'll also mention that SB is  
lame and Mail's scripting interface buggy, so depending on what you  
need to do there may be some grinding of teeth involved at the very  
least. Best to ask on AppleScript-users mailing list if you need help  
there. Lastly, if backwards-compatibility is an issue for controlling  
scriptable applications, then your choices are either to invoke  
AppleScripts via NSAppleScript or use objc-appscript (another third- 
party framework that is, shockingly, better than the Apple alternative).


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.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: NSTextView causes lockups when appending too quickly and/or scrolling

2008-06-04 Thread Douglas Davidson


On Jun 4, 2008, at 3:54 PM, Steven Moore wrote:

With both of these changes in place, and a bit of optimization on my  
part (apparently, [[myTextView textStorage] paragraphs] comes with a  
lot of overhead.. not surprising, when I think about it), my app is  
in much better shape. I think the garbage collection helped the  
most.. pretty nifty stuff!


Anything in NSTextStorageScripting.h (like -paragraphs) is really  
intended for scripting only; stay away from it for other purposes.   
You should file a bug against the documentation to include a warning  
to that effect.  If you want to go through text by paragraphs, you  
should use [[textStorage string] paragraphRangeForRange:] or related  
methods.


Douglas Davidson

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 Cocoa and new Thread (Spinning Beach Ball an new Thread)

2008-06-04 Thread Alexander Hartner
I have an application which refreshes a NSTable with data from a  
network server. The refresh can take several seconds, and might even  
fail when the server is not accessible. During the refresh process I  
would like to display a sheet with a spinning progress indicator.


Everything worked sort of OK until I added some threading. The reason  
I wanted to add a new thread was to free up the main thread to prevent  
the spinning beach ball from appearing. The beach ball appeared every- 
time when then process took a little bit longer then it should.


On my main form I have a button which is link to the refresh action:

- (IBAction) refresh:(id)sender
{
	[NSThread detachNewThreadSelector:@selector(processRefreshGroup:)  
toTarget:self withObject:sender];

//[self processRefreshGroup:sender];
}

- (void) processRefreshGroup:(id)sender
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication sharedApplication];
	[application beginSheet:reloadGroupsPanel modalForWindow:[application  
keyWindow] modalDelegate:nil didEndSelector:nil contextInfo:nil];		

[application endSheet:reloadGroupsPanel];   
@try
{   
[reloadGroupsProgressIndicator startAnimation:sender];
[groups removeAllObjects];

//This method can take a long time to complete
[self doExpensiveWorkHere];

[reloadGroupsProgressIndicator stopAnimation:self];
[application stopModal];
[reloadGroupsPanel close];  
}
@catch (NSException * exception)
{
[reloadGroupsProgressIndicator stopAnimation:self];
[application stopModal];
[reloadGroupsPanel close];  

[errorMessageField setString:[exception reason]];
NSApplication * application = [NSApplication sharedApplication];
		[application beginSheet:errorPanel modalForWindow:[application  
keyWindow] modalDelegate:nil didEndSelector:nil contextInfo:nil];			

[application endSheet:errorPanel];  
}
//Reload data on NSTable
[groupSelectionTable reloadData];
[pool release];
}

I have a couple of questions:

1.) I gathered i have to create a new NSAutoReleasePool in my  
"threaded" method. Is this correct ?


2.) During execution of this I am updating the UI components from a  
thread which is not the main thread. This produces several error  
messages. How can I updated UI components. I tried using  
performSelectorOnMainThread, but this didn't work either. Not sure if  
this is the right approach.


3.) Is there an alternative way to achieve this without the beach ball  
appearing. I understand what caused it was the fact that I never  
exited the action method, at least not quickly. I would prefer an  
approach which did not require a new thread to be created.


Thanks for you help
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: invoking quicklook via code

2008-06-04 Thread Memo Akten
Thanks for the tips guys, qlmanage -p seems to do the trick for now -  
though I guess I won't have any control over it?  or can detect when  
its finished? (or can that be done with AppleScript or something)...


and now lets see if it works from within a QCPlugIn :P



Memo (Mehmet S. Akten)

www.memo.tv

[EMAIL PROTECTED]
+44 (0) 7958 783 832
+44 (0) 20 8123 9986

29 Ironworks
Dace Rd
London E3 2NX, UK


On 4 Jun 2008, at 23:29, Charles Steinman wrote:


--- Memo Akten <[EMAIL PROTECTED]> wrote:


Is it possible to somehow just launch the quicklook
window for a
quicktime file?


The publicly available way to activate Quick Look is
to call the qlmanage command line tool. Why they
didn't make the QuickLookUI framework public is beyond
me (I spent hours looking for a public API before I
realized it just wasn't there), but you can do
something similar with qlmanage -p.

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

Cheers,
Chuck





___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSAppleScript question

2008-06-04 Thread has


Matthew Delves wrote:


Greetings and salutations,
Is there a way to pass arguments into an AppleScript file using
NSAppleScript and other cocoa/obj-c classes?


Yes, see NSAppleEventDescriptor and -[NSAppleScript  
executeAppleEvent:error:]. It's a bit of a chore for anything non- 
trivial, particularly since NSAppleEventDescriptor provides only  
limited bridging between Cocoa classes and AE types, although there  
are ways to simplify the process somewhat (e.g. see the  
CallAppleScriptHandler sample project in the objc-appscript svn  
repository).




The reason that I ask is I am wanting to find out the path to a song
in iTunes. I have a script which does this for hard coded values,
though am uncertain as to how to accomplish it (or if it is indeed
possible) using NSAppleScript.


NSAppleScript is best used in situations where you want users to  
supply the scripts to be executed (what's known as making your  
application attachable). For interacting with applications yourself,  
the lower-level Carbon Apple Event Manager (the AEBuild* functions and  
AESendMessage are okay for simple tasks, although they get dreadfully  
tedious for anything complex), or one of the high-level Cocoa-Apple  
event bridges. Example using objc-appscript:



#import "ITGlue/ITGlue.h"

// To create iTunes glue: osaglue -o ITGlue -p IT iTunes

int main (int argc, const char * argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSError *error;
NSString *trackName = @"Real Men";

	ITApplication *itunes = [[ITApplication alloc] initWithBundleID:  
@"com.apple.itunes"];


	ITReference *trackRef = itunes libraryPlaylists] at: 1]  
fileTracks] byName: trackName];

id location = [[trackRef location] getItemWithError: &error];

if ([location isKindOfClass: [ASAlias class]])
NSLog(@"Track's file is at: %@", [location path]);
else if ([location isEqual: [ASConstant missingValue]])
NSLog(@"Track's file is missing.");
else
		NSLog(@"Some error occurred: %@", error); // e.g. -1728, object not  
found


[itunes release];
[pool drain];
return 0;
}


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.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: Manipulating images with meta-data

2008-06-04 Thread Randall Meadows

On Jun 3, 2008, at 3:11 PM, Heinrich Giesen wrote:


I'm about to resort to using a third-part solution


This is a good idea! My favourite program is exiftool by Phil Harvey:
http://www.sno.phy.queensu.ca/~phil/exiftool/

exiftool -Orientation=8 -n a.jpg

will do the job.


Yep, it does, and looks to be the perfect companion to jpegtran.   
Thanks for the pointer, I hadn't found this one in my searching.


On Jun 3, 2008, at 9:53 PM, Ken Ferry wrote:

Can we see the code you're using to write the CGImage to the  
CGImageDestination?


I suspect the difficulty may be that you expect the metadata to be  
carried with the CGImage.


I was thinking the CGImageSourceRef...

It isn't:  You can get all the metadata with  
CGImageSourceCopyPropertiesAtIndex, then you need to turn around


And I was getting them via CGImageSourceCopyProperties(), which, as  
you correctly state and I eventually found out, is wrong.


Last, I think rotation can be performed losslessly on a JPEG, but  
not with anything that ships on current versions of Mac OS X.  If  
that's important, you still might want an external library.


Yeah, I'm using jpegtran to do this, and for some reason (they make a  
lame [IMO] attempt at explaining why) they don't "fix" the orientation  
tag when it rotates an image.  So enter 'exiftool" as Heinrich  
suggested above.



On a related note, can anyone tell me if creating a CGImageSourceRef  
from a file, changing (only) its properties, and writing it back out-- 
does that cause another (lossy) JPEG compression?  As in:


cgImage = CGImageSourceCreateWithURL((CFURLRef)url, NULL);
imageRef = CGImageSourceCreateImageAtIndex(cgImage, 0, NULL);
tmpProps = (NSDictionary *)CGImageSourceCopyPropertiesAtIndex(cgImage,  
0, NULL);

props = [[tmpProps mutableCopy] autorelease];
[props setValue:[NSNumber numberWithInt:1] forKey:@"Orientation"];
fileURL = [NSURL fileURLWithPath:filePath];
imageDest = CGImageDestinationCreateWithURL((CFURLRef)fileURL,  
kUTTypeJPEG, 1, NULL);

CGImageDestinationAddImage(imageDest, imageRef, (CFDictionaryRef)props);
CGImageDestinationFinalize(imageDest);

Does this further degrade my image?
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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]


no copy/paste - responder chain problem?

2008-06-04 Thread Torsten Curdt
I have an app. First NIB loaded includes a menu with the usual edit  
items (copy/paste). Triggered from the menu I load another NIB and  
show a panel from it. None of the NSTextFields/NSTextViews support the  
usual copy-and-paste ...unless you use the context menu on them. Copy  
and paste are always disabled in the edit menu.


From what I can understand this might be related to the responder  
chain. But I am a little lost here.


Looking at the first responder of the second NIB that gets loaded I  
can't see any connections. Is that the problem?

But I also can't seem to make any connections?!

What's going on? Any pointers?

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: 10.5 Only: If I say NO, NSOutlineView ignores cmd key, does its own thing

2008-06-04 Thread Corbin Dunn


On Jun 4, 2008, at 3:37 PM, Jerry Krinock wrote:



On 2008 Jun, 04, at 14:53, Corbin Dunn wrote:


http://developer.apple.com/releasenotes/Cocoa/AppKit.html#NSMenu

Disabled key equivalents passed throughPrior to Leopard, key  
equivalents corresponding to disabled menu items would be ignored.  
In Leopard, your application now has a chance to handle these. For  
example, a key equivalent for control-K on a disabled menu item


Thank you, Corbin.  I understand the pass-through now, but I still  
have an issue:

   "cmd+upArrow" != "upArrow"

When I type cmd-upArrow, and myAction is disabled, the NSOutlineView  
executes the action (moving the selection up) which I thought was  
assigned to upArrow.


This seems to be incorrect, unless BOTH keyboard equivalents upArrow  
^and^ cmd+upArrow are assigned to NSTable/OutlineView's  
"moveSelectionUp" action.  I'm not sure, because I cannot find any  
documentation on precisely what are keyboard equivalents in NSTable/ 
OutlineView.  I realize that upArrow is not really a keyboard  
equivalent, more an over-ride of -keyDown, but the idea is the same.


That's true! Basically, NSTableView doesn't use the key equiv stuff  
(in other words, -interpretKeyEvents: isn't called, for various  
reasons), and overrides -keyDown: to do its logic. It doesn't stop  
doing stuff if cmd is down; in fact, it never has. I've had requests  
to make cmd-up/down move to the first/last rows, but there are various  
compatibility reasons why we don't do that (ie: it conflicts with  
Finder and open/save shortcuts).


It sounds like you think it is incorrect to have NSTableView handle  
cmd-up/down like plain up/down. Please log a bug for this; I'll  
consider changing it.


You can work around it by overriding -keyDown: in a nstableview  
subclass and not calling super if it is cmd + (up/down).


--corbin
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Bindings Cocoa and new Thread (Spinning Beach Ball an new Thread)

2008-06-04 Thread Hamish Allan
Hi Alex,

On Thu, Jun 5, 2008 at 12:10 AM, Alexander Hartner <[EMAIL PROTECTED]> wrote:

> 1.) I gathered i have to create a new NSAutoReleasePool in my "threaded"
> method. Is this correct ?

Yes.

> 2.) During execution of this I am updating the UI components from a thread
> which is not the main thread. This produces several error messages. How can
> I updated UI components. I tried using performSelectorOnMainThread, but this
> didn't work either. Not sure if this is the right approach.

See below.

> 3.) Is there an alternative way to achieve this without the beach ball
> appearing. I understand what caused it was the fact that I never exited the
> action method, at least not quickly. I would prefer an approach which did
> not require a new thread to be created.

Not really, no.

Here is some code I wrote a long time ago for doing something similar.
I had a document-based app that loaded MP3 files. For my app's
purposes, they had to be decoded to PCM data before they were useful,
so while that was happening I dropped a document-modal sheet with a
progress bar and a cancel button.

- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName
error:(NSError **)outError
{
if ([typeName isEqualToString:@"MP3 Audio File"])
{
myFileData = [data retain];
[self performSelector:@selector(startDecoding:) 
withObject:typeName
afterDelay:0];
[self performSelector:@selector(decodeMP3Data:) withObject:data 
afterDelay:0];
return YES;
}
else
return [super readFromData:data ofType:typeName error:outError];
}

- (void)startDecoding:(NSString *)typeName
{
myCancelProgressFlag = FALSE;
[progressSheetInfo setStringValue:
[@"Decoding " stringByAppendingString: (NSString *)typeName]];
[progressSheetBar setUsesThreadedAnimation:YES];
[progressSheetBar setIndeterminate:YES];
[progressSheetBar startAnimation:self];
[NSApp beginSheet:progressSheet
   modalForWindow:[[[self windowControllers] objectAtIndex:0] window]
   modalDelegate:nil
   didEndSelector:nil
   contextInfo:nil];
}

- (void)endDecoding:(id)userData
{
[progressSheetBar setIndeterminate:NO];
[progressSheetBar stopAnimation:self];
[progressSheet orderOut:self];
[NSApp endSheet:progressSheet];
}

- (void)decodeMP3Data:(id)data
{
[NSThread detachNewThreadSelector: @selector(decodeMP3DataThread:)
toTarget:self withObject:data];
}

- (void)decodeMP3DataThread:(id)data
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

myPCMData = [[AudioDecoder decodeMP3Data:data progressObject:self] 
retain];
[self performSelectorOnMainThread: myCancelProgressFlag ?
@selector(close) : @selector(endDecoding:)
withObject:nil waitUntilDone:NO];

[pool release];
}

- (BOOL)progressSheetCheck:(float)frac
{
if (myCancelProgressFlag)
return FALSE;

if ([progressSheetBar isIndeterminate])
{
[progressSheetBar setIndeterminate:NO];
[progressSheetBar stopAnimation:self];
}
[progressSheetBar setDoubleValue:(double)frac];

return TRUE;
}


The main loop of the decoder looked something like this:

while (moreToDo)
{
float progress = 0.0;
if ([progressObject progressSheetCheck:progress])
{
// do a small amount more
progress += small_amount;
}
else
break;
}

Hope this helps,
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: Bindings Cocoa and new Thread (Spinning Beach Ball an new Thread)

2008-06-04 Thread Randall Meadows

On Jun 4, 2008, at 5:10 PM, Alexander Hartner wrote:

I have an application which refreshes a NSTable with data from a  
network server. The refresh can take several seconds, and might even  
fail when the server is not accessible. During the refresh process I  
would like to display a sheet with a spinning progress indicator.


Everything worked sort of OK until I added some threading. The  
reason I wanted to add a new thread was to free up the main thread  
to prevent the spinning beach ball from appearing. The beach ball  
appeared every-time when then process took a little bit longer then  
it should.


On my main form I have a button which is link to the refresh action:

- (IBAction) refresh:(id)sender
{
	[NSThread detachNewThreadSelector:@selector(processRefreshGroup:)  
toTarget:self withObject:sender];

//[self processRefreshGroup:sender];
}

- (void) processRefreshGroup:(id)sender
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSApplication * application = [NSApplication sharedApplication];
	[application beginSheet:reloadGroupsPanel modalForWindow: 
[application keyWindow] modalDelegate:nil didEndSelector:nil  
contextInfo:nil];		

[application endSheet:reloadGroupsPanel];   
@try
{   
[reloadGroupsProgressIndicator startAnimation:sender];
[groups removeAllObjects];

//This method can take a long time to complete
[self doExpensiveWorkHere];

[reloadGroupsProgressIndicator stopAnimation:self];
[application stopModal];
[reloadGroupsPanel close];  
}
@catch (NSException * exception)
{
[reloadGroupsProgressIndicator stopAnimation:self];
[application stopModal];
[reloadGroupsPanel close];  

[errorMessageField setString:[exception reason]];
NSApplication * application = [NSApplication sharedApplication];
		[application beginSheet:errorPanel modalForWindow:[application  
keyWindow] modalDelegate:nil didEndSelector:nil  
contextInfo:nil];			

[application endSheet:errorPanel];  
}
//Reload data on NSTable
[groupSelectionTable reloadData];
[pool release];
}

I have a couple of questions:

1.) I gathered i have to create a new NSAutoReleasePool in my  
"threaded" method. Is this correct ?


Yes.

2.) During execution of this I am updating the UI components from a  
thread which is not the main thread.


Ruh-roh!


This produces several error messages. How can I updated UI components.


performSelectorOnMainThread


I tried using performSelectorOnMainThread,


There you go!


but this didn't work either. Not sure if this is the right approach.


Define "didn't work".  Maybe show us the code you used; I'm pretty  
this is the right way to do it.


3.) Is there an alternative way to achieve this without the beach  
ball appearing. I understand what caused it was the fact that I  
never exited the action method, at least not quickly. I would prefer  
an approach which did not require a new thread to be created.


You're on the right track; you must have had some other problem with  
your performSelectorOnMainThread solution.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 Cocoa and new Thread (Spinning Beach Ball an new Thread)

2008-06-04 Thread Stefan Werner


On Jun 4, 2008, at 4:10 PM, Alexander Hartner wrote:
1.) I gathered i have to create a new NSAutoReleasePool in my  
"threaded" method. Is this correct ?


Yes, every thread needs a separate AutoReleasePool. I don't know from  
the top of my head if NSThread creates one for you (I usually use  
pthreads and there you have to create your own).


2.) During execution of this I am updating the UI components from a  
thread which is not the main thread. This produces several error  
messages. How can I updated UI components. I tried using  
performSelectorOnMainThread, but this didn't work either. Not sure  
if this is the right approach.


Basic rule of threading on OS X: don't do any UI stuff whatsoever  
outside of the main thread.


3.) Is there an alternative way to achieve this without the beach  
ball appearing. I understand what caused it was the fact that I  
never exited the action method, at least not quickly. I would prefer  
an approach which did not require a new thread to be created.



Are you using blocking sockets to talk to the remote server? If so,  
using non-blocking sockets can help you do the entire communication  
based on events instead of polling.


-Stefan
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: invoking quicklook via code

2008-06-04 Thread has


Nick Zitzmann wrote:


Thanks for the replies guys. What I would like to do, may be a lot
simpler than what i may have explained. I just want my app to launch
the quicktime movie, in what looks like exactly like the finder
quicklook window - in fact if its possible to even somehow do it
with an applescript or something - i.e. just tell finder to launch
it! Is that possible?



I'm pretty sure that can't be done with AppleScript unless
accessibility is turned on.



GUI Scripting is crude and brittle and really a last resort when all  
else fails. Unfortunately, there's nothing in Finder's scripting API  
for invoking quicklook (its 'open' command just opens files in the  
default editor, equivalent to double-clicking them), so it may be the  
OP's only hope if they _really_ must have it. Though FWIW, GUI  
Scripting is just a wrapper around OS X's existing accessibility APIs,  
so going through AppleScript isn't really necessary at all.



It may be easier to just use QTMovieView.


Yeah, I think this would be the simplest and most reliable solution.  
(And by all means file feature requests on Finder for 10.6; its  
scripting interface is lagging its graphical one a bit these days.)


HTH

has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.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: RESTful API's - Easy way to interact?

2008-06-04 Thread Jeremy

Actually,

After reading more about the RESTful API that they are using, it looks  
like it requires Base64. Is there any C library that is free to use  
and allows this functionality?


Jeremy
"I have often felt that programming is an art form, whose real value  
can only be appreciated by another versed in the same arcane art;  
there are lovely gems and brilliant coups hidden from human view and  
admiration, sometimes forever, by the very nature of the process. You  
can learn a lot about an individual just by reading through his code,  
even in hexadecimal." - Unknown


On May 31, 2008, at 2:50 AM, Jens Alfke wrote:



On 30 May '08, at 7:16 PM, Jeremy wrote:

Now, I need to figure out how to use set GET, but I think that is  
working. The problem and it is crashing is because it is being  
encoded by every other method.


What? That sentence was incomprehensible. Apologies if you're not a  
native English speaker, but if we can't understand your descriptions  
we can't help you...



Here is an example in "pseudo code":
'Basic ' + Base64.encode(username + ':' + password)


Don't try to roll your own authentication code. NSURLConnection  
already supports authentication, including digest mode and Keychain  
integration. Read the documentation on the delegate methods,  
including the authentication-related ones.


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


Re: RESTful API's - Easy way to interact?

2008-06-04 Thread Joseph Heck
You might look in Jens MYUtilities package (http://mooseyard.com/hg/hgwebdir.cgi/MYUtilities/ 
) he has a nice category class for doing Base64 work on NSData -


http://mooseyard.com/hg/hgwebdir.cgi/MYUtilities/file/c59dec088990/Base64.h
http://mooseyard.com/hg/hgwebdir.cgi/MYUtilities/file/c59dec088990/Base64.m

There's also a variety of discussion and code tidbits on the CocoaDev  
wiki at http://www.cocoadev.com/index.pl?BaseSixtyFour


-joe

On Jun 4, 2008, at 5:19 PM, Jeremy wrote:

Actually,

After reading more about the RESTful API that they are using, it  
looks like it requires Base64. Is there any C library that is free  
to use and allows this functionality?


Jeremy
"I have often felt that programming is an art form, whose real value  
can only be appreciated by another versed in the same arcane art;  
there are lovely gems and brilliant coups hidden from human view and  
admiration, sometimes forever, by the very nature of the process.  
You can learn a lot about an individual just by reading through his  
code, even in hexadecimal." - Unknown


On May 31, 2008, at 2:50 AM, Jens Alfke wrote:



On 30 May '08, at 7:16 PM, Jeremy wrote:

Now, I need to figure out how to use set GET, but I think that is  
working. The problem and it is crashing is because it is being  
encoded by every other method.


What? That sentence was incomprehensible. Apologies if you're not a  
native English speaker, but if we can't understand your  
descriptions we can't help you...



Here is an example in "pseudo code":
'Basic ' + Base64.encode(username + ':' + password)


Don't try to roll your own authentication code. NSURLConnection  
already supports authentication, including digest mode and Keychain  
integration. Read the documentation on the delegate methods,  
including the authentication-related ones.


—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/heckj%40mac.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]


[Moderator] List Guidelines - PLEASE READ

2008-06-04 Thread Scott Anguish



Please stay on-topic


There are currently more than 4000 subscribers to this list.  In order  
to keep the list useful please stay on topic and stick to technical  
discussion.


While Apple engineers often subscribe to the list and answer  
questions, they do so on a volunteer basis. This is not an official  
support channel, and you should not expect an Apple engineer to  
provide the answer. Instead [EMAIL PROTECTED] for technical issues.


If someone posts a message that is off-topic, please do not reply to  
the list.  You should contact the sender directly or alert a  
moderator.  If a moderator flags a thread (typically with [Moderator]  
in the subject line), do not continue to post to that thread. Do feel  
free to contact the list admins at [EMAIL PROTECTED]  
with any issues.


If you post a message that is blatantly off-topic, you are liable to  
be moderated.



Discussing NDA and Private API
==

This list is not an appropriate forum for the discussion of issues  
that are covered by non-disclosure. Doing so will violate your NDA and  
the message will be forwarded to WWDR.


The discussion of Private API is also not appropriate for this list.  
Using private API is strongly discouraged as it can (and often does)  
change in future software revisions. If you feel some private API  
should be made public contact WWDR directly or file a bug using  
bugreporter.apple.com. Please do not advocate for those changes here,  
it isn't effective.




Other mailing lists
===

 Other Apple mailing lists that may be relevant are listed at:

in particular see:
Xcode-users: 

The Omni Group hosts a general Mac OS X developer list:


There is a Yahoo Group for discussion of business-related issues at:




List etiquette
==

When you post a message, bear in mind that you are asking several  
thousand people to listen to what you're saying. Please ensure that  
you abide by the list rules:


   
   
   In particular: please "Edit included messages in replies to
   minimize the amount of text."  There is no need, for example,
   to include the list footer in your reply.


 Before posting a question, please check the list archives (see  
"Online resources" below) and try searching Google. Many questions  
have been asked before and have already been answered.


 When you ask a question, whenever possible please:

1. Describe what your high-level goal is
2. Include any relevant code
3. If appropriate, include URLs to screenshots

   For more details, see:

   


   If you post a message to the list and do not get a reply, you  
should not simply repost the message.
   There may be reasons why no-one has answered, see the references  
above.
   If you want to send again, add more information or background, or  
explain what further steps

   you have taken in the interim to solve your problem.

   Note that you should never post to the list any message that was  
sent to you

   privately unless you have the original author's permission.



Cocoa-related resources
===

Cocoa-related resources that may answer your question without the need  
to wait for a reply from the list:



Apple's documentation
-

   The Cocoa Getting Started page.
   If you haven't read any Cocoa documentation and want to learn  
about

   the technology, you should begin with this.
   


Main documentation links:
   
   


Apple produces several kinds of documentation.  For an overview of how  
to use the documentation, see:


   
and
   

* Finding documentation

If you are not sure where to find documentation relevant to your  
problem, a useful strategy is to go to the API reference for a  
relevant class and look at its companion document.  You can also  
search the online documentation suite using the search field at the  
top right of the page (see, for example, ).  It is often a good idea to check the "Restrict to Cocoa" box.   
If you need more precise search, you can use the Advanced Search panel  
at .


Remember you can also view and search the documentation in Xcode --  
see the "Help" menu.  You can see all the methods associated with a  
class (an

  1   2   >