Re: [iPhone] Search control like in App Store

2009-01-06 Thread Martijn van Exel
Thanks - I looked into the TableSearch sample project and it seems to give
me enough pointers to implement what I want.I'm also learning a lot from the
UICatalog sample. I tend to stay away from Interface Builder, as is provides
more confusion than solutions, IMO.

Martijn

On Wed, Jan 7, 2009 at 06:44, Robert Marini  wrote:

> UISearchBar is a standard cocoa touch control.
>
> -rob.
>
>
> On Jan 6, 2009, at 7:35 AM, Martijn van Exel wrote:
>
>  Hi all,
>> I'm looking to implement a user selection from a large number of items
>> contained in a deep hierarchy (a taxonomy of species) for the iPhone.
>> The hierarchy is too deep for a drill-down of TableViews, so I thought a
>> control like the App Store iPhone application's Search tab would be a good
>> idea.
>> Is this a standard control in the iPhone SDK or is this something to
>> implement from scratch? Any other suggestions on how to approach this UI
>> challenge?
>>
>> Thanks,
>> --
>> martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/rob%40pinchmedia.com
>>
>> This email sent to r...@pinchmedia.com
>>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/mvexel%40gmail.com
>
> This email sent to mve...@gmail.com
>



-- 
martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/
___

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

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

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

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


Re: Repost Programmaric NSTextField not editable

2009-01-06 Thread livinginlosangeles
Unfortunately that didn't work. I moved the scrollview to its own  
window/windowcontroller, and the textfields that sit within the  
scrollview do allow me to edit them.



What happens if you (explicitly?) pass binding option
NSConditionallySetsEditableBindingOption with value NO?

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


Re: QTMovieLayer and QCCompositionLayer Don't Start

2009-01-06 Thread Gordon Apple
Try turning on garbage collection for CALayerEssentials and tell me if the
composition layer runs.  It doesn't here.


On 1/6/09 6:07 PM, "David Duncan"  wrote:

> On Jan 6, 2009, at 3:29 PM, Gordon Apple wrote:
> 
>> The only differences I can figure out is that Essentials loads it in
>> awakeFromNib and I am loading it much later under user command.
>> Also, my
>> layer hierarchy uses your suggested CATiledLayer installed as a
>> subview of
>> the view's layer, what I call my "content" layer.  My "attention"
>> layer (a
>> CALayer) is a sublayer of the content layer.  The composition layer
>> gets
>> created and installed (by command) in the attention layer.  Is there
>> anything here that could break some essential link with the view/
>> window that
>> would prevent it from playing?
> 
> 
> I don't see anything off hand, and can't think of any reason why that
> shouldn't work. I would probably recommend a bug report with a simple
> application that reproduces the error.
> --
> David Duncan
> Apple DTS Animation and Printing
> 

G. Apple



___

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

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

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

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


Re: [iPhone] Search control like in App Store

2009-01-06 Thread Robert Marini

UISearchBar is a standard cocoa touch control.

-rob.

On Jan 6, 2009, at 7:35 AM, Martijn van Exel wrote:


Hi all,
I'm looking to implement a user selection from a large number of items
contained in a deep hierarchy (a taxonomy of species) for the iPhone.
The hierarchy is too deep for a drill-down of TableViews, so I  
thought a
control like the App Store iPhone application's Search tab would be  
a good

idea.
Is this a standard control in the iPhone SDK or is this something to
implement from scratch? Any other suggestions on how to approach  
this UI

challenge?

Thanks,
--
martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/
___

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

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

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

This email sent to r...@pinchmedia.com




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

"Cannot finalize a class object"

2009-01-06 Thread Nick Zitzmann
I've searched around and found nothing useful. I'm working on a non- 
GUI Foundation application (thus no NSApplication or window server  
connection), and thought I'd turn on GC in the app.


The first thing it does is it calls objc_startCollectorThread() at the  
top of main(). Then later on in main(), I call an object's class  
method. Shortly afterward, I get the strangest exception on the  
collector thread:


*** +[CHException<0x1038140> finalize]: cannot finalize a class object

I wish I could ignore this, but unfortunately, the collector doesn't  
seem to recover from finalization exceptions very well, and the app  
crashes when attempting to allocate some scanned memory shortly  
afterward. I can take out this class method; it's not terribly  
important to the program's execution, but why is this happening and  
how do I work around this (other than taking it out)?


Nick Zitzmann


___

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

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

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

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


Re: 2-pixel borders in NSSplitView - I want 1 pixel. [SOLVED]

2009-01-06 Thread Graham Cox


On 7 Jan 2009, at 3:38 pm, Brandon Walkin wrote:

NSSplitView's thin style produces 1 pt thick dividers. You can  
verify this by asking the split view for it's -dividerThickness.  
What's likely happening in your document is that one of your  
subviews has it's border style set to something other than "none" in  
IB. Your divider would appear to be 2 pixels thick, but one pixel  
would be the divider and the other would be the subview's border.


To change the color, you can use BWSplitView (which it appears you  
already have loaded in IB). It's a subclass of NSSplitView which, at  
the moment, only adds one feature which is being able to set the  
color for thin dividers in the IB inspector.


The two common divider colors are 64,64,64 and 165,165,165. Please  
don't use black. :)


Brandon



Thanks, that was all it was... weird, I could have sworn I'd looked at  
that.


Don't worry, I don't want black...

--Graham


___

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

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

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

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


Re: Memory Management to NSError

2009-01-06 Thread Dong Feng
Thank you all for the answers.


2009/1/6 Dong Feng :
> How shall we handle the NSError object returned directly or indirectly
> (through out parameter)? Shall it be released after use? I checked
>  the example code in Apple document but never see a returned NSError
> object get released.
>
___

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

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

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

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


Re: 2-pixel borders in NSSplitView - I want 1 pixel.

2009-01-06 Thread Brandon Walkin
NSSplitView's thin style produces 1 pt thick dividers. You can verify  
this by asking the split view for it's -dividerThickness. What's  
likely happening in your document is that one of your subviews has  
it's border style set to something other than "none" in IB. Your  
divider would appear to be 2 pixels thick, but one pixel would be the  
divider and the other would be the subview's border.


To change the color, you can use BWSplitView (which it appears you  
already have loaded in IB). It's a subclass of NSSplitView which, at  
the moment, only adds one feature which is being able to set the color  
for thin dividers in the IB inspector.


The two common divider colors are 64,64,64 and 165,165,165. Please  
don't use black. :)


Brandon

On 6-Jan-09, at 11:05 PM, Graham Cox wrote:

My main document uses a split view with a main content area and a  
source-style list. I'm using the "thin" style of split view along  
with the excellent BWToolbarButton to achieve a standard Apple-ish  
look.


However, the split view ends up with a 2-pixel split bar, whereas  
all other apps I've seen with this layout have a 1-pixel bar. There  
is variation as to its colour in various apps also - some are black  
and some are grey. How can I set this to 1-pixel and/or set the  
colour? - do I need to subclass?



--Graham


___

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

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

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

This email sent to bwal...@gmail.com


___

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

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

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

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


Re: setTextColor, display string, then set it back not working

2009-01-06 Thread Graham Cox


On 7 Jan 2009, at 3:10 pm, Walker Argendeli wrote:

Further question though, other than kicking off a timer, is there a  
way I could get the text to flash on the screen red for a second, or  
is a timer the only way to accomplish that?



You could do it this way:


[myTextField performSelector:@selector(setTextColor:) withObject: 
[NSColor blackColor] afterDelay:1.0];



--Graham



___

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

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

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

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


Re: Programatically locking user screen

2009-01-06 Thread Walker Argendeli
What you're talking about is called kiosk mode, and there's  
compromises no matter how you go around it, but if you're intending  
the software for use in an instructional environment where other use  
of the computer shouldn't be vital while your app is running, then the  
impact shouldn't be an issue.
There are several ways to do this, and to get started, I'd recommend  
reading this apple article.  It's geared towards carbon, but parts of  
it can be applied to cocoa as well, take a look: http://developer.apple.com/technotes/tn2002/tn2062.html#Section3

Also, here's something from cocoadevcentral that may be of help:
http://cocoadevcentral.com/articles/28.php
Good luck!

On Jan 6, 2009, at 12:24 AM, Ashish Tiwari wrote:


Hi All,

How can I lock user screen (using cocoa+objC) that just a quote  
appears at
screen and user can not use their machine until my software unlocks  
the

screen.



You might find it rude but that is required as we are developing a  
training
room software and the trainer should we able to lock all student  
screens so

that student can just concentrate on trainingroom black/whiteboard.



Lanuching user machine screen saver wont do as the students might  
unlock the

screen saver by entering  password. Is there a way that I can create a
screen saver with a random password (not known to students).



Thanks in advance.



Ashish Tiwari | Software Engineer | Persistent Systems

  
ashish_tiw...@persistent.co.in  |

Cell: +91 9890276268 | Tel: +91 (712) 3987032

Innovation in software product design, development and delivery-
 www.persistentsys.com

___

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

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

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

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


Re: How to get the current view controller in iPhone application

2009-01-06 Thread Dave DeLong
Well, if you're using a TabBarController and a Navigation Controller,  
then theoretically you're having to use a ViewController to controller  
whatever is on the screen.  That means that in almost all  
circumstances (the exception being threaded code), the current view  
controller would be self.


If for some strange reason that doesn't work for you, then you can  
register an object (like an app controller or something) to receive  
notifications whenever a tab bar or navigation controller changes  
views, then just store a pointer to whatever the topViewController or  
selectedViewController is.


Dave

On 6 Jan, 2009, at 9:20 PM, Tharindu Madushanka wrote:


Hi
Can I get the class type of the current view controller running in the
application, I have Tab Controller and Navigation Controller in my
application, at some time I need to get the current view controller  
using

code, can any body please tell me a method or code segment to do this.
isKindOfClass: can be used to test the class type. But how can I get  
the

current active view contrller? please help me to solve this.
Thank you,
Tharindu

___

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

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

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

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


Re: Binary search on sorted NSArray in Cocoa?

2009-01-06 Thread Ken Thomases

On Jan 6, 2009, at 10:42 AM, Karan, Cem (Civ, ARL/CISD) wrote:

I know I'm being pedantic, but just to make sure, will the following  
code work?


	// mySortedArray is an NSArray of NSString instances that has been  
sorted

// via caseInsensitiveCompare:.  [...]

CFRange arrayRange;
arrayRange.location = 0;
arrayRange.length = [mySortedArray count];

CFIndex stringIndex;
stringIndex = CFArrayBSearchValues( mySortedArray,
arrayRange,
myString,
CFStringCompare,

kCFCompareForcedOrdering);


If the array has been sorted with caseInsensitiveCompare:, then you  
need to provide string comparison flags to match.  You would need  
kCFCompareCaseInsensitive|kCFCompareNonliteral.  Passing  
kCFCompareForcedOrdering when you didn't use NSForcedOrderingSearch  
when originally sorting the array seems like asking for trouble, too.


Regards,
Ken

___

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

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

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

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


How to get the current view controller in iPhone application

2009-01-06 Thread Tharindu Madushanka
Hi
Can I get the class type of the current view controller running in the
application, I have Tab Controller and Navigation Controller in my
application, at some time I need to get the current view controller using
code, can any body please tell me a method or code segment to do this.
isKindOfClass: can be used to test the class type. But how can I get the
current active view contrller? please help me to solve this.
Thank you,
Tharindu
___

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

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

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

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


Re: Asyncronous message handling

2009-01-06 Thread Keary Suska


On Jan 6, 2009, at 11:14 AM, Mohan Parthasarathy wrote:


Let us say that there are two objects A and B.

1) Object A produces some data
2) Object B consumes the data produced by object A

When object B sends a message to object A for fetching the data, the  
data is
not available immediately. When the data arrives later, it needs to  
notify

object B.

For example, object A fetches data from some web service and Object  
B is

some sort of a "controller". How does one handle this in Cocoa ?

- I can include the functionality of Object A within Object B itself  
and

hence there is no issue. But i guess this is prohibited as per the MVC
design.
- Object A can retain object B and later send the message back when  
data is
available. But then this creates a dependency of  object B knowing  
object A

and object A knowing object B. Is this okay ?
- Any other way ?



NSNotificationCenter? Object Delegation Pattern  ? Key-Value Observation?


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


Re: setTextColor, display string, then set it back not working

2009-01-06 Thread Walker Argendeli
I can't believe I didn't realize that.  Right now, I've got it set so  
that the last thing that block of code does is change the color to  
red.  The code is an if block, so if the value isn't zero-length, it  
will continue on.  Then, I have it change the color bak to black  
again, successfully keeping it red until a valid value is entered.   
Further question though, other than kicking off a timer, is there a  
way I could get the text to flash on the screen red for a second, or  
is a timer the only way to accomplish that?


On Jan 6, 2009, at 10:53 PM, Graham Cox wrote:



On 7 Jan 2009, at 7:34 am, Walker Argendeli wrote:

But if I uncomment the last line again, countDisplay remains black,  
displaying the message in black instead of red.  What's going on?


// Set display text to red for zero-length warning...
[countDisplay setTextColor:[NSColor redColor]];
[countDisplay setStringValue:@"***Please enter a string***"];
// ...and back again
[countDisplay setTextColor:[NSColor blackColor]];



You do realise that the time between setting red and then back to  
black is measured in nanoseconds, right? But even if your computer  
had a clock speed of 1Hz, you wouldn't see the change anyway because  
the screen is only updated at the end of each event cycle.


You need to arrange for the reset to black to occur after a useful  
time delay, maybe by kicking off a timer and then setting black in  
its callback method.


--Graham




___

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

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

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

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


Re: Repost Programmaric NSTextField not editable

2009-01-06 Thread Keary Suska


On Jan 6, 2009, at 5:12 PM, livinginlosange...@mac.com wrote:

I want to display a programmatic list of NSTextfields in a view that  
is enclosed in a scrollview.


I have a tabview whose view contains a scrollview which contains my  
custom view that I wish to display NSTextFields on. I can create the  
text fields and bind them to my model, however, I can't edit them  
despite having set the Textfield's setEditable method.


Would anyone have an explanation of this?



What happens if you (explicitly?) pass binding option  
NSConditionallySetsEditableBindingOption with value NO?


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


2-pixel borders in NSSplitView - I want 1 pixel.

2009-01-06 Thread Graham Cox
My main document uses a split view with a main content area and a  
source-style list. I'm using the "thin" style of split view along with  
the excellent BWToolbarButton to achieve a standard Apple-ish look.


However, the split view ends up with a 2-pixel split bar, whereas all  
other apps I've seen with this layout have a 1-pixel bar. There is  
variation as to its colour in various apps also - some are black and  
some are grey. How can I set this to 1-pixel and/or set the colour? -  
do I need to subclass?



--Graham


___

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

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

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

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


Switching Views on the iPhone

2009-01-06 Thread Steve Wetzel
I am trying to switch views in a view based application.  I have a  
button on the main view and in the ViewController code for that view I  
have the following:


-(IBAction)settings:(id)sender {
if(self.settingsViewController == nil) {
SettingsViewController *settings = [[SettingsViewController 
alloc]
initWithNibName:@"Settings" 
bundle:[NSBundle mainBundle]];
self.settingsViewController = settings;
[settings release];
}
	[self.navigationController  
pushViewController:self.settingsViewController animated:YES];

}

The code runs just fine but the second view does not appear.  I have  
set the class of my second view to SettingsViewController, and linked  
the view with the "Files Owner"


And yes, the button is attached to the method. I can step through it  
just fine.


What am I missing here?

Steve
___

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

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

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

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


Re: Memory Management to NSError

2009-01-06 Thread Ken Thomases

On Jan 5, 2009, at 8:16 PM, Dong Feng wrote:


How shall we handle the NSError object returned directly or indirectly
(through out parameter)? Shall it be released after use? I checked
the example code in Apple document but never see a returned NSError
object get released.


Others have already provided the answer, but I wanted to point out  
that this is explicitly documented in Apple's Memory Management  
Programming Guide for Cocoa.


Search for "Objects Returned by Reference" on this page: 
http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html

Regards,
Ken

___

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

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

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

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


Re: Programmatically locking user screen

2009-01-06 Thread Kyle Sluder
You might want to look at TN2062, "Guide to Creating Kiosks on Mac OS
X" ( http://developer.apple.com/technotes/tn2002/tn2062.html ) for
more information on accomplishing goals related to your product.  Jim
Dusseau has directly addressed your question, but the technote might
be helpful for further issues you encounter.

--Kyle Sluder
___

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

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

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

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


Re: How to get slider events as it moves?

2009-01-06 Thread Graham Cox


On 7 Jan 2009, at 11:25 am, Marcelo Cicconet wrote:


Is there a way to change this property via Interface Builder?



Yes, just check the "continuous" box.

--Graham


___

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

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

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

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


Re: setTextColor, display string, then set it back not working

2009-01-06 Thread Graham Cox


On 7 Jan 2009, at 7:34 am, Walker Argendeli wrote:

But if I uncomment the last line again, countDisplay remains black,  
displaying the message in black instead of red.  What's going on?


// Set display text to red for zero-length warning...
[countDisplay setTextColor:[NSColor redColor]];
[countDisplay setStringValue:@"***Please enter a string***"];
// ...and back again
[countDisplay setTextColor:[NSColor blackColor]];



You do realise that the time between setting red and then back to  
black is measured in nanoseconds, right? But even if your computer had  
a clock speed of 1Hz, you wouldn't see the change anyway because the  
screen is only updated at the end of each event cycle.


You need to arrange for the reset to black to occur after a useful  
time delay, maybe by kicking off a timer and then setting black in its  
callback method.


--Graham


___

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

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

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

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


Re: Design Advice - Bread Crumbs, NSPathControl

2009-01-06 Thread Mudi Dandan

Hi Rob,

Yes, you can do it by subclassing NSPathControl  and providing a  
custom NSPathComponentCell.
I have done it that way too, see the result here: http://www.binarynights.com/blog/wp-content/uploads/picture-9.png 
.


Though the height cannot be set from IB you can change it runtime  
calling setframe:.


Mudi


On Jan 4, 2009, at 3:34 PM, Rob Evans wrote:


Folks,

I'd like to include a "Bread Crumbs" control in my application and
wonder if extending NSPathControl would be appropriate. I'd like my
control to look something like what you see in Apple's Instruments [1]
or WebKits WebInspector [2]. Since these are path like structures, I
naturally thought I should subclass NSPathControl and provide my own
NSPathComponentCell to get the specific look I'm after.

I've written some code that seems to work but my NSPathControl
subclass, when drawn, isn't as tall as I'd like it to be.

Am I on the right track? Can the height of an NSPathControl be,
well... controlled.

[1] http://lpetr.org/blog/wp-content/uploads/2007/06/safari_webinspector1.png
[2] 
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/instruments_window.jpg
___

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

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

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

This email sent to m...@binarynights.com


___

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

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

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

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


Re: Graphics "playback" suggestion?

2009-01-06 Thread Ken Thomases

On Jan 5, 2009, at 11:09 PM, Robert Monaghan wrote:

I am trying to figure out what the best method is, to playback  
"generated" graphics.
I am downloading image data over ethernet, and then processing the  
imagery.


Currently I am creating a NSBitmapImageRep, and populating the  
buffer with my pixel data.

I then draw this inside an NSView.

If I create a for loop, the imagery isn't been updated in the view,  
even if I do a "setNeedsDisplay".


Is there a better way to do this?


-setNeedsDisplay: only _marks_ a view as needing display.  The actual  
display doesn't happen until you return control to the AppKit so it  
has a chance to update any windows needing display (or containing  
views needing display).


What you should be doing is receiving the image data asynchronously.   
You get a message each time a chunk of data is received.  You collect  
them as they come but you return to the main event loop after handling  
each one.  When an image is complete, you process it into a bitmap  
object and call -setNeedsDisplay: on your view.  Again, you return to  
the event loop after doing this.  The event loop will notice that your  
view needs display and will call your drawRect: method to redraw it.


You can read more:

Cocoa Drawing Guide: Views and Drawing
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/DrawingEnviron/chapter_2_section_6.html

Cocoa Drawing Guide: Using NSTimer for Animated Content
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/AdvancedDrawing/chapter_9_section_5.html

Cocoa Drawing Guide: Using Cocoa Animation Objects
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaDrawingGuide/AdvancedDrawing/chapter_9_section_6.html

View Programming Guide for Cocoa
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaViewsGuide/

Cheers,
Ken

___

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

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

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

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


Spell Checking in an iPhone App

2009-01-06 Thread Elmer Axelson


Hello.

 I am working on a little application for the iPhone and I want to  
use the built-in functionality that is used to check spelling. At  
least I hope it is built in.  I found a Cocoa class, NSSpellChecker,  
in the AppKit framework but it seems that this is only applicable for  
Mac OS programming.  Does anyone have any experience doing spell  
checking from an iPhone application?


  I also saw there was an NSSpellServer class but I cannot guarantee  
Internet access and I also think this would be too slow.


Many Thanks in advance.

Elmer Axelson
el...@me.com



___

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

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

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

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


NSArchiver binary format

2009-01-06 Thread Stefan Reitshamer
I want to read the "album data" in my iPhoto Library DB  
(Library6.iPhoto) -- the "dbAL" section.


The 2nd-13th bytes are \00bstreamtyped so it looks like an "old  
archive" (not NSKeyedArchiver-style) according to the "Archives and  
Serializations Programming Guide for Cocoa".


If I try to unarchive it with NSUnarchiver I get an  
NSArchiverArchiveInconsistency exception: "*** file inconsistency:  
read 'i', expecting '@'".


If I knew something about the binary file format I could probably  
figure out the problem.



Does anyone have a description of the binary format that NSArchiver  
produces?


Thanks
- Stefan Reitshamer

___

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

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

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

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


How to get slider events as it moves?

2009-01-06 Thread Marcelo Cicconet
Hi.
According to Davidson's book Learning Cocoa With Objective-C, "slider
issues events to the application as it moves". But that does not
occurs in my apps. I'm just getting an event at mouse-down time. I
found that this behavior is controlled by
"prefersTrackingUntilMouseUp" NSSliderCell's, whose default is YES.
But I am not able to overwrite this method properly.
Is there a way to change this property via Interface Builder?
Thank you so much for any help.

Marcelo C.

-- 
KEEP WORKING
___

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

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

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

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


Re: Programmatically locking user screen

2009-01-06 Thread Jim Dusseau
	What I've done in the past is to cover all screens with a floating  
borderless window.


On Jan 6, 2009, at 12:24 AM, Ashish Tiwari wrote:


Hi All,

How can I lock user screen (using cocoa+objC) that just a quote  
appears at
screen and user can not use their machine until my software unlocks  
the

screen.



You might find it rude but that is required as we are developing a  
training
room software and the trainer should we able to lock all student  
screens so

that student can just concentrate on trainingroom black/whiteboard.



Lanuching user machine screen saver wont do as the students might  
unlock the

screen saver by entering  password. Is there a way that I can create a
screen saver with a random password (not known to students).



Thanks in advance.



Ashish Tiwari | Software Engineer | Persistent Systems

  
ashish_tiw...@persistent.co.in  |

Cell: +91 9890276268 | Tel: +91 (712) 3987032

Innovation in software product design, development and delivery-
 www.persistentsys.com



___

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

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

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


This email sent to jimduss...@gmail.com



Jim Dusseau
jimduss...@gmail.com




___

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

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

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

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


setTextColor, display string, then set it back not working

2009-01-06 Thread Walker Argendeli
Ok, so I have a NSTextField (a label) called countDisplay, and when a  
zero-length string is entered into another text field, I'd like to  
change the color of countDisplay to red, display a message, and change  
back to black again.  Only problem is that it displays in black no  
matter what.  When I comment out the last line of this code, the  
string correctly displays in red, but then, since the last line is  
commented out, doesn't change back.  But if I uncomment the last line  
again, countDisplay remains black, displaying the message in black  
instead of red.  What's going on?


// Set display text to red for zero-length warning...
[countDisplay setTextColor:[NSColor redColor]];
[countDisplay setStringValue:@"***Please enter a string***"];
// ...and back again
[countDisplay setTextColor:[NSColor blackColor]];
___

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

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

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

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


Large Core Data memory allocations for small rows

2009-01-06 Thread Benjamin Rister
We're running into a situation where Core Data is making very large  
memory allocations when faulting in small amounts of data.


The entity has:
  - 2x Date
  - Int16
  - 4x Int32
  - Boolean
  - String
  - to-one relationship
  - String (in a subentity)
  - to-one relationship (in a subentity)
  - to-many relationship (in another subentity)

The row in the SQLite database matches this structure, there's nothing  
unexpected there.  And a database that contains about 8000 of them is  
a sum total of 1.1MB.


But when these are faulted in, according to Instruments, Core Data  
allocates a GeneralBlock-528384 per record!  Even if you naively  
preallocated a good chunk of memory for the strings, I can't imagine  
using more than 1-2KB per record, so  516KB is totally ridiculous.


The stack trace is:
   5 
   4 CoreData -[_NSFaultingMutableSet objectEnumerator]
   3 CoreData -[_NSFaultingMutableSet willRead]
   2 CoreData -[NSManagedObjectContext(_NSInternalAdditions)  
_retainedObjectWithID:optionalHandler:withInlineStorage:]
   1 CoreData + 
[NSManagedObject(_PFDynamicAccessorsAndPropertySupport)  
allocWithEntity:]

   0 CoreData _PFAllocateObject

I've checked instance variables in the NSManagedObject subclasses in  
case something silly was happening there, but with no luck.  The class  
for these rows has a BOOL and 5 pointers, inheriting from a class with  
no ivars, inheriting from NSManagedObject.


Any ideas/suggestions?

Thanks,
Benjamin Rister
___

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

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

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

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


setContentAspectRatio on window

2009-01-06 Thread Richard Bannister

Folks,

I'm using setContentAspectRatio to constrain the dimensions of a  
window to either 4:3 or 16:9.


However, I'd also like the ability to subsequently remove the  
constraint altogether. If I'm reading the API right then I should be  
able to do a setContentAspectRatio with a NSSize specifying 0, 0.  
However, if I do this, any further attempt to resize the window causes  
it to vanish outright.


Am I going mad, or have I found a bug?

Richard
___

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

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

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

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


Re: Cocoa-dev Digest, Vol 6, Issue 9

2009-01-06 Thread João Varela


On 2009/01/06, at 11:21, cocoa-dev-requ...@lists.apple.com wrote:


Date: Tue, 06 Jan 2009 12:36:24 +0530
From: Mahaboob 
Subject: Scheduling an application
To: "cocoa-dev@lists.apple.com" 
Message-ID: 
Content-Type: text/plain;   charset="US-ASCII"

I need to implement Scheduling In my application.For that I designed  
the UI
having date and time fields and ok and cancel button. When I'm  
clicking the
ok button, the opened project should be added into the schedule task  
and it

should work on time.

How can I invoke scheduler to my application? How can I add task to
Scheduler? I didn't find out any document regarding this.

Thanks in advance
mahaboob


I don't know what you mean. If you want schedule your application you  
can use Scheduler for Macintosh. You can download it here:


http://www.macscheduler.net/

JV
___

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

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

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

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


Asyncronous message handling

2009-01-06 Thread Mohan Parthasarathy
Hi,
I am new to cocoa and hence i have this basic question for which i could not
find a good answer after researching on this topic.

Let us say that there are two objects A and B.

1) Object A produces some data
2) Object B consumes the data produced by object A

When object B sends a message to object A for fetching the data, the data is
not available immediately. When the data arrives later, it needs to notify
object B.

For example, object A fetches data from some web service and Object B is
some sort of a "controller". How does one handle this in Cocoa ?

- I can include the functionality of Object A within Object B itself and
hence there is no issue. But i guess this is prohibited as per the MVC
design.
- Object A can retain object B and later send the message back when data is
available. But then this creates a dependency of  object B knowing object A
and object A knowing object B. Is this okay ?
- Any other way ?

Any help on this would be appreciated.

Thanks
mohan
___

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

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

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

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


Python-Cocoa Development

2009-01-06 Thread Nascimento, Ronaldo M.
I have spent some time developing in Obj-C and Cocoa, however most of my
previous work was done in python. So I am trying to develop Cocoa (AppKit)
stuff with Python and Xcode 3.1.2 but the documentation is sorely lacking.
And if this is not the appropriate mailing list for this I apologize.
-- 
Ronaldo Nascimento
IT Specialist, PVAMC
Facility Information Technology Service (FITS)
Office of Information & Technology (OI&T)
215-823-5259

___

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

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

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

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


[iPhone] Search control like in App Store

2009-01-06 Thread Martijn van Exel
Hi all,
I'm looking to implement a user selection from a large number of items
contained in a deep hierarchy (a taxonomy of species) for the iPhone.
The hierarchy is too deep for a drill-down of TableViews, so I thought a
control like the App Store iPhone application's Search tab would be a good
idea.
Is this a standard control in the iPhone SDK or is this something to
implement from scratch? Any other suggestions on how to approach this UI
challenge?

Thanks,
-- 
martijn van exel -+- mve...@gmail.com -+- http://www.schaaltreinen.nl/
___

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

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

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

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


Cocoa Client/Server App

2009-01-06 Thread Ammar Ibrahim
Hello,

I'm new to ObjC/Cocoa, I'm trying to write an App that is somehow
similar rsync, but for a specific purpose. More or less it does the
following:

* The App is Leopard only. I don't care about Tiger.
* A GUI Cocoa App which scans a certain directory for files and
displays them in a table view. The list of files is represented by an
array of a custom data structure needed by my application (This part
is already done)

The part that I want to start developing now is:

* A Client/Server component in the App, that will allow to instances
to transfer files to do a two way Sync of missing files on either end
* Add Bonjour capability as this App will only be used in local
networks, so I would like them to auto discover each other
* Add "Pairing" feature that allows one instance to only sync with the
paired instance (pretty much like AppleTV)
* Transfer the files back and forth in a multi threaded way, so that I
can maximize the throughput of the network

- I need help to get me started, as I couldn't find any tutorials on
creating a TCP server/client to transfer XML & binary files.
- I also need some help on how to create the threads in the server/client.
- How can I do the pairing option in a reliable manner?

Any help is highly appreciated.

Thanks,
Ammar
___

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

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

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

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


Design Advice - Bread Crumbs, NSPathControl

2009-01-06 Thread Rob Evans
Folks,

I'd like to include a "Bread Crumbs" control in my application and
wonder if extending NSPathControl would be appropriate. I'd like my
control to look something like what you see in Apple's Instruments [1]
or WebKits WebInspector [2]. Since these are path like structures, I
naturally thought I should subclass NSPathControl and provide my own
NSPathComponentCell to get the specific look I'm after.

I've written some code that seems to work but my NSPathControl
subclass, when drawn, isn't as tall as I'd like it to be.

Am I on the right track? Can the height of an NSPathControl be,
well... controlled.

[1] http://lpetr.org/blog/wp-content/uploads/2007/06/safari_webinspector1.png
[2] 
http://developer.apple.com/documentation/Cocoa/Conceptual/CocoaFundamentals/Art/instruments_window.jpg
___

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

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

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

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


Re: Binding of "Object" and "Value" in NSPopupButtonCell

2009-01-06 Thread Ken Thomases

On Jan 2, 2009, at 5:47 PM, Jerry Krinock wrote:

I want to add a "rank" attribute to the Employee class, an  
enumerated NSNumber representing something like this:


To further complicate things, the gods restrict the allowed ranks  
for employees they don't like.  To model this, the Employees class  
has defined a selector -allowedRanks which returns an array of the  
allowed ranks (NSNumbers) that the gods allow for the employee  
instance.


By trial and error, I have gotten this to work completely as desired  
with the following three bindings on the Table Column:


Bind "Content" to the array controller providing the table rows,  
with Controller Key set to selectedObject [2] and Model Key Path set  
to allowedRanks, and Value Transformer set to  
TransformArrayOfRankNumbersToStrings, a nonreversible value  
transformer which transforms an array of numbers to an array of the  
represented strings.


Bind "Content Objects" to the same array controller, same Controller  
Key and same Model Key Path, but no Value Transformer.


Bind "Selected Object" to the same array controller, Controller Key  
to arrangedObjects, Model Key Path set to 'rank', and Value  
Transformer set to TransformRankNumberToString, which is a  
simplified (scalar) but reversible version of the above-described  
TransformArrayOfRankNumbersToStrings.


But this seems like a real kludge, serially transforming things back  
and forth between the "represented" object and the "displayed" object.


I would think you would want "Content" to refer to the allowed ranks  
in their "raw" object form, not their string.  So, don't use a value  
transformer here.  You wouldn't bind "Content Objects" because it  
would just be the same as "Content".  In order to get proper display  
strings, you'd bind "Content Values".  You could declare a category on  
NSNumber to add a read-only "rankNameValue" property, and then bind  
"Content Values" to the key path allowedRanks.rankNameValue.  Or, you  
could bind to allowedRanks and keep your nonreversible value  
transformer.


Since the objects of the pop-up are now the raw number objects,  
binding "Selected Object" becomes trivial.  You just bind it to the  
"rank" property with no value transformer.


The docs don't make it crystal clear, but if I recall the release  
notes[1] do: the "Content Objects" or "Content Values" bindings must  
use a key path which is an extension of the "Content" key path.  The  
purpose of the contentValues binding is relatively straightforward:  
provide a better display value than the "whole" object would through  
its -description method.  The purpose of the contentObjects binding  
has mostly to do with the selection. It's the value that gets sets to  
the property bound to the selectedObject binding, and on settting up  
the pop-up, it's used to match the initially selected entry to the  
value obtained through the selectedObject binding.  Since your  
selection matches the "whole" object (the NSNumber held by an  
Employee's rank property), you don't need a separate contentObjects  
binding.



On another topic, you say you're binding "Content" with a Controller  
Key of "selectedObject" (which you define through a category as the  
first element of the array controller's selectedObjects property).   
This doesn't make sense to me.  The Controller Key should be  
arrangedObjects.  Otherwise, all of the rows of the column will show  
the rank for whichever row you select.


So the Content binding of the pop-up column might be (as displayed in  
IB) EmployeesController.arrangedObjects.allowedRanks.  This resolves  
to an array of arrays.  The outer array has as many elements as there  
are employees.  The elements within that are themselves arrays, the  
allowed ranks, as NSNumber objects, for each employee.  Similarly, for  
Content Values, binding to  
EmployeesController.arrangedObjects.allowedRanks.rankNameValue would  
produce an array of arrays -- for each employee, there would be an  
array of strings which are the names of the allowed ranks.



Cheers,
Ken

[1] Search for "contentObjects" on this page: 
http://developer.apple.com/releasenotes/Cocoa/AppKitOlderNotes.html

___

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

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

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

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


Re: .DS_Store files, dirContentsAtPath? (newb)

2009-01-06 Thread Chris Paveglio
Why I need it is simple- I need to show/count how many "user" files are in the 
folder, to the users. I'm migrating an Applescript based app to Cocoa.
I believe I neglected to mention that the folder I am looking at is on a 
Windows server, so any native-ignoring of .DS files might not work. But as I 
use the command, I can see that my count is "1" when really it should be "0" 
but doing terminal ls -A reveals hidden files to me.

I think I might try getting every file name of the folder, and then removing 
any file named ".DS_Store" or starts with ._ etc from the list, then counting 
that revised list. I'm working in a controlled environment at my office and I 
know these folders won't have more than say 100 items at a time, so time spent 
in a loop isn't a big factor for me.

Thanks Kirk...
ignoring invisible files
> Determining file visibility is tricky. There are at least
> three different ways that a file can be made invisible, and
> no one API that is guaranteed to test all of them.
> 
> 
> Sample code from online (not by me)
> 
> BOOL isInvisibleCFURL(CFURLRef inURL)
> {
> LSItemInfoRecord itemInfo;
> LSCopyItemInfoForURL(inURL, kLSRequestAllFlags,
> &itemInfo);
> 
> BOOL isInvisible = itemInfo.flags &
> kLSItemInfoIsInvisible;
> return isInvisible;
> }
> 
> To convert this into a category on NSString so you can use
> a simple filter on an array of file paths:
> (COMPOSED IN MAIL)
> 
> - (BOOL) isVisibleItem
> {
> NSURL * url = [NSURL fileURLWithString: self];
> return !isInvisibleCFURL(url);
> }
> 
> This is simplistic, but it should work in the vast majority
> of cases.
> 
> I suppose the other question is -- why are you ignoring
> invisible files?



  

___

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

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

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

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


Re: Custom NSControl is not visible when dropped on a window from IB3.1 Library

2009-01-06 Thread Jonathan Hess

Hey Richard -

Did you implement encodeWithCoder: and initWithCoder: in your two  
classes? If so, did you remember to call through to super's  
implementation in each case? Also, does your cell correctly implement  
copyWithZone?


I'd put a breakpoint in the drawing functions of the cell to see why  
the cell isn't drawing as expected. I'd also try poking at the control  
with the debugger, to make sure all of its instance variables have  
expected values.


Jon Hess

On Jan 4, 2009, at 6:41 PM, Richard Humiston wrote:

I have a custom NSControl and custom NSCell.  I created an IBPlugin  
and framework per IB Plugin programming guide, and also used the  
clock control example as a guide.  My  control appears (draws  
itself) in the library pane.  When I drag the control to a window in  
IB, only  a rectangle (made up of dots) appears.  The inspector sees  
the control in the window, displays its settings, etc.  I can drag  
the rect around the window and the control coordinates change in the  
inspector as expected.  If I change settings and save the nib file,  
the changes are saved and appear when I next open the nib...but only  
the rectangle appears.  I am not getting any errors, exceptions, etc  
in the debugger.  I would append code if I knew where the issue was  
located.  I am suspecting the the controls view is not inserted  
properly in the view hierarchy?  Has anyone seen this issue.  Any  
suggestions.


Rich
___

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

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

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

This email sent to jh...@apple.com


___

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

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

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

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


Re: Maintaining mutable values with NSDictionaryControllerKeyValuePair

2009-01-06 Thread Rick Hoge


I pulled my hair out over this one, but I finally found an  
acceptable workaround, although it doesn't solve the fundamental  
problem of NSDictionaryController.


Thanks very much for the reply and workaround.  I will explore this  
solution further.


The NSDictionaryController/bindings route seems to work fine if you  
have a simple mutable dictionary in which the keys are strings and the  
values are discrete objects like NSStrings or NSNumbers.  Then you can  
edit the values with no problem.  It just seems to get difficult when  
the dictionary values are themselves collections.  I could live with  
this I suppose, in cases where read-only display of the dictionary was  
the primary goal.  However it would really be nice to be able to edit  
the contents of collections, and the present limitations should really  
be mentioned in the documentation (maybe the current docs say so in  
some obtuse way, but if so I didn't catch it).


Thanks again,

Rick


___

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

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

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

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


Repost Programmaric NSTextField not editable

2009-01-06 Thread livinginlosangeles
I want to display a programmatic list of NSTextfields in a view that  
is enclosed in a scrollview.


I have a tabview whose view contains a scrollview which contains my  
custom view that I wish to display NSTextFields on. I can create the  
text fields and bind them to my model, however, I can't edit them  
despite having set the Textfield's setEditable method.


Would anyone have an explanation of this?

Patrick

___

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

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

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

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


Re: QTMovieLayer and QCCompositionLayer Don't Start

2009-01-06 Thread David Duncan

On Jan 6, 2009, at 3:29 PM, Gordon Apple wrote:


The only differences I can figure out is that Essentials loads it in
awakeFromNib and I am loading it much later under user command.   
Also, my
layer hierarchy uses your suggested CATiledLayer installed as a  
subview of
the view's layer, what I call my "content" layer.  My "attention"  
layer (a
CALayer) is a sublayer of the content layer.  The composition layer  
gets

created and installed (by command) in the attention layer.  Is there
anything here that could break some essential link with the view/ 
window that

would prevent it from playing?



I don't see anything off hand, and can't think of any reason why that  
shouldn't work. I would probably recommend a bug report with a simple  
application that reproduces the error.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: Convert GWorldPtr into a NSImage

2009-01-06 Thread glenn andreas


On Jan 6, 2009, at 5:42 PM, Graham Cox wrote:



It should be straightforward to wrap an NSBitmapImageRep around some  
of the GWorld formats. Not all of them are supported but ARGB 32-bit  
is. While GWorlds do not have an alpha channel QuickDraw does  
preserve the bits in the unused byte, but you will need to address  
the issue of setting those bits yourself somehow.




No, it doesn't.

QuickDraw will often, but not always, zero out the unused byte (and in  
some operations, do other things to it - for example, there are times  
when CopyBits will copy the extra byte from the source to the  
destination, and times when it won't)




Glenn Andreas  gandr...@gandreas.com
  wicked fun!
JSXObjC | the easy way to unite JavaScript and Objective C




___

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

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

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

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


iPhoto API to access the shared photos

2009-01-06 Thread Charles E. Heizer
Hello,
I have been hunting around the web and Apples' site and have not found what
I'm really looking for.

I'm looking for a way to connect to a shared iPhoto library and view the
photos. I can find the shared library using Bonjour (NSNetServiceBrowser),
but I cant seem to figure out how to connect and get the photos.

Does someone have any info on how to do this?

Thanks,
- Charles  

___

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

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

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

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


Re: Convert GWorldPtr into a NSImage

2009-01-06 Thread Graham Cox


On 7 Jan 2009, at 10:03 am, Eric Gorr wrote:

I have something that comes close, but the problem I believe is that  
the pixelFormat for the GWorldPtr is BGRA.


Why do you believe that? My recollection* is that a 32-bit RGB GWorld  
uses URGB (where U means 'unused' - GWorlds do not have an alpha  
channel). It's been a while but I used to work extensively with  
GWorlds. There may be a byte ordering issue on PPC vs. Intel though,  
since GWorlds were very much part of the 68k/PPC universe. Where has  
your GWorld come from?


*I looked it up in Inside Macintosh Volume 6, it's on page 17-6.

When I tried to setup a NSBitmapImageRep, I tried  
NSDeviceRGBColorSpace for the colorSpaceName which I believe expects  
the pixelFormat for the GWorldPtr to be either RGBA or ARGB.



It should be straightforward to wrap an NSBitmapImageRep around some  
of the GWorld formats. Not all of them are supported but ARGB 32-bit  
is. While GWorlds do not have an alpha channel QuickDraw does preserve  
the bits in the unused byte, but you will need to address the issue of  
setting those bits yourself somehow.


You don't say what you're trying to do or what you've tried, so I'm  
not sure what other advice I can give.


--Graham


___

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

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

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

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


Re: QTMovieLayer and QCCompositionLayer Don't Start

2009-01-06 Thread Gordon Apple
No, I'm not messing with the asynchronous property.

I went into essentials and had no problem playing a (even my own)
composition.  Just for testing, I created a hierarchy,
viewlayer:layer:layer:compositionLayer.  No problem.  Essentials still
played it.

The only differences I can figure out is that Essentials loads it in
awakeFromNib and I am loading it much later under user command.  Also, my
layer hierarchy uses your suggested CATiledLayer installed as a subview of
the view's layer, what I call my "content" layer.  My "attention" layer (a
CALayer) is a sublayer of the content layer.  The composition layer gets
created and installed (by command) in the attention layer.  Is there
anything here that could break some essential link with the view/window that
would prevent it from playing?

Is there anything I could be missing in the environment?


On 1/6/09 3:03 PM, "David Duncan"  wrote:

> On Jan 6, 2009, at 11:53 AM, Gordon Apple wrote:
> 
>> Note:  There is no equivalent to "play" for a composition (at least
>> that I
>> am aware of).  I get the initial frame and no play.  My composition
>> layer is
>> four levels deep:
>> viewLayer:contentLayer:attentionLayer:compositionLayer.
>> Other stuff, including movieLayers, work fine at that level.  I'm
>> using
>> standard compositions (plus one of my own derived from the tutorial)
>> which
>> all play just fine independently and in Quartz Composer.
> 
> Are you changing the asynchronous property of the QCCompositionLayer?
> 
>> Is there something about " composition tracks the Core Animation
>> layer time"
>> that I am missing, on need to include?  I notice that all of the
>> sample code
>> includes animating some parameter.  I just want the composition to
>> play.  Do
>> I need to be feeding it an animation "clock" signal to make it play?
> 
> 
> Try replacing the composition in the CALayerEssentials sample
> > 
> 
> If it fails there, then there may be something stranger going on. If
> not, determining how to replicate the issue from there and filing a
> bug report may be your best option.
> --
> David Duncan
> Apple DTS Animation and Printing
> 

G. Apple



___

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

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

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

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


Re: Enum advice please (resend not sure if it was delivered ?)

2009-01-06 Thread Damien Cooke

Jeremy,
Thanks, as it turns out if I put it above the @interface statement in  
the header file it works like a treat as you would I suspect as it  
should not be part of the class that I was building.


Regards
Damien

On 06/01/2009, at 8:43 PM, Jeremy Pereira wrote:



I pasted your code into a simple C program and it compiled no  
problem.  Is it possible that the error is in the previous  
declaration to the typedef?  Bear in mind it might be a problem in a  
header file.


On 5 Jan 2009, at 10:49, Damien Cooke wrote:



Hi all,
I have the following code:


typedef enum _DCDBTypes
{
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2
}DCDBTypes;

It gives me this error message.

error: expected specifier-qualifier-list before 'typedef'

If I try to use it like this

- (void)setItemType:(DCDBTypes) newType;

I get this error message

error: expected ')' before 'DCDBTypes'

I have stared at this piece of code for so long, I know it is  
something stupid I have assumed or done, please glance over it and  
point me in the right direction if possible.



Regards
Damien




"We act as though comfort and luxury were the chief requirements of  
life, when all that we need to make us happy is something to be  
enthusiastic about."


-- Albert Einstein




___

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

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

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

This email sent to a...@jeremyp.net




I Remenber When Synthesizers were Analogue
Programs were somthing you watched on T.V
and a hard drive was from Sydney to Adelaide!





___

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

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

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

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


Convert GWorldPtr into a NSImage

2009-01-06 Thread Eric Gorr

I need a reliable way to convert a GWorldPtr into a NSImage.

I've tried searching for some sample code, but I cannot seem to find  
any for the direction I want to go in...


Anyone have any pointers to some sample code that will do this?

I have something that comes close, but the problem I believe is that  
the pixelFormat for the GWorldPtr is BGRA. When I tried to setup a  
NSBitmapImageRep, I tried NSDeviceRGBColorSpace for the colorSpaceName  
which I believe expects the pixelFormat for the GWorldPtr to be either  
RGBA or ARGB.


Thank you.
___

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

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

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

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


Re: Maintaining mutable values with NSDictionaryControllerKeyValuePair

2009-01-06 Thread Simone Manganelli

Rick --

I pulled my hair out over this one, but I finally found an acceptable  
workaround, although it doesn't solve the fundamental problem of  
NSDictionaryController.


What I ended up doing is setting the whole outer dictionary (the one  
controlled by the NSDictionaryController) via a KVO-compliant method.   
This sucks because it means that you'll have to manually write methods  
for the actions of your UI controls instead of relying on bindings to  
do it for you.  But it *does* get around the paradox of either being  
unable to set properties of an individual object in the dictionary or  
violating KVO-compliance.


So, for example, in my project, my NSDictionaryController is bound to  
the entriesDict of the selected EPWeblog object in my master-detail  
interface.  When I want to change one of the objects in the  
dictionary, I do the following:


NSMutableDictionary *tempMutDict = [NSMutableDictionary  
dictionaryWithDictionary:[weblog entriesDict]];

[tempMutDict setObject:dictionaryValue forKey:theExistingKey];
[weblog setEntriesDict:tempMutDict];

entriesDict is a property of the EPWeblog object (the variable  
'weblog'), and it's KVO-compliant via the entriesDict and  
setEntriesDict: methods.  So I simply copy the outer dictionary,  
change the one object in the dictionary (represented by the new  
dictionaryValue variable), and then set the outer dictionary via the  
setEntriesDict: method.  If you call addObject: to your  
NSDictionaryController, it does precisely the same thing  -- it adds a  
new object and sets the whole outer dictionary via the appropriate KVO- 
compliant method.


After all this, I too am planning to file a bug on  
NSDictionaryController because this is pretty ridiculous for something  
that should be straightforward.  I did a bunch of subclassing to  
figure out exactly what NSDictionaryController was doing.  Even if the  
dictionary it's controlling contains mutable values inside its  
objects, NSDictionaryController represents them as immutable objects.   
It's infuriating.


It does make me feel better that someone else is having this same  
problem, though. :)


-- Simone



Il giorno 2009-01-06, alle ore 14:06, Rick Hoge ha scritto:



I'm using an NSDictionaryController object to control the data  
provided to an NSTableView object.  I'm attempting to use key-value  
coding through the dictionary controller to manipulate the data in  
a bindings-compatible way, by calling the method -arrangedObjects  
on the NSDictionaryController, and then manipulating the  
NSDictionaryControllerKeyValuePairs that this method returns in an  
array.


Any luck?

I am having a similar problem - mutable dictionary objects that are  
themselves stored in a dictionary will be presented as immutable  
dictionaries by the NSDictionaryController.  This makes it  
impossible to bind controls to keypaths that drill into dictionaries  
below the level of the outermost container.


i.e. even if arrangedObjects.value should point to a mutable  
dictionary, attempts to edit arrangedObjects.value.someKey via a UI  
control will generate the following error:


*** -[NSCFDictionary setObject:forKey:]: mutating method sent to  
immutable object


Having a workaround for this would be really nice - has anyone found  
one?  I will file a bug as I don't think this is the behavior most  
would expect.


This is turning something that would have "just worked" in about  
fifteen minutes into yet another quest for a messy workaround...


Thanks in advance,

Rick


___

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

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

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

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


Re: Maintaining mutable values with NSDictionaryControllerKeyValuePair

2009-01-06 Thread Rick Hoge


I'm using an NSDictionaryController object to control the data  
provided to an NSTableView object.  I'm attempting to use key-value  
coding through the dictionary controller to manipulate the data in a  
bindings-compatible way, by calling the method -arrangedObjects on  
the NSDictionaryController, and then manipulating the  
NSDictionaryControllerKeyValuePairs that this method returns in an  
array.


Any luck?

I am having a similar problem - mutable dictionary objects that are  
themselves stored in a dictionary will be presented as immutable  
dictionaries by the NSDictionaryController.  This makes it impossible  
to bind controls to keypaths that drill into dictionaries below the  
level of the outermost container.


i.e. even if arrangedObjects.value should point to a mutable  
dictionary, attempts to edit arrangedObjects.value.someKey via a UI  
control will generate the following error:


 *** -[NSCFDictionary setObject:forKey:]: mutating method sent to  
immutable object


Having a workaround for this would be really nice - has anyone found  
one?  I will file a bug as I don't think this is the behavior most  
would expect.


This is turning something that would have "just worked" in about  
fifteen minutes into yet another quest for a messy workaround...


Thanks in advance,

Rick
___

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

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

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

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


Re: Overriding NSTextField keyDown?

2009-01-06 Thread Mr. Gecko

oh yeah forgot about that.

Thanks

On Jan 6, 2009, at 3:10 PM, Douglas Davidson wrote:



On Jan 6, 2009, at 1:05 PM, Mr. Gecko wrote:

I didn't know this went up, I figured out how to do this like  
saturday.
- (BOOL)control:(NSControl *)control textView:(NSTextView  
*)textView doCommandBySelector:(SEL)commandSelector {
	if ([NSStringFromSelector(commandSelector)  
isEqualToString:@"insertNewline:"]) {

[self goToURL:self];
return YES;
}
return NO;
}



Something like that should do the trick.  I should point out that  
you can compare the selector you receive directly to  
@selector(insertNewline:); you don't need to convert to strings.


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


Re: Overriding NSTextField keyDown?

2009-01-06 Thread Douglas Davidson


On Jan 6, 2009, at 1:05 PM, Mr. Gecko wrote:

I didn't know this went up, I figured out how to do this like  
saturday.
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView  
doCommandBySelector:(SEL)commandSelector {
	if ([NSStringFromSelector(commandSelector)  
isEqualToString:@"insertNewline:"]) {

[self goToURL:self];
return YES;
}
return NO;
}



Something like that should do the trick.  I should point out that you  
can compare the selector you receive directly to  
@selector(insertNewline:); you don't need to convert to strings.


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


Re: Overriding NSTextField keyDown?

2009-01-06 Thread Mr. Gecko

I didn't know this went up, I figured out how to do this like saturday.
- (BOOL)control:(NSControl *)control textView:(NSTextView *)textView  
doCommandBySelector:(SEL)commandSelector {
	if ([NSStringFromSelector(commandSelector)  
isEqualToString:@"insertNewline:"]) {

[self goToURL:self];
return YES;
}
return NO;
}

On Jan 6, 2009, at 12:28 PM, Douglas Davidson wrote:



On Jan 2, 2009, at 3:45 PM, Mr. Gecko wrote:

Hello, I've been trying to override the NSTextField keyDown method,  
but it didn't seem to work. I've searched in the archives, but got  
nowhere, all I could find is to override the text field editor. But  
how could I do that?
This is all very confusing. All I really need to do is when the  
user push return (36) or enter (76) it will run a method goTo. and  
eventually I'll want to do the up and down arrows.


You really don't want to do that.  What you need to do is to work  
with the frameworks rather than against them, and everything will go  
smoothly.  NSTextFields and other controls handle all of the  
standard keystrokes themselves, but of course they allow you to  
override their behavior at many points.  The first thing to do would  
be to try some of the tutorials that handle text fields, in  
particular using IB to set up the target-action mechanism.


If that doesn't quite suit your needs, but what you're interested in  
is learning when a particular field has ended editing, there's a  
standard notification you can listen for.  If you want to customize  
a text field and give special handling to certain special keys,  
there's a delegate method -control:textView:doCommandBySelector:.


What you definitely don't want to do is override keyDown:.  In the  
first place, it isn't the text field that gets the keyDown:, but the  
field editor; but even if you had a custom field editor, you  
wouldn't want to override keyDown:, because doing so will break most  
input methods.  Dealing with raw key strokes is too crude for the  
needs of modern text input--that's why we have all of these other  
override points.  Check the archives for my earlier messages on this  
topic.


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


Re: QTMovieLayer and QCCompositionLayer Don't Start

2009-01-06 Thread David Duncan

On Jan 6, 2009, at 11:53 AM, Gordon Apple wrote:

Note:  There is no equivalent to "play" for a composition (at least  
that I
am aware of).  I get the initial frame and no play.  My composition  
layer is
four levels deep:   
viewLayer:contentLayer:attentionLayer:compositionLayer.
Other stuff, including movieLayers, work fine at that level.  I'm  
using
standard compositions (plus one of my own derived from the tutorial)  
which

all play just fine independently and in Quartz Composer.


Are you changing the asynchronous property of the QCCompositionLayer?

Is there something about " composition tracks the Core Animation  
layer time"
that I am missing, on need to include?  I notice that all of the  
sample code
includes animating some parameter.  I just want the composition to  
play.  Do

I need to be feeding it an animation "clock" signal to make it play?



Try replacing the composition in the CALayerEssentials sample 


If it fails there, then there may be something stranger going on. If  
not, determining how to replicate the issue from there and filing a  
bug report may be your best option.

--
David Duncan
Apple DTS Animation and Printing

___

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

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

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

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


Re: Removing CALayer after Animation

2009-01-06 Thread Matt Long

Bridger,

As far as I can tell there is nothing inherent in the CA API to do  
what you want, however, KVC is available to you. When you create your  
animation, do this:


[animation setValue:objectLayer forKey:@"parentLayer"];

Where objectLayer is the layer the animation is going to be run on.  
Then, in your -animationDidStop, you can grab the layer like this:


- (void)animationDidStop:(CAAnimation *)theAnimation finished:(BOOL)flag
{
  CALayer *layer = [theAnimation valueForKey:@"parentLayer"];
  if( layer )
  {
NSLog(@"The layer object was: %@ (%@)", layer, [layer name]);
[layer removeFromSuperlayer];
  }
}

I named my layer when I created it with a call to [objectLayer  
setName:@"parentLayer"] in this code, so the NSLog in - 
animationDidStop won't display the name unless you've done the same.


Best regards,

-Matt


On Jan 3, 2009, at 9:47 PM, Bridger Maxwell wrote:


Another question on Core Animation.

I am creating temporary CALayers, and animating them across a parent  
layer.
I would like to delete the layers once they have reached their  
destination.
I are using the delegate method animationDidStop:finished: on the  
animation,
but it returns only a reference to the animation object that  
finished, and I

don't know how to figure out what layer the animation was associated.
Without this information, I don't know which layer we should remove.  
Any

help would be great.

Thank You,
Bridger Maxwell

___

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

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

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

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


Re: Countdown With NSTimer - Hours, Minutes, Seconds Remaining?

2009-01-06 Thread Sean McBride
On 1/4/09 1:17 AM, Chunk 1978 said:

>since this timer i'm writing is based on NSDate, it's effected if the
>computer's clock is manually changed... that i don't mind, because who
>really need to ever manually set their clock on the computer...
>however, i'm concerned that if (probably when) my timer is running
>during a daylight savings shift it will add/subtract an hour... i
>guess there's no avoiding this?  or maybe apple took this into account
>and therefore currently running code is not effected by a daylight
>savings shift?

To get notified of either a DST change, or the user manually changing
the clock, the only way is to use a Carbon event:

EventTypeSpec eventType;
eventType.eventClass = kEventClassSystem;
eventType.eventKind = kEventSystemTimeDateChanged;

EventHandlerUPP eventHandlerUPP = Ne
wEventHandlerUPP(DateTimeChangeEventHandler);
EventHandlerRef eventHandlerRef = NULL;
(void)InstallApplicationEventHandler(
eventHandlerUPP,// inHandler
1,  // inNumTypes
&eventType, // inList
self,   // inUserData
&eventHandlerRef);

--

Sean McBride, B. Eng s...@rogue-research.com
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 arch...@mail-archive.com


RE: Table sort image question

2009-01-06 Thread Jon C. Munson II
Thanks for that correction.

I created a subclass of an NSArrayController (which provides the data from a
CoreData entity to the table) and implemented the method in the subclass.  

At first I had a little trouble, then, after scanning the ref you sent, I
set the dataSource outlet for the tableView to the NSArrayController (which
I wasn't sure if I needed to do or if it would "break" anything), and it
seems to work just peachy.

One more follow-on question:  if one is using an NSArrayController to
provide data to tableView columns, is it wise to set the dataSource outlet
to that controller or does doing so create unnecessary overhead?

Peace, Love, and Light,

/s/ Jon C. Munson II

-Original Message-
From: Andy Lee [mailto:ag...@mac.com] 
Sent: Tuesday, January 06, 2009 2:31 PM
To: jmun...@his.com
Cc: 'Graham Cox'; 'cocoa dev'
Subject: Re: Table sort image question


On Jan 6, 2009, at 2:18 PM, Jon C. Munson II wrote:

> OK, I looked into the method:
>
> - (void)  tableView:(NSTableView*) aTableView  
> sortDescriptorsDidChange:
> (NSArray*) oldDescriptors
>
> And decided to give it a shot after much play with the prior  
> method.  In
> that prior method I found that the sortDescriptors and Prototype  
> were not
> getting changed as expected, thus my use of those items wasn't valid.
> Certain values in the descriptors weren't changing as expected.
>
> So, I created a subclass of NSTableView to implement the method above.
>
> I found that sortDescriptorsDidChange is not getting called.

You are supposed to implement the above method in the table view's  
*data source*.



The full name of the method is tableView:sortDescriptorsDidChange:.   
It takes two arguments, the first being the table view whose sort  
descriptors changed.

--Andy


>
>
> I am not able to find any further reference to implementation of  
> that method
> to make sure I implemented it correctly.
>
> My subclass isn't complicated, essentially containing a pointer to  
> the view
> which needs to stay in sync with the table (so I can call a method  
> to update
> the sortDescriptors for the underlying data), and the method above.
>
> Did I miss something?  Based on what I see, I think the  
> sortDescriptors
> aren't even being used when the column sort happens...or is that wrong
> thinking?
>
> Thanks in advance!
>
> Peace, Love, and Light,
>
> /s/ Jon C. Munson II
>
> -Original Message-
> From: Jon C. Munson II [mailto:jmun...@his.com]
> Sent: Tuesday, January 06, 2009 10:09 AM
> To: 'Graham Cox'
> Cc: 'cocoa dev'
> Subject: RE: Table sort image question
>
>
> On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote:
>
>> 1.  When is didClickTableColumn actually called?  Is it after the
>> table does
>> its stuff, including setting the sort descriptors, or just prior to
>> that?
>
>
> This is not the method you want. You want the NSTableDataSource  
> method:
>
> - (void)  tableView:(NSTableView*) aTableView  
> sortDescriptorsDidChange:
> (NSArray*) oldDescriptors
>
> In this method, you can retrieve the *current* sortDescriptors from
> the tableview, and sort a mutable array using:
>
> - (void)  sortUsingDescriptors:(NSArray*) sortDescriptors
> [Jon C. Munson II] Thank you for this, I'm looking into it now.
>
> Note that the sort descriptors passed in the first method are the old
> ones, not the current ones, so you have to go back to the table to get
> the new ones. Having sorted the array, you need to reload the table to
> display the outcome. That's all - there's nothing else you need to do
> to support sorting from table columns except setting up the sort key
> and selector in IB.
>
> [Jon C. Munson II] OK.  Thank you for that.  I decided to stick with  
> the
> delegate method of didClickTableColumn as it functionally provides  
> the same
> thing (at this time) without having to create yet another class,
> instantation, etc.  I will keep that in mind for future use though,  
> so I
> appreciate the pointer to it.
>
>> 2.  In attempting to answer #1, I ran into an issue with using the
>> -ascending message.  The doc states its returns a bool, however, I
>> could not
>> use the message.  Any ideas there?
>
> I don't see any reason to actually try and access the sort descriptor
> itself - just use it as a black box. Note that sort descriptors come
> in an array, so there could be several, one for each sortable column.
> I can't see immediately in the docs what order they come in, so you
> can't necessarily tell which sort descriptor represents a particular
> column (though my *guess* is that the first one is the selected column
> header).
>
>
> [Jon C. Munson II] I found in subsequent testing that  
> didClickTableColumn
> appears to get called after the table sets its sort descriptors,  
> etc.  So,
> as you pointed out, I didn't need to do anything really with the sort
> descriptor other 

Re: Enum advice please

2009-01-06 Thread Quincey Morris

On Jan 6, 2009, at 11:19, Greg Parker wrote:


On Jan 6, 2009, at 1:53 AM, Graham Cox wrote:
I never add in those _blahblah things after enum, I've never  
understood what they're for. I always typedef enums like this and  
they always work just fine. (Maybe someone could explain what this  
other form is all about and whether it matters?)


Start with this pair of declarations. This creates two types,  
`DCDBTypes` and `enum _DCDBTypes`: ...


I'm sure someone will jump in and correct me if I'm wrong about this,  
but (in answer to the implied "why?" in Graham's post) my recollection  
is that:


-- 'typedef' was added to C later in its life, so originally 'enum  
XXX' was the only way to refer to an enum type you'd already defined.  
["Later" in this context would be somewhere in the mid-1970s.] Or  
perhaps it was just that some C compilers didn't implement 'typedef'  
in olden days.


-- The use of typedefs for enums and structs became popular in C after  
C++ became popular, because of the convenient 'enum XXX {...}'/'struct  
XXX {...}' declaration form in C++ that was more like a typedef than  
the apparently identically C syntax.


But maybe I misremember.


___

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

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

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

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


Re: QTMovieLayer and QCCompositionLayer Don't Start

2009-01-06 Thread Gordon Apple
Documentation for QTMovieLayer:

"layerWithMovie:
Creates an autoreleased QTMovieLayer associated with the specified QTMovie
object.

+ (id)layerWithMovie:(QTMovie *)movie

Discussion
By default, the movie starts playing immediately at rate 1.0 from the
beginning of the movie. These default characteristics can be modified by
setting layer properties or movie properties."

Note:  This is no BFD. As you said, I just call [movie play] and it plays.

Documentation for QCCompositionLayer:

"The QCCompositionLayer class loads, plays, and controls Quartz Composer
compositions in a Core Animation layer hierarchy. The composition tracks the
Core Animation layer time and is rendered directly at the current dimensions
of the QCCompositionLayer object.

An archived QCCompositionLayer object saves the composition that¹s loaded at
the time the layer is archived. It detects layer usage and pauses or resumes
the composition appropriately. A QCCompositionLayer object starts rendering
the composition automatically when the layer is placed in a visible layer
hierarchy. The layer stops rendering when it is hidden or removed from the
visible layer hierarchy."

Note:  There is no equivalent to "play" for a composition (at least that I
am aware of).  I get the initial frame and no play.  My composition layer is
four levels deep:  viewLayer:contentLayer:attentionLayer:compositionLayer.
Other stuff, including movieLayers, work fine at that level.  I'm using
standard compositions (plus one of my own derived from the tutorial) which
all play just fine independently and in Quartz Composer.

Is there something about " composition tracks the Core Animation layer time"
that I am missing, on need to include?  I notice that all of the sample code
includes animating some parameter.  I just want the composition to play.  Do
I need to be feeding it an animation "clock" signal to make it play?


On 1/6/09 9:37 AM, "Matt Long"  wrote:

> A QTMovieLayer "starts" when you call [QTMovie play] on the movie you
> initialized the layer with. What "specs" make the claim that a
> QTMovieLayer starts automatically? A QCCompositionLayer does start
> automatically. If your composition is not playing, check it in Quartz
> Composer first and make sure it plays there.
> 
> I can help more if you provide some code. I wrote a blog post on how
> to use QCCompositionLayer. You can see it here:
> 
> http://www.cimgf.com/2008/09/24/core-animation-tutorial-core-animation-and-qua
> rtz-composer-qccompositionlayer/
> 
> -Matt
> 
> 
> On Jan 2, 2009, at 11:34 AM, Gordon Apple wrote:
> 
>>The specs claim that both QTMovieLayer and QCCompositionLayer start
>> automatically.  They don't.  I have to explicitly start Movies and I
>> haven't
>> figured out yet how to start a QCCompositionLayer.  I get the
>> initial image
>> in a QCCompositionLayer, but no play.  How do you start it?
>> 
>>A related question (also posted in the QC Forum) is how can you
>> tell
>> when a composition finishes (if it does)?
>> 
>> 
>> ___
>> 

G. Apple



___

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

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

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

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


Re: Table sort image question

2009-01-06 Thread Andy Lee


On Jan 6, 2009, at 2:18 PM, Jon C. Munson II wrote:


OK, I looked into the method:

- (void)  tableView:(NSTableView*) aTableView  
sortDescriptorsDidChange:

(NSArray*) oldDescriptors

And decided to give it a shot after much play with the prior  
method.  In
that prior method I found that the sortDescriptors and Prototype  
were not

getting changed as expected, thus my use of those items wasn't valid.
Certain values in the descriptors weren't changing as expected.

So, I created a subclass of NSTableView to implement the method above.

I found that sortDescriptorsDidChange is not getting called.


You are supposed to implement the above method in the table view's  
*data source*.





The full name of the method is tableView:sortDescriptorsDidChange:.   
It takes two arguments, the first being the table view whose sort  
descriptors changed.


--Andy





I am not able to find any further reference to implementation of  
that method

to make sure I implemented it correctly.

My subclass isn't complicated, essentially containing a pointer to  
the view
which needs to stay in sync with the table (so I can call a method  
to update

the sortDescriptors for the underlying data), and the method above.

Did I miss something?  Based on what I see, I think the  
sortDescriptors

aren't even being used when the column sort happens...or is that wrong
thinking?

Thanks in advance!

Peace, Love, and Light,

/s/ Jon C. Munson II

-Original Message-
From: Jon C. Munson II [mailto:jmun...@his.com]
Sent: Tuesday, January 06, 2009 10:09 AM
To: 'Graham Cox'
Cc: 'cocoa dev'
Subject: RE: Table sort image question


On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote:


1.  When is didClickTableColumn actually called?  Is it after the
table does
its stuff, including setting the sort descriptors, or just prior to
that?



This is not the method you want. You want the NSTableDataSource  
method:


- (void)  tableView:(NSTableView*) aTableView  
sortDescriptorsDidChange:

(NSArray*) oldDescriptors

In this method, you can retrieve the *current* sortDescriptors from
the tableview, and sort a mutable array using:

- (void)  sortUsingDescriptors:(NSArray*) sortDescriptors
[Jon C. Munson II] Thank you for this, I'm looking into it now.

Note that the sort descriptors passed in the first method are the old
ones, not the current ones, so you have to go back to the table to get
the new ones. Having sorted the array, you need to reload the table to
display the outcome. That's all - there's nothing else you need to do
to support sorting from table columns except setting up the sort key
and selector in IB.

[Jon C. Munson II] OK.  Thank you for that.  I decided to stick with  
the
delegate method of didClickTableColumn as it functionally provides  
the same

thing (at this time) without having to create yet another class,
instantation, etc.  I will keep that in mind for future use though,  
so I

appreciate the pointer to it.


2.  In attempting to answer #1, I ran into an issue with using the
-ascending message.  The doc states its returns a bool, however, I
could not
use the message.  Any ideas there?


I don't see any reason to actually try and access the sort descriptor
itself - just use it as a black box. Note that sort descriptors come
in an array, so there could be several, one for each sortable column.
I can't see immediately in the docs what order they come in, so you
can't necessarily tell which sort descriptor represents a particular
column (though my *guess* is that the first one is the selected column
header).


[Jon C. Munson II] I found in subsequent testing that  
didClickTableColumn
appears to get called after the table sets its sort descriptors,  
etc.  So,

as you pointed out, I didn't need to do anything really with the sort
descriptor other than "pass it along."  Now, I've got to unhook the  
sortKeys
in my hack of covertflow and use the sort descriptor as passed.   
Adapt and

overcome

Thank you for your help so far.

___

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

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

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

This email sent to ag...@mac.com


___

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

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

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

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


Re: Synchronizing QTMovieLayers

2009-01-06 Thread Seth Willits


Thank you very much, Matt. I'll look at this today. The movies aren't  
too large and are only being played on a top end Mac Pro, so the  
performance so far is fine. Though I did think about the potential of  
having to do something myself in GL. Your post will help, if I do.



Thanks again,

(I'm glad the mailing lists are working again!)

--
Seth Willits




On Jan 6, 2009, at 7:56 AM, Matt Long wrote:


Seth,

Synchronization is done at a lower level. You need to get the movie  
time base of the movie you want to be the master and then set the  
master time base for the movie you want to be the slave. Since this  
is done at the Movie primitive level it doesn't matter that you are  
using QTMovieLayers. This is the basic code you need:


QTMovie *master... // initialized somewhere
QTMovie *slave... // Initialized somewhere

TimeBase mtb = GetMovieTimeBase([master quickTimeMovie]);
SetTimeBaseMasterTimeBase(mtb, GetMovieTimeBase([slave  
quickTimeMovie]), nil);


Then call play on both movies:

[master play];
[slave play];

The docs for both of those time base calls are here: 
http://developer.apple.com/documentation/QuickTime/Reference/QTRef_MovieManager/Reference/reference.html

As a side note, you are going to have some performance issues  
playing back two movies. You will likely need to go to using OpenGL  
to squeeze out every bit of performance. I wrote a blog post on how  
to composite a movie in a CAOpenGLLayer here: http://www.cimgf.com/2008/09/10/core-animation-tutorial-rendering-quicktime-movies-in-a-caopengllayer/ 
 . You can use this technique to composite multiple video channels  
at once.


HTH,

-Matt


On Jan 2, 2009, at 3:13 PM, Seth Willits wrote:


Howdy guys,


I have a need to make sure multiple QTMovieLayers are in perfect  
sync. In other words, I need them to start at exactly the same  
time. If you just do a few [movieN play] in a row, they're slightly  
off from each other.


Has anyone done this? Any suggestions? (I'd really rather not have  
to pull frames out of the movie and manually draw them myself or  
something like that.)


--
Seth Willits








___

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

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

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

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


RE: Table sort image question

2009-01-06 Thread Jon C. Munson II
OK, I looked into the method:

- (void)  tableView:(NSTableView*) aTableView sortDescriptorsDidChange: 
(NSArray*) oldDescriptors
 
And decided to give it a shot after much play with the prior method.  In
that prior method I found that the sortDescriptors and Prototype were not
getting changed as expected, thus my use of those items wasn't valid.
Certain values in the descriptors weren't changing as expected. 

So, I created a subclass of NSTableView to implement the method above.

I found that sortDescriptorsDidChange is not getting called.

I am not able to find any further reference to implementation of that method
to make sure I implemented it correctly.

My subclass isn't complicated, essentially containing a pointer to the view
which needs to stay in sync with the table (so I can call a method to update
the sortDescriptors for the underlying data), and the method above.

Did I miss something?  Based on what I see, I think the sortDescriptors
aren't even being used when the column sort happens...or is that wrong
thinking?

Thanks in advance!

Peace, Love, and Light,

/s/ Jon C. Munson II

-Original Message-
From: Jon C. Munson II [mailto:jmun...@his.com] 
Sent: Tuesday, January 06, 2009 10:09 AM
To: 'Graham Cox'
Cc: 'cocoa dev'
Subject: RE: Table sort image question


On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote:

> 1.  When is didClickTableColumn actually called?  Is it after the  
> table does
> its stuff, including setting the sort descriptors, or just prior to  
> that?


This is not the method you want. You want the NSTableDataSource method:

- (void)  tableView:(NSTableView*) aTableView sortDescriptorsDidChange: 
(NSArray*) oldDescriptors

In this method, you can retrieve the *current* sortDescriptors from  
the tableview, and sort a mutable array using:

- (void)  sortUsingDescriptors:(NSArray*) sortDescriptors
[Jon C. Munson II] Thank you for this, I'm looking into it now.

Note that the sort descriptors passed in the first method are the old  
ones, not the current ones, so you have to go back to the table to get  
the new ones. Having sorted the array, you need to reload the table to  
display the outcome. That's all - there's nothing else you need to do  
to support sorting from table columns except setting up the sort key  
and selector in IB.

[Jon C. Munson II] OK.  Thank you for that.  I decided to stick with the
delegate method of didClickTableColumn as it functionally provides the same
thing (at this time) without having to create yet another class,
instantation, etc.  I will keep that in mind for future use though, so I
appreciate the pointer to it.

> 2.  In attempting to answer #1, I ran into an issue with using the
> -ascending message.  The doc states its returns a bool, however, I  
> could not
> use the message.  Any ideas there?

I don't see any reason to actually try and access the sort descriptor  
itself - just use it as a black box. Note that sort descriptors come  
in an array, so there could be several, one for each sortable column.  
I can't see immediately in the docs what order they come in, so you  
can't necessarily tell which sort descriptor represents a particular  
column (though my *guess* is that the first one is the selected column  
header).


[Jon C. Munson II] I found in subsequent testing that didClickTableColumn
appears to get called after the table sets its sort descriptors, etc.  So,
as you pointed out, I didn't need to do anything really with the sort
descriptor other than "pass it along."  Now, I've got to unhook the sortKeys
in my hack of covertflow and use the sort descriptor as passed.  Adapt and
overcome

Thank you for your help so far.

___

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

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

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

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


Re: Enum advice please

2009-01-06 Thread Greg Parker

On Jan 6, 2009, at 1:53 AM, Graham Cox wrote:

On 5 Jan 2009, at 6:14 pm, Damien Cooke wrote:


typedef enum _DCDBTypes
{
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2

}DCDBTypes;


That said, also try this:

typedef enum
{
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2
}
DCDBTypes;

I never add in those _blahblah things after enum, I've never  
understood what they're for. I always typedef enums like this and  
they always work just fine. (Maybe someone could explain what this  
other form is all about and whether it matters?)


Start with this pair of declarations. This creates two types,  
`DCDBTypes` and `enum _DCDBTypes`:


enum _DCDBTypes {   
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2
};
typedef enum _DCDBTypes DCDBTypes;

C allows a contraction of the above. This creates the same two types:

typedef enum _DCDBTypes {
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2
} DCDBTypes;

You can omit the separate enum type:

typedef enum {
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2
} DCDBTypes;

...or even give the two types the "same" name if you want (but not  
really; one is `enum DCDBTypes` and the other is just `DCDBTypes`):


typedef enum DCDBTypes {
DCOItemType = 0,
DCOCategoryType = 1,
DCORegionType = 2
} DCDBTypes;

All of this works the same way with struct types.


--
Greg Parker gpar...@apple.com Runtime Wrangler


___

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

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

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

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


Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:

2009-01-06 Thread Quincey Morris

On Jan 6, 2009, at 10:44, WT wrote:

It just occurred to me, though, that the KVO mechanism *could* do  
something special for dependent keys, namely, pass the original  
change dictionary on to the observer of the dependent key. After  
all, it does know that it's dealing with a dependent key. As it is,  
once I get the notification for the dependent key, all information  
about the original change is lost.


It's an interesting concept, but creating additional values would  
increase the observation overhead. It's also not obvious that  
coordinating (and coalescing?) independent key changes would give  
consistent/useful results in the change dictionary.


The beauty of KVO is its, um, elegant minimalism.

___

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

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

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

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


Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:

2009-01-06 Thread WT
It just occurred to me, though, that the KVO mechanism *could* do  
something special for dependent keys, namely, pass the original change  
dictionary on to the observer of the dependent key. After all, it does  
know that it's dealing with a dependent key. As it is, once I get the  
notification for the dependent key, all information about the original  
change is lost.


Wagner
___

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

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

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

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


Re: Overriding NSTextField keyDown?

2009-01-06 Thread Douglas Davidson


On Jan 2, 2009, at 3:45 PM, Mr. Gecko wrote:

Hello, I've been trying to override the NSTextField keyDown method,  
but it didn't seem to work. I've searched in the archives, but got  
nowhere, all I could find is to override the text field editor. But  
how could I do that?
This is all very confusing. All I really need to do is when the user  
push return (36) or enter (76) it will run a method goTo. and  
eventually I'll want to do the up and down arrows.


You really don't want to do that.  What you need to do is to work with  
the frameworks rather than against them, and everything will go  
smoothly.  NSTextFields and other controls handle all of the standard  
keystrokes themselves, but of course they allow you to override their  
behavior at many points.  The first thing to do would be to try some  
of the tutorials that handle text fields, in particular using IB to  
set up the target-action mechanism.


If that doesn't quite suit your needs, but what you're interested in  
is learning when a particular field has ended editing, there's a  
standard notification you can listen for.  If you want to customize a  
text field and give special handling to certain special keys, there's  
a delegate method -control:textView:doCommandBySelector:.


What you definitely don't want to do is override keyDown:.  In the  
first place, it isn't the text field that gets the keyDown:, but the  
field editor; but even if you had a custom field editor, you wouldn't  
want to override keyDown:, because doing so will break most input  
methods.  Dealing with raw key strokes is too crude for the needs of  
modern text input--that's why we have all of these other override  
points.  Check the archives for my earlier messages on this topic.


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


Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:

2009-01-06 Thread WT

Hi Quincey,

thank you for your reply.

In this scenario, typically the dependent property doesn't have a  
useful value -- all you care about is the notification.


Yes, that's my intention.

If you *are* trying to maintain a genuine value for the  
"displayNeeded" property, then we need to see the code that  
maintains it.


I'm not.

I'll go out on a limb and suggest that trying to maintain a genuine  
value for "displayNeeded" is both horribly difficult and a terrible  
mistake. :)


I think I understand now what's going on. I was under the (clearly  
mistaken) impression that the change dictionary refers to the original  
property that changed, and not to the dependent property. But, come to  
think of it, that's so obvious that it should refer to the dependent  
property, in which case it makes perfect sense that its value is zero  
(it's a boolean that never got set to anything, and so gets auto  
initialized to NO) and didn't change, because no setter has been  
called to change it.


It's funny... I stared at that code for 2 days with not a clue about  
what the problem is and it's now so obvious that the KVO mechanism  
wouldn't know nor care that it's dealing with a dependent property  
and, hence, wouldn't do anything special.


Thank you again Quincey.

Wagner
___

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

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

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

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


Re: Localize Attributed Strings?

2009-01-06 Thread Douglas Davidson


On Jan 6, 2009, at 9:22 AM, Alastair Houghton wrote:


On 4 Jan 2009, at 00:02, Chunk 1978 wrote:


is this possible?  i have a string that changes color and size
according to the length of the words in the string.  however, these
words and their lengths change in different languages.  clearly i
could add and NSLocalization wrapper to the string, but the problem  
is

that the attributes would remain the same.


One way is to store your string's contents in an RTF file that you  
include as a resource in your application, then load its contents  
using -[NSAttributedString initWithPath:documentAttributes:] (or  
similar).  You can use -[NSBundle pathForResource:ofType:] to find  
the path for the correct localized variant.


There are many variations on the above, but hopefully that should  
get you on the right track.


Here are some possible variations:  (1) you can store multiple pieces  
of attributed text in an RTF file, using some convention of your own  
to separate them; (2) you can use NSKeyedArchiver to write out a  
dictionary of attributed strings to a file; (3) if you really want to  
use the localized string mechanism, you can put some basic HTML markup  
in your localized strings and used NSAttributedString's HTML  
conversion to get attributed strings; etc., etc.


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


Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:

2009-01-06 Thread Quincey Morris

On Jan 6, 2009, at 06:55, WT wrote:

The reason for the comparison between the old and new values should  
be obvious, namely, I don't want to redraw the screen unless the  
value of the original key has in fact changed.


Now, here's the problem: when I run my app, both the old and new  
values are logged as simply 0 (zero). That's clearly incorrect  
because (a) not all of my properties are numbers (some are colors,  
for example) and (b) I know I've made a change and yet the old and  
new values come out equal.


In this scenario, typically the dependent property doesn't have a  
useful value -- all you care about is the notification.


If you *are* trying to maintain a genuine value for the  
"displayNeeded" property, then we need to see the code that maintains  
it.


I'll go out on a limb and suggest that trying to maintain a genuine  
value for "displayNeeded" is both horribly difficult and a terrible  
mistake. :)



___

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

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

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

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


NSAppleScript returns wrong result on multiple Safari windows, applescript editor work

2009-01-06 Thread Jot Kali

Hello,

I appreciate the response but neither of the two suggested solutions  
work. The one that keeps Safari in the background has the same issue,  
it returns the first Safari last tab, not the most recent Safari  
window. The second suggestion, where the applescript puts Safari as  
the frontmost app, isn't a valid solution. Having my application lose  
focus misses the point.


I'm currently working through the Apple sample code AttachAScript to  
see if it will work.


thanks.
___

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

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

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

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


Re: Localize Attributed Strings?

2009-01-06 Thread Alastair Houghton

On 4 Jan 2009, at 00:02, Chunk 1978 wrote:


is this possible?  i have a string that changes color and size
according to the length of the words in the string.  however, these
words and their lengths change in different languages.  clearly i
could add and NSLocalization wrapper to the string, but the problem is
that the attributes would remain the same.


One way is to store your string's contents in an RTF file that you  
include as a resource in your application, then load its contents  
using -[NSAttributedString initWithPath:documentAttributes:] (or  
similar).  You can use -[NSBundle pathForResource:ofType:] to find the  
path for the correct localized variant.


There are many variations on the above, but hopefully that should get  
you on the right track.


Kind regards,

Alastair.

--
http://alastairs-place.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 arch...@mail-archive.com


Re: Immediate Nib Loading Error

2009-01-06 Thread Nick Zitzmann


On Jan 6, 2009, at 3:55 AM, Kyle Sluder wrote:


If
you're on i386, self is at EBP[8] anyway (I'm unfamiliar with the
x86_64 calling convention).


It's pretty complicated, and documented here in case anyone is  
wondering: 


In this case, the X86-64 equivalent of $ebp+8 would be $rdi.


Did you try just `po ($ebp+8)`?



In 32-bit Intel programs, I always use "po *(int *)($ebp+8)" to print  
the value of the first argument when it is a pointer to an ObjC  
object, and it works for me.


Nick Zitzmann




___

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

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

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

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


Re: NSBorderlessWindowMask and Leopard's Spaces

2009-01-06 Thread Eric Schlegel


On Jan 4, 2009, at 5:18 AM, Benjamin Dobson wrote:

In my application, I am using a custom window based on  
NSBorderlessWindowMask. You can drag the titlebar to move it around.  
How do I make this play nice with Spaces?


Dragging to the edge of the screen should switch space after a short  
delay, and holding the titlebar while switching space should bring  
the window with it.


I really don't know where to start on this. The release notes don't  
seem to cover this.


Unfortunately there's no current API to allow your window dragging to  
interact with Spaces.


-eric

___

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

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

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

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


Re: Determining width of a cell in an NSOutlineView

2009-01-06 Thread Eric Gorr


On Jan 6, 2009, at 11:44 AM, Corbin Dunn wrote:



The latest problem I am having with this is that an NSOutlineView
will not fully draw itself properly if the height of a row changes
at the window it is on is being resized.


Override -drawRect: in a subclass of NSOutlineView and just call
[super drawRect:] -- live resize caching is conflicting with what you
want. Ideally, overriding -preservesContentDuringLiveResize should
work, but unfortunately it does not work in Tiger/Leopard.


Great. thank you.

I have filed a bug report for this one as well:

rdar://6475424

___

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

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

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

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


Problem with AFP server Notification seek advice.

2009-01-06 Thread Sandro Noel

Greetings!

I created a little application called Bonjour Mounter.
and i'm having a little problem.

when a server is mounted, and it notifies that it is going offline, I  
get a bonjour notification that the service disappeared,
but so does Finder or OS X, and it dismounts the drives before BM has  
time to dismount them.
and the annoying point is that it notifies the user that the server  
just left.


I noticed that finder will not notify if there is nothing mounted from  
that server.
so I'm trying to dismount before finder does it so the mount and  
dismount is transparent.


some of my users use Bonjour Mounter with media centers, and do not  
have a keyboard or mouse to click on the dialogue.


Is there a way I can tell finder to let me unmount the drives before  
it reacts ?

or just tell him not to notify?

thank you all!!

Sandro Noel.
___

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

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

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

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


Re: Using the security framework

2009-01-06 Thread Nick Zitzmann


On Jan 3, 2009, at 6:50 PM, Joe Turner wrote:

I am making a hard drive cloner/backuper, and to do some deleting  
and copying, I need to use the security framework. What I need to be  
able to do is have the user type in their password one time, and  
then it would give me system.privilege.admin rights until a time  
that they want to unauthorized it (could be days, weeks, months,  
years). I have looked through the security framework, but have not  
really found how to have one system.privilege.admin authorization,  
and have it last a long time. So, if anyone could point me in the  
right direction with this, like what methods to use, and what  
parameters to use.


If you pre-authorize an admin authorization, then it will last for 300  
seconds and then must be renewed. This is not something you can  
programmatically change; it's set in the computer's /etc/authorization  
file.


I'm also wondering another thing. To delete the files, I need admin  
privileges, but, do I need to create a new target (e.g. a shell  
script) to do the copying and then run the command (blanking on the  
name) that runs the script at a given path with admin privileges.  
Or, could I somehow use NSFileManager in an authorized state.



You have to have something else do the work, since the security model  
of Mac OS X (and all Unix-like OSes) do not allow the escalation of  
privileges in an existing task.


Nick Zitzmann




___

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

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

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

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


Re: Determining width of a cell in an NSOutlineView

2009-01-06 Thread Corbin Dunn


The latest problem I am having with this is that an NSOutlineView  
will not fully draw itself properly if the height of a row changes  
at the window it is on is being resized.


Override -drawRect: in a subclass of NSOutlineView and just call  
[super drawRect:] -- live resize caching is conflicting with what you  
want. Ideally, overriding -preservesContentDuringLiveResize should  
work, but unfortunately it does not work in Tiger/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 arch...@mail-archive.com


RE: Binary search on sorted NSArray in Cocoa?

2009-01-06 Thread Karan, Cem (Civ, ARL/CISD)
Adam R. Maxwell wrote on Tuesday, January 06, 2009 9:59 AM:

> On Jan 6, 2009, at 8:16 AM, Karan, Cem (Civ, ARL/CISD) wrote:
> 
> >  My question is, does NSArray already have a binary search method 
> > defined on it in a category somewhere?  If it does, I'd rather use 
> > that.
> 
> It's not a category, but take a look at CFArrayBSearchValues, 
> which works just fine thanks to toll-free bridging.

That looks just like what I need!  I know I'm being pedantic, but just
to make sure, will the following code work?

// mySortedArray is an NSArray of NSString instances that has
been sorted
// via caseInsensitiveCompare:.  The strings within the array
are unique;
// you'll never see the same string twice in the array.
myString is an 
// NSString instance that may or MAY NOT be within the array.

CFRange arrayRange;
arrayRange.location = 0;
arrayRange.length = [mySortedArray count];

CFIndex stringIndex;
stringIndex = CFArrayBSearchValues( mySortedArray, 
arrayRange, 
myString, 
CFStringCompare,

kCFCompareForcedOrdering);

if ((stringIndex < 0) || (stringIndex >= [mySortedArray count]))
{
// Didn't find myString, do something intelligent
}
else if ([myString isEqualToString:[mySortedArray
objectAtIndex:stringIndex]] == NO)
{
// Still didn't find myString, do something intelligent
}
else
{
// Found myString's actual index, do the work I need to
do and move on.
}

Thanks,
Cem Karan
___

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

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

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

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


Re: Synchronizing QTMovieLayers

2009-01-06 Thread Matt Long

Seth,

Synchronization is done at a lower level. You need to get the movie  
time base of the movie you want to be the master and then set the  
master time base for the movie you want to be the slave. Since this is  
done at the Movie primitive level it doesn't matter that you are using  
QTMovieLayers. This is the basic code you need:


QTMovie *master... // initialized somewhere
QTMovie *slave... // Initialized somewhere

TimeBase mtb = GetMovieTimeBase([master quickTimeMovie]);
SetTimeBaseMasterTimeBase(mtb, GetMovieTimeBase([slave  
quickTimeMovie]), nil);


Then call play on both movies:

[master play];
[slave play];

The docs for both of those time base calls are here: 
http://developer.apple.com/documentation/QuickTime/Reference/QTRef_MovieManager/Reference/reference.html

As a side note, you are going to have some performance issues playing  
back two movies. You will likely need to go to using OpenGL to squeeze  
out every bit of performance. I wrote a blog post on how to composite  
a movie in a CAOpenGLLayer here: http://www.cimgf.com/2008/09/10/core-animation-tutorial-rendering-quicktime-movies-in-a-caopengllayer/ 
 . You can use this technique to composite multiple video channels at  
once.


HTH,

-Matt


On Jan 2, 2009, at 3:13 PM, Seth Willits wrote:


Howdy guys,


I have a need to make sure multiple QTMovieLayers are in perfect  
sync. In other words, I need them to start at exactly the same time.  
If you just do a few [movieN play] in a row, they're slightly off  
from each other.


Has anyone done this? Any suggestions? (I'd really rather not have  
to pull frames out of the movie and manually draw them myself or  
something like that.)


--
Seth Willits




___

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

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

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

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


Re: QTMovieLayer and QCCompositionLayer Don't Start

2009-01-06 Thread Matt Long
A QTMovieLayer "starts" when you call [QTMovie play] on the movie you  
initialized the layer with. What "specs" make the claim that a  
QTMovieLayer starts automatically? A QCCompositionLayer does start  
automatically. If your composition is not playing, check it in Quartz  
Composer first and make sure it plays there.


I can help more if you provide some code. I wrote a blog post on how  
to use QCCompositionLayer. You can see it here:


http://www.cimgf.com/2008/09/24/core-animation-tutorial-core-animation-and-quartz-composer-qccompositionlayer/

-Matt


On Jan 2, 2009, at 11:34 AM, Gordon Apple wrote:


   The specs claim that both QTMovieLayer and QCCompositionLayer start
automatically.  They don't.  I have to explicitly start Movies and I  
haven't
figured out yet how to start a QCCompositionLayer.  I get the  
initial image

in a QCCompositionLayer, but no play.  How do you start it?

   A related question (also posted in the QC Forum) is how can you  
tell

when a composition finishes (if it 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 arch...@mail-archive.com


Visualization strategy/choosing a framework

2009-01-06 Thread Adam Foltzer
To the list this time :D

-- Forwarded message --
From: Adam Foltzer 
Date: Tue, Jan 6, 2009 at 10:00 AM
Subject: Re: Visualization strategy/choosing a framework
To: Andrew Farmer 


I found the Accelerate framework after posting this, and have had some good
success with it on my Intel Mac. For the iPhone, I found this bit of code
for accessing the VFP unit, since Accelerate is not available there:
http://code.google.com/p/vfpmathlibrary/ . I may wind up porting more
functions from Accelerate to ARM -F assembly, since nearly everything the
algorithm does is SIMD. The instruction set for the VFP seems capable enough
to reimplement many of the veclib.h functions, which makes me wonder why
Apple hasn't done it (at least not publicly ;)

Yes, I'm also getting sidetracked, but this project is all about practice,
and this seems like an informative rabbit hole :)

Cheers,
Adam


On Tue, Jan 6, 2009 at 1:53 AM, Andrew Farmer  wrote:

> On 01 Jan 09, at 10:56, Adam Foltzer wrote:
>
>> Off to do some refactoring of my Swarm class; at the risk of spawning a
>> tangent, am I just completely missing a Cocoa data structure that's suited
>> to matrices of scalar values? I had a working implementation using nested
>> NSMutableArrays, but the code wound up looking disgusting (my fault, not
>> the
>> API's ;-), so I rewrote it with good ol' C arrays, malloc, and free. It
>> has
>> no leaks now, and is really, really fast, but I feel like I shouldn't have
>> to reinvent the wheel in order to do matrix operations.
>>
>
> The Cocoa collection classes are primarily oriented towards dealing with
> ObjC objects. If all you're working with is homogeneous arrays of scalar
> values (or structures consisting of scalar values), you probably are best
> off using C arrays.
>
> That's not to say that Apple has nothing to offer. If you're performing
> SIMD-esque operations on large matrices or vectors, the Accelerate framework
> might have some tools you'd be interested in. It's listed under Carbon for
> some reason, but it's just as applicable to Cocoa applications.
>
> If that doesn't do it, but you're fine with targeting Intel machines only,
> dropping down to the SSE primitives may also be an option to consider.
>
___

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

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

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

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


Re: Determining width of a cell in an NSOutlineView

2009-01-06 Thread Eric Gorr


On Jan 5, 2009, at 12:59 PM, Eric Gorr wrote:



On Jan 5, 2009, at 12:37 PM, Corbin Dunn wrote:



On Jan 5, 2009, at 8:56 AM, Eric Gorr wrote:



On Dec 19, 2008, at 6:03 PM, Corbin Dunn wrote:



On Dec 19, 2008, at 2:30 PM, Eric Gorr wrote:




I just need to know the width so I base the height on the width.



For that, you want to use -cellSizeForBounds: -- pass in a large  
height, but a constrained width. Use a width that is equal to the  
[tableColumn width] minus indentation * (level + 1)   
although, the actual value that outlineview uses for indentation  
is dependent on some internal logic (ie: if you are using "group  
rows", or the "source list highlighting style"). But, this should  
give you a value that is fairly close to what you want.


I guess I spoke to soon. This doesn't actually seem to work.

I have the following code in my -outlineView:heightOfRowByItem:  
method:


NSTableColumn   *column = [outlineView outlineTableColumn];
NSUInteger  nItems  = [item count];
CGFloat indentation = [outlineView indentationPerLevel];
NSInteger   level   = [outlineView levelForItem:item];
NSRect  bounds  = NSMakeRect(0, 0, [column width],  
1);

NSCell  *tableCell  = [column dataCell];
CGFloat totalOffset = ( indentation * ( level + 1 ) );
NSSize  cellSize= [tableCell  
cellSizeForBounds:bounds];
NSUInteger  nItemsPerRow= ( cellSize.width -  
totalOffset ) / 80;




Thanks for logging the bug (re: other response).

Your code has some problems; it is asking for the cellSize before  
accounting for the indentation. You probably want:

...
CGFloat totalOffset = ( indentation * ( level + 1 ) );
bounds.size.width -= totalOffset; // corbin
NSSize  cellSize= [tableCell  
cellSizeForBounds:bounds];


At this point, cellSize.height should give you a good height to  
return from the -heightForRow: method.


Now here:

NSUInteger  nItemsPerRow= ( cellSize.width -  
totalOffset ) / 80;



I'm confused what this is trying to do; maybe your ultimate goal is  
different than what I think it is. I figure you are trying to find  
the appropriate row height for a given cell so it won't get clipped  
(something like what Console on Leopard does).


Ah, I think there has been a miscommunication.

I ultimately need to be able to compute the height of the cell based  
on the width. Based on your reply, it looks like I can determine the  
width of the cell merely by doing:


NSTableColumn   *column= [outlineView outlineTableColumn];
CGFloat totalCellWidth = [column width] - ( indentation *  
( level + 1 ) );


The height of the cell should be based on that value so nItems with  
nItemsPerRow can fit entirely inside of the cell. Each item I am  
drawing will be 80x80 pixels.


It would seem that what I need to do does not require the use of - 
cellSizeForBounds:.



The latest problem I am having with this is that an NSOutlineView will  
not fully draw itself properly if the height of a row changes at the  
window it is on is being resized.


I've got a couple of pictures of this which can be viewed at:

http://ericgorr.net/cocoadev/8h6pcc/largetosmall.tiff
http://ericgorr.net/cocoadev/8h6pcc/smalltolarge.tiff

The only redraw problem that makes a little sense to me is when making  
the window bigger, the only part that is drawn problem is the part  
that was added at the control got bigger.


Of course, once I let go of the mouse button and stop resizing the  
window, it draws itself correctly.


What I have tried doing is responding to -windowDidResize: and running  
the code:


[resourcesThumbnails reloadData];
[resourcesThumbnails setNeedsDisplay:YES];
[resourcesThumbnails display];
[[notification object] flushWindow];

resourcesThumbnails is the NSOutlineView, but this will not cause the  
entire control to be drawn properly.


Is there anything else I can try?
___

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

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

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

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


RE: Table sort image question

2009-01-06 Thread Jon C. Munson II

On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote:

> 1.  When is didClickTableColumn actually called?  Is it after the  
> table does
> its stuff, including setting the sort descriptors, or just prior to  
> that?


This is not the method you want. You want the NSTableDataSource method:

- (void)  tableView:(NSTableView*) aTableView sortDescriptorsDidChange: 
(NSArray*) oldDescriptors

In this method, you can retrieve the *current* sortDescriptors from  
the tableview, and sort a mutable array using:

- (void)  sortUsingDescriptors:(NSArray*) sortDescriptors
[Jon C. Munson II] Thank you for this, I'm looking into it now.

Note that the sort descriptors passed in the first method are the old  
ones, not the current ones, so you have to go back to the table to get  
the new ones. Having sorted the array, you need to reload the table to  
display the outcome. That's all - there's nothing else you need to do  
to support sorting from table columns except setting up the sort key  
and selector in IB.

[Jon C. Munson II] OK.  Thank you for that.  I decided to stick with the
delegate method of didClickTableColumn as it functionally provides the same
thing (at this time) without having to create yet another class,
instantation, etc.  I will keep that in mind for future use though, so I
appreciate the pointer to it.

> 2.  In attempting to answer #1, I ran into an issue with using the
> -ascending message.  The doc states its returns a bool, however, I  
> could not
> use the message.  Any ideas there?

I don't see any reason to actually try and access the sort descriptor  
itself - just use it as a black box. Note that sort descriptors come  
in an array, so there could be several, one for each sortable column.  
I can't see immediately in the docs what order they come in, so you  
can't necessarily tell which sort descriptor represents a particular  
column (though my *guess* is that the first one is the selected column  
header).


[Jon C. Munson II] I found in subsequent testing that didClickTableColumn
appears to get called after the table sets its sort descriptors, etc.  So,
as you pointed out, I didn't need to do anything really with the sort
descriptor other than "pass it along."  Now, I've got to unhook the sortKeys
in my hack of covertflow and use the sort descriptor as passed.  Adapt and
overcome

Thank you for your help so far.

___

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

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

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

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


Re: Binary search on sorted NSArray in Cocoa?

2009-01-06 Thread Adam R. Maxwell


On Jan 6, 2009, at 8:16 AM, Karan, Cem (Civ, ARL/CISD) wrote:

 My question is, does NSArray already have a binary search method  
defined on it in a category somewhere?  If it does, I'd rather use  
that.


It's not a category, but take a look at CFArrayBSearchValues, which  
works just fine thanks to toll-free bridging.


--
Adam




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

Strange behavior of observeValueForKeyPath:ofObject:change:context:

2009-01-06 Thread WT

Hello,

in the app I'm writing, I have a custom view with several KVO- 
compliant properties which, when changed, should cause the view to  
redraw itself. I've then set up a dependent key (displayNeeded) and  
have my custom view KV-observe changes to that key. When a change  
happens, I call setNeedsDisplay. The relevant code appears below:


This is in the -initWithFrame: method of my custom view:

[self addObserver: self
   forKeyPath: @"displayNeeded"
  options: (NSKeyValueObservingOptionNew |
NSKeyValueObservingOptionOld)
  context: NULL];

And these are the two methods that are needed to make KVO work for the  
dependent key in question:


+ (void) initialize
{
[self setKeys: [NSArray arrayWithObjects: @"foo", @"bah", @"etc",  
nil]

  triggerChangeNotificationsForDependentKey: @"displayNeeded"];
}

(Yes, I know that -setKeys:triggerChangeNotificationsForDependentKey:  
is deprecated in Leopard)


- (void) observeValueForKeyPath: (NSString *) keyPath ofObject: (id)  
object

 change: (NSDictionary *) change context: (void *) context;
{
id oldValue = [change objectForKey: NSKeyValueChangeOldKey];
id newValue = [change objectForKey: NSKeyValueChangeNewKey];

NSLog(@"old = %@", oldValue);
NSLog(@"new = %@", newValue);

if (! [newValue isEqual: oldValue])
{
if ([keyPath isEqual: @"displayNeeded"])
{
NSLog(@"displayNeeded");
[self setNeedsDisplay: YES];
}
else
if ([keyPath isEqual: @"AnotherDependentKey"])
{
// Handle another dependent key.
}
}
}

The reason for the comparison between the old and new values should be  
obvious, namely, I don't want to redraw the screen unless the value of  
the original key has in fact changed.


Now, here's the problem: when I run my app, both the old and new  
values are logged as simply 0 (zero). That's clearly incorrect because  
(a) not all of my properties are numbers (some are colors, for  
example) and (b) I know I've made a change and yet the old and new  
values come out equal.


Everything compiles fine, with no warnings of any kind, and the app  
runs fine if I remove the comparison between old and new (but the old  
and new values are still logged as zero).


Anyone has any idea of what I may be doing wrong?

Thanks in advance.
Wagner
___

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

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

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

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


NSUIHeartBeat gets stuck

2009-01-06 Thread Adam R. Maxwell
I have an application that starts and stops a spinning progress  
indicator.  Start/stop is based on observing -[NSOperationQueue  
operations]; since I get KVO notifications on the queue's thread, I've  
been careful to start/stop the spinner on the main thread.  The  
spinner is set to hide when it's not spinning.


The problem is that if I cancel all operations in the queue, the  
heartbeat thread appears to get stuck (sample follows), and the  
spinner refuses to spin thereafter.  I cannot reproduce this with a  
debug build, or when running under Xcode, but it's reliably  
reproducible when launching from the Finder and following a couple of  
simple steps.


Any suggestions on how to debug this?  There are no exceptions  
reported in the console log.


thanks,
Adam Maxwell

Call graph:
1508 Thread_2503
  1508 start
1508 NSApplicationMain
  1508 -[NSApplication run]
1508 -[NSApplication  
nextEventMatchingMask:untilDate:inMode:dequeue:]

  1508 _DPSNextEvent
1508 BlockUntilNextEventMatchingListInMode
  1508 ReceiveNextEventCommon
1508 RunCurrentEventLoopInMode
  1508 CFRunLoopRunSpecific
1508 mach_msg
  1508 mach_msg_trap
1508 mach_msg_trap
1508 Thread_2603
  1508 start_wqthread
1508 _pthread_wqthread
  1508 -[NSOperation start]
1508 -[TLMOperation main]
  1508 CFRunLoopRunSpecific
1508 mach_msg
  1508 mach_msg_trap
1508 mach_msg_trap
1508 Thread_2703
  1508 start_wqthread
1508 __workq_ops
  1508 __workq_ops
1508 Thread_2803
  1508 thread_start
1508 _pthread_start
  1508 fe_fragment_thread
1508 __semwait_signal
  1508 __semwait_signal
1508 Thread_2903
  1508 thread_start
1508 _pthread_start
  1508 __NSThread__main__
1508 kevent
  1508 kevent
1508 Thread_2a03
  1508 thread_start
1508 _pthread_start
  1508 __NSThread__main__
1508 -[NSUIHeartBeat _heartBeatThread:]
  1508 -[NSWindow _copyAcquiredViewHierarchyLock]
1508 -[NSViewHierarchyLock  
lockForReadingWithExceptionHandler:]

  1508 __semwait_signal
1508 __semwait_signal
1508 Thread_2b03
  1508 thread_start
1508 _pthread_start
  1508 glvmDoWork
1508 __semwait_signal
  1508 __semwait_signal
1508 Thread_2c03
  1508 thread_start
1508 _pthread_start
  1508 _backgroundActivity
1508 read
  1508 read
1508 Thread_2d03
  1508 thread_start
1508 _pthread_start
  1508 _backgroundActivity
1508 read
  1508 read

Total number in stack (recursive counted multiple, when >=5):
6   _pthread_start
6   thread_start

Sort by top of stack, same collapsed (when >= 5):
__semwait_signal4524
mach_msg_trap3016
read3016
__workq_ops1508
kevent1508
Sample analysis of process 1033 written to file /dev/stdout




smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

Re: Odd EXEC_BAD_ACCESS after executing URLRequest

2009-01-06 Thread Jason Foreman
Hi Marc,

On Tue, Jan 6, 2009 at 2:42 AM, marc hoffman  wrote:
>
> any other ideas?
>

I did notice one thing from your original code:


> NSURLConnection *conn = [[NSURLConnection connectionWithRequest:request 
> delegate:self] retain];
>   @try
>   {
>   [conn start];

The way you've allocated the connection, it should start
automatically.  You shouldn't need to call -start manually.  This
*might* be causing some issues.  The documentation doesn't say not to
call it on a connection that is already started, but there might be a
bug.  Try removing this call to see if it helps at all.

Otherwise, it sounds like you've maybe got a memory management issue.
Double check all your retains and releases.  You may want to try
releasing the connection in -connectionDidFinishLoading: rather than
where you're releasing it now, though I've never needed to do that
before.

Jason
___

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

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

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

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


Re: Printing PDF Documentation

2009-01-06 Thread James Montgomerie

On 6 Jan 2009, at 13:20, Development wrote:
No, I do not need to write code to work with PDF; the example  
program to do this is pretty good.


However, lots of documentation from Apple and other companies are  
not available exclusively as PDF file.  Does anyone know of a good  
reliable source for printing out hard copy of the documents?  Let's  
say I have a specific PDF reference that I am constantly looking at.  
Having the 100 page document printed and bound into a simple binding  
would be worth the cost for me.


Has anyone found a printing company online that can handle one time  
job like this?  At reasonable rate?


My local print/copy shop did a great job of printing and binding (half  
size, with a metallic comb so it sits on my desk nicely) something  
like this for me.  You could look yours up in the yellow pages and  
give them a call for pricing.


Jamie.
___

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

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

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

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


Artur Zaiat/MOL/CEECIS/UNICEF is out of the office.

2009-01-06 Thread Artur Zaiat

I will be out of the office starting  01/05/2009 and will not return until
01/19/2009.

I will respond to your message when I return or contact me.
I can be reached anytime via my cell phone +37369148707

___

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

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

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

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


Re: Problem with iPhone project

2009-01-06 Thread Dave DeLong
What that means is that you set the "FilesOwner" in your xib file to  
be a ButtonFunViewController, but you never hooked the view outlet for  
said controller (or it got unhooked).  It's an easy mistake to make  
and one I find myself making about once a week.  =P


Dave

On 4 Jan, 2009, at 9:00 AM, William Squires wrote:


Hi!
 I just got the book "Beginning iPhone Development: Exploring the  
iPhone SDK" by Dave Mark/Jeff LaMarche. In Chapter 3, I built the  
project, but it keeps crashing. The gdb debugger console log shows:


" ButtonFun[] *** Terminating app due to  
uncaught exception 'NSInternalInconsistencyException', reason: '- 
[UIViewController loadView] loaded the 'ButtonFunViewController' nib  
but no view was set.'


I rebuilt the project (under a different name), and it works. But I  
can't find any difference between the two projects; either in the  
source, or in the xib files. What should I be looking for (in the  
one that doesn't work, of course)? Did a .xib get corrupted, or did  
I disconnect something by accident?

___

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

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

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

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


Re: Table sort image question

2009-01-06 Thread Graham Cox


On 7 Jan 2009, at 12:18 am, Jon C. Munson II wrote:

1.  When is didClickTableColumn actually called?  Is it after the  
table does
its stuff, including setting the sort descriptors, or just prior to  
that?



This is not the method you want. You want the NSTableDataSource method:

- (void)  tableView:(NSTableView*) aTableView sortDescriptorsDidChange: 
(NSArray*) oldDescriptors


In this method, you can retrieve the *current* sortDescriptors from  
the tableview, and sort a mutable array using:


- (void)  sortUsingDescriptors:(NSArray*) sortDescriptors

Note that the sort descriptors passed in the first method are the old  
ones, not the current ones, so you have to go back to the table to get  
the new ones. Having sorted the array, you need to reload the table to  
display the outcome. That's all - there's nothing else you need to do  
to support sorting from table columns except setting up the sort key  
and selector in IB.



2.  In attempting to answer #1, I ran into an issue with using the
-ascending message.  The doc states its returns a bool, however, I  
could not

use the message.  Any ideas there?


I don't see any reason to actually try and access the sort descriptor  
itself - just use it as a black box. Note that sort descriptors come  
in an array, so there could be several, one for each sortable column.  
I can't see immediately in the docs what order they come in, so you  
can't necessarily tell which sort descriptor represents a particular  
column (though my *guess* is that the first one is the selected column  
header).



hth,

Graham


___

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

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

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

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


RE: Table sort image question

2009-01-06 Thread Jon C. Munson II

> Essentially what I'm trying to do is determine the sort of the  
> column.  One
> way I've found is to pull out the indicator image.  I plan on  
> comparing that
> to a named image for one of the indicator images.  If there is a  
> better way
> to do that, I'd love to know as I haven't dredged anything up on  
> that yet.


Is there a better way? Let me put it this way: could there possibly be  
a worse way?

[Jon C. Munson II] Yes, there is a better way.  I found it later (as you
point out below).  And there most certainly could be a worse way.

This is nuts.
[Jon C. Munson II] I thought so as well, hence my query.

Look into sort descriptors. Presumably you are trying to determine  
which direction the column is sorted in so that you can sort some data  
accordingly? (Otherwise, what are you trying to do?). The table view  
maintains sort descriptors which not only contain the direction but  
the sort key and selector to use for sorting, and these descriptors  
can be simply passed to a mutable array to sort the array accordingly.  
The table then redisplays the contents. The table's data source can be  
informed of a change to the sort descriptors by the user (like when  
they click a column header) and the data can be resorted.

[Jon C. Munson II] Yes to the first question (I'm trying to sync up a
coverflow with a tableview, much like Finder).  I looked into the sort
descriptors and that is helping.  However, I have a couple more questions:

1.  When is didClickTableColumn actually called?  Is it after the table does
its stuff, including setting the sort descriptors, or just prior to that?  
2.  In attempting to answer #1, I ran into an issue with using the
-ascending message.  The doc states its returns a bool, however, I could not
use the message.  Any ideas there?

[Jon C. Munson II] 


___

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

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

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

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


Re: Overlay controls a la iTunes and QuickTime

2009-01-06 Thread Jean-Daniel Dupas


Le 6 janv. 09 à 10:53, Jean-Daniel Dupas a écrit :



Le 5 janv. 09 à 06:58, Kiel Gillard a écrit :


Howdy all,

What would be the best way to implement a HUD-like overlay of  
controls in the same manner as iTunes and QuickTime? These overlays  
can be seen when playing a video in iTunes 8 or a full screen video  
in (at least) the free version of QuickTime.


Is there example code or open source code that does this?

Thanks,


http://www.binarymethod.com/content/bghudappkit.php


Sorry my answer is not exactly what you ask for. In fact, this  
framework is for the standard HUD window (which is different than the  
iTunes/QuickTime windows).
If you want to create your own HUD window (like iTunes, ot QT), it's  
not very difficult:
- Create your window in IB just like you would do with a standard  
window. Change the class of the window to use your custom window  
class  (see http://developer.apple.com/samplecode/RoundTransparentWindow/ 
 for example).

- Add your button with image and no title.
- Of course, you will have to create custom slider for volume, and  
custom progress control if you want to replicate all QuickTime  
controls).




___

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

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

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

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


Printing PDF Documentation

2009-01-06 Thread Development
No, I do not need to write code to work with PDF; the example program  
to do this is pretty good.


However, lots of documentation from Apple and other companies are not  
available exclusively as PDF file.  Does anyone know of a good  
reliable source for printing out hard copy of the documents?  Let's  
say I have a specific PDF reference that I am constantly looking at.  
Having the 100 page document printed and bound into a simple binding  
would be worth the cost for me.


Has anyone found a printing company online that can handle one time  
job like this?  At reasonable rate?


Thanks,

Steve
___

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

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

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

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


Binary search on sorted NSArray in Cocoa?

2009-01-06 Thread Karan, Cem (Civ, ARL/CISD)
I have an NSArray of unique NSString instances that I have sorted.  I am 
looking for the neighbors of a specific string within the array, which 
basically means finding the string's index, and then looking at the objects 
ahead and behind the string.  So far, so good; I can use indexOfObject to find 
the string in the array, but that is slow as it seems to assume an unsorted 
array.  My question is, does NSArray already have a binary search method 
defined on it in a category somewhere?  If it does, I'd rather use that.

Thanks,
Cem Karan
___

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

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

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

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

Re: Custom NSControl is not visible when dropped on a window from IB3.1 Library

2009-01-06 Thread Brandon Walkin
What you're experiencing could be caused by a number of issues. Mind  
posting the code?


On 4-Jan-09, at 9:41 PM, Richard Humiston wrote:

I have a custom NSControl and custom NSCell.  I created an IBPlugin  
and framework per IB Plugin programming guide, and also used the  
clock control example as a guide.  My  control appears (draws  
itself) in the library pane.  When I drag the control to a window in  
IB, only  a rectangle (made up of dots) appears.  The inspector sees  
the control in the window, displays its settings, etc.  I can drag  
the rect around the window and the control coordinates change in the  
inspector as expected.  If I change settings and save the nib file,  
the changes are saved and appear when I next open the nib...but only  
the rectangle appears.  I am not getting any errors, exceptions, etc  
in the debugger.  I would append code if I knew where the issue was  
located.  I am suspecting the the controls view is not inserted  
properly in the view hierarchy?  Has anyone seen this issue.  Any  
suggestions.


Rich
___

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

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

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

This email sent to bwal...@gmail.com


___

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

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

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

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


Re: Test

2009-01-06 Thread Scott Anguish

You did, several messages ago

From: Scott Anguish 
Date: January 6, 2009 2:09:48 AM EST
To: Cocoa Users 
Subject: [Moderator] Cocoa-Dev must have had a hard New Years

As you many know, the list as absent from 12am PST till just recently.  
The server seems to have had too much New Years celebration, and an  
intervention was required.


Thanks for your patience, and that of the people I kept poking about.

Sincerely

scott
[moderator]
___

basically, it broke over break. The person needed to handle it were  
unavailable, as was the backup person. There was nothing to archive in  
hat time, since the list was silent. I assume steps are being taken to  
prevent this from happening again.






On 5 Jan 2009, at 3:49 am, Carl Anderson wrote:

Have the mailing lists at Apple been closed? I have not received a  
single digest since midnight at the end of last year



Same here, and nothing has been archived in that time either. 6 days  
downtime? That's pretty poor... I wonder if we'll get an explanation?


___

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

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

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

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


[Moderator] Re: Test

2009-01-06 Thread Scott Anguish
The lists were temporarily down after New Years. All subscribers are  
back.


Please don't use the list as a message test reflector. that puts it in  
the mailboxes of some 8000 people.


scott
[moderator]




On 4-Jan-09, at 11:49 AM, Carl Anderson wrote:

Have the mailing lists at Apple been closed? I have not received a  
single digest since midnight at the end of last year

___

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

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

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

This email sent to sc...@cocoadoc.com


___

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

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

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

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


Re: Memory Management to NSError

2009-01-06 Thread Alexander Spohr

If you did not alloc it you should not release it.
That is the rule for ALL objects.

atze


Am 06.01.2009 um 03:16 schrieb Dong Feng:


How shall we handle the NSError object returned directly or indirectly
(through out parameter)? Shall it be released after use? I checked
the example code in Apple document but never see a returned NSError
object get released.

___

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

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

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

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


  1   2   >