[NSWindow title] isn't the title

2010-04-21 Thread Quincey Morris
This is more of a curiosity than anything else, but ...

I have a (non-document) window whose title is set with 
'setTitleWithRepresentedFilename:'. The title actually shown in the title bar 
is the last path component of the file path, as expected.

I have an associated window whose title I'd like to be of the form " — Info".

However when I try to build this from the base window's displayed title, I 
actually get a string with the file name and the path to the file, so I end up 
with  something of the form " —  — 
Info", which isn't really what I want.

The -[NSWindow title] documents this behavior ("If the title has been set using 
setTitleWithRepresentedFilename:, this method returns the file’s path."), but 
that leaves no way to get the actual displayed title.

Does anyone know of a way to get the actual displayed title?

Note:

1. As a work around, I am building the associated window title from the base 
window's 'miniwindowTitle', but there's no guarantee I can see that ensures (in 
the future) this will be what's displayed in the actual title bar of the base 
window.

2. In the past, I've used [NSWindowController 
windowTitleForDocumentDisplayName:] for this purpose, but that doesn't work in 
this case, since there's no actual document.


___

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

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

2010-04-21 Thread Mark Munz
I've run into this as well -- particularly with Automator Actions. I
decided to finally track down the issue.

The root cause appears to be that the RunScript Phase is being called
too early in the build process. So when amlint checks for an
executable, it hasn't been built yet.

If you look at your detailed log, you'll likely see that the RunScript
occurs right after resources are copies, but before the code is
compiled.

I put ${BUILT_PRODUCTS_DIR}/${FULL_PRODUCT_NAME} in the input files
list. Not sure if that is the proper way or not to force the Run
Script to wait for the actual product to be built, but it appears to
do the job.

Hope that helps.

Mark

On Sun, Apr 11, 2010 at 12:31 PM, Scott Ribe  wrote:
>> There are no other warnings tossed out during either compilation
>> Any thoughts?
>
> Compare the build transcripts for debug vs release for clues as to why debug
> is not producing an executable.
>
> --
> Scott Ribe
> scott_r...@killerbytes.com
> http://www.killerbytes.com/
> (303) 722-0567 voice
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/unmarked%40gmail.com
>
> This email sent to unmar...@gmail.com
>



-- 
Mark Munz
unmarked software
http://www.unmarked.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: Crash on NSKVOPendingNotificationRelease (KVO, bindings issue?)

2010-04-21 Thread Quincey Morris
On Apr 21, 2010, at 17:47, Glen Low wrote:

> I'm using KVO as a generalized recalculation engine, somewhat akin to how a 
> spreadsheet recalcuates values based on what's changed. It's mostly 
> successful once you eliminate cycles, but there is a persistent problem.

The likely answer (see below for the reasons) is that this is probably not a 
good approach. Your application needs a specific behavior of change 
propagation, cycle elimination -- as well as other possible constraints -- that 
KVO has no API contract to provide. I'd recommend you spend the effort on 
designing your own object graph and related behavior.

> On each relevant object, I have a 
> observeValueForKeyPath:ofObject:change:context: method which then triggers 
> willChangeValueForKey:  / didChangeValueForKey: for dependent properties. 
> I've noticed that when observeValueForKeyPath:ofObject:change:context gets 
> called more than once in a row for an object, one of the other observed 
> objects dies in didChangeValueForKey: -- here's the stack trace

I *believe* that KVO contains at least one (major? inherent?) bug that causes 
crashes like this with certain patterns of observations. Whenever I run into 
such crashes, I've never been able to work out whether it is in fact a bug, or 
if I did something wrong, nor to recreate the crash in a more controlled 
context that could be used as the basis of a bug report.

So you might have run into a bug. Or you might have set up an observation 
pattern that KVO doesn't really support (either at the level of observers or 
the level of notifications).

KVO has two important defects from the developer's point of view: it's a black 
box system, so trying to understand what it's doing at any given moment is pure 
guesswork; and it's an implementation-defined system, so that beyond its 
general responsibilities, what is does is what it's "supposed to" do, and 
there's no independent standard of whether it's right or wrong.

Plus, KVO probably doesn't scale well as the number of observations increases. 
If your object graph is going to get large, performance may well become a 
consideration.

For all those reasons, I wouldn't suggest using it for an application like 
this, where *propagation* of the notifications across multiple objects is the 
key functional issue.

FWIW.

> Side question: I can of course use keyPathsForValuesAffectingValueForKey: and 
> friends to declare the dependencies instead of using a procedure to react to 
> them, but I need to execute code as well e.g. update the observed value. For 
> example, say A = B/C. When either B or C changes, you want A to change too. I 
> can use keyPathsForValuesAffectingA to declare it depends on B or C, but I 
> need to update the cached A value whenever B or C changes -- how would I do 
> that without using observeValueForKeyPath:ofObject:change:context:?

If you really need to "cache" the A value, then you have to use 
observeValueForKeyPath:ofObject:change:context:. Using 
keyPathsForValuesAffectingA only makes sense if you're going to produce the A 
value on demand.

Incidentally, this example points another defect of using KVO for your 
application. You want A to change when B or C changes, and it will -- 
literally, meaning twice. Once for the B change, and once for the C change. 
That means that A may temporarily have an invalid value, and that might itself 
be propagated via notifications before its final value is calculated. KVO 
guarantees no order for the notifications, and although in a few cases it might 
optimize some repeated notifications away you don't have a lot of control over 
the quantity of notifications that get sent.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NaN Problem Adding Numbers from NSTableView

2010-04-21 Thread Graham Cox

On 22/04/2010, at 12:53 AM, Philip Juel Borges wrote:

> But some times I need to leave a tableview cell blank and then it writes NaN 
> in the label. If I type in 0 (zero) it adds up the numbers nicely. But I'd 
> rather just leave the selection empty rather than typing in a zero.
> 
> Any ideas how to solve the NaN issue?


Add a formatter to the cell and set the 'NaN symbol' to 0. You can do this in 
IB.

--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: one button mouse right click

2010-04-21 Thread Nick Zitzmann

On Apr 21, 2010, at 6:59 PM, k...@highrolls.net wrote:

> trying to get a right - click to show a popup menu
> 
> i had thought that the os would / should convert a ctrl-click to call 
> rightMouseDown
> 
> but I see it does not and I have to look at flags and call rightMouseDown if 
> ctlr key is down

The override you're looking for is actually -menuForEvent:, not 
-rightMouseDown: or -mouseDown:. Control-clicking is not the same as a right 
click.

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: one button mouse right click

2010-04-21 Thread koko

trying to get a right - click to show a popup menu

i had thought that the os would / should convert a ctrl-click to call  
rightMouseDown


but I see it does not and I have to look at flags and call  
rightMouseDown if ctlr key is down



On Apr 21, 2010, at 6:53 PM, Nick Zitzmann wrote:



On Apr 21, 2010, at 6:31 PM, k...@highrolls.net wrote:

when I ctrl-click should rightMouseDown be called or do I have to  
look at the modifier flags in mouseDown ?


No and yes. What exactly are you trying to accomplish?

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: one button mouse right click

2010-04-21 Thread Nick Zitzmann

On Apr 21, 2010, at 6:31 PM, k...@highrolls.net wrote:

> when I ctrl-click should rightMouseDown be called or do I have to look at the 
> modifier flags in mouseDown ?

No and yes. What exactly are you trying to accomplish?

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


Crash on NSKVOPendingNotificationRelease (KVO, bindings issue?)

2010-04-21 Thread Glen Low
I'm using KVO as a generalized recalculation engine, somewhat akin to how a 
spreadsheet recalcuates values based on what's changed. It's mostly successful 
once you eliminate cycles, but there is a persistent problem.

On each relevant object, I have a 
observeValueForKeyPath:ofObject:change:context: method which then triggers 
willChangeValueForKey:  / didChangeValueForKey: for dependent properties. I've 
noticed that when observeValueForKeyPath:ofObject:change:context gets called 
more than once in a row for an object, one of the other observed objects dies 
in didChangeValueForKey: -- here's the stack trace

Program received signal:  “EXC_BAD_ACCESS”.

#0  0x7fff84d31ae1 in NSKVOPendingNotificationRelease
#1  0x7fff88aa0bd3 in __CFArrayReleaseValues
#2  0x7fff88a815f8 in _CFArrayReplaceValues
#3  0x7fff84d31e35 in NSKeyValuePopPendingNotificationPerThread
#4  0x7fff84d31dca in NSKeyValueDidChange
#5  0x7fff84d1574f in -[NSObject(NSKeyValueObserverNotification) 
didChangeValueForKey:]
#6  0x1000181c8 in -[CMEdge didChangeValueOnceForKey:] at CMEdge.m:133
#7  0x100019f51 in -[CMNode 
observeValueForKeyPath:ofObject:change:context:] at CMNode.m:222

The only workaround is to perform the didChangeValueForKey: in the next event 
cycle i.e. by using performSelectorOnMainThread:withObject:waitUntilDone:

Not really ideal especially since I'm worried I'm just covering up the root of 
the problem, whatever it is.

Any ideas on the cause?

Side question: I can of course use keyPathsForValuesAffectingValueForKey: and 
friends to declare the dependencies instead of using a procedure to react to 
them, but I need to execute code as well e.g. update the observed value. For 
example, say A = B/C. When either B or C changes, you want A to change too. I 
can use keyPathsForValuesAffectingA to declare it depends on B or C, but I need 
to update the cached A value whenever B or C changes -- how would I do that 
without using observeValueForKeyPath:ofObject:change:context:?

Cheers
Glen Low
Pixelglow Software___

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

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


one button mouse right click

2010-04-21 Thread koko
when I ctrl-click should rightMouseDown be called or do I have to look  
at the modifier flags in mouseDown ?

___

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

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

2010-04-21 Thread Chase Meadors
I thought as much. In fact, I might just add a myCurrentTime property  
to my subclass that is implemented with this mechanism. Just checking  
to make sure there wasn't anything I missed. Thanks!


On Apr 20, 2010, at 11:56 PM, Kyle Sluder wrote:

On Tue, Apr 20, 2010 at 8:09 PM, Chase Meadors  
 wrote:
Ideally, if QTMovie defined a currentTime property, I could use  
bindings or
a binding-like design to handle the implementation of some time  
text &
progress bar. However, QTMovie does not define it as a property. It  
appears
setCurrentTime is not meant as an accessor to the variable; it's  
not called
when current time changes. There also is no delegate method or  
anything that

is called when currentTime changes.


For something as real-time as video or audio, you can't provide a
currentTime property that isn't interval-based. You'll need to set up
a timer and periodically check the current time of the movie, and
adjust your playhead accordingly.

--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: Determining preferred localizations

2010-04-21 Thread Gary L. Wade
I see what you're getting.  The issue is that the keys you're getting back
by utilizing kDisplayProductName from IOKit only have paired
language/territory (e.g., "en_US") while the AppleLanguages array in your
setups have non-paired ones for most languages (e.g., "en").  If you were to
turn on paired language/territories in the System Preferences (e.g., "U.S.
English") in the desired order, you could get what you're wanting.
Basically, you're asking for something highly specific, but the
configurations only provide more general, so fallbacks go a lot farther than
what you want.

The only way I've been able to bypass this without adding settings to the
System Preferences is to split the pairs and introduce language-only objects
after each pair provided such strings are not already present.  So, you
would rework your array on the MacBook Core 2 Duo 10.6.3 from:

"nl_NL"
"da_DK"
"pl_PL"
"en_US"
"nb_NO"
"fr_FR"
"pt_BR"
"pt_PT"
"zh_CN"
"es_ES"
"ja_JP"
"ru_RU"
"sv_SE"
"zh_TW"
"de_DE"
"fi_FI"
"it_IT"
"ko_KR"

to:

"nl_NL"
"nl"
"da_DK"
"da"
"pl_PL"
"pl"
"en_US"
"en"
"nb_NO"
"nb"
"fr_FR"
"fr"
"pt_BR"
"pt_PT"
"pt"
"zh_CN"
"es_ES"
"es"
"ja_JP"
"ja"
"ru_RU"
"ru"
"sv_SE"
"sv"
"zh_TW"
"de_DE"
"de"
"fi_FI"
"fi"
"it_IT"
"it"
"ko_KR"
"ko"

Not sure how Chinese would work, though, since there's really not a
practical locale of "zh".  Also, you may have issues with the "Hans" vs.
"CN" convention.  Look at the locale APIs to help with splitting and
normalizing these values.

On 04/21/2010 1:54 PM, "Gregory Weston"  wrote:

> Gary L. Wade wrote:
> 
>> The list you are getting is a set of preferred localizations, so when trying
>> to get a resource from the first one, if not available, will go on to the
>> next one and so forth.
>> 
>> You should utilize the localization-aware methods to handle getting
>> resources rather than trying to manage this yourself.  There's really only
>> two reasons I've encountered a need for this kind of granularity, the first
>> where you're forced to use a set of legacy resources that you're unable to
>> move into the right places, and the second a localization utility.
> 
> I think one of us has misunderstood, because I'm not sure how this response
> actually addresses my question. I'll restate and try to be more clear.
> 
> I'm trying to present to the user a list of the attached displays. For any
> given display device, the "name" I get from IOKit is not a string but a
> dictionary mapping locale identifiers to localized versions of the device
> name. My goal is to determine which of the dictionary entries to use.
> 
> I thought NSBundle's preferredLocalizationsFromArray: and
> CFBundleCopyPreferredLocalizationsFromArray() would take an array made up of
> those dictionary keys and give me back a subset of the list, prioritized based
> on such things as the user's localization settings and the available
> localizations within the app. What I'm getting is an array containing a single
> entry which doesn't match the app's development region, doesn't match any set
> of localization resources in the app and is at an unpredictable (although
> consistent per machine) offset in the user's preferred language list.
> 
> System Profiler and the Displays pref pane both show the appropriate value.
> I'm sure I'm doing something wrong but I don't know what.
> 
> Short form: How do I get from an NSScreen or a CGDirectDisplayID to the most
> appropriate human-readable name for the display?
> 
> Greg


___

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

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

2010-04-21 Thread John Engelhart
On Wed, Apr 21, 2010 at 4:33 PM, Matt Neuburg  wrote:

> On Tue, 20 Apr 2010 15:45:13 -0400, John Engelhart
>  said:
>
> >There are an awful lot of "Top 10" applications that use RegexKitLite
> >that don't acknowledge their use
>
> "An awful lot"? Ex hypothesi and by definition, there must be 10 such
> applications or fewer...! m.


I don't think many people would be surprised that any given "Top 10" list
must contain, by definition, 10 or fewer such applications "that use
RegexKitLite that don't acknowledge their use".


However, it does not necessarily follow that there can only be 10 or fewer
'"Top 10" applications that use RegexKitLite that don't acknowledge their
use'.  Just because all beaucoup fish are fish does not mean that all fish
are beaucoup fish.  Your conclusion would true if, and only if, there was a
single "Top 10" list.  It is assumed, without proving, that there is more
than one "Top 10" list.


There are an awful lot of "Top 10" applications that use RegexKitLite that
don't acknowledge their use.  QED.


> --
> matt neuburg, phd = m...@tidbits.com, 
>

"phd"?  Is that "University" with one or two "n"s?  :)
___

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

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

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

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


Re: Determining preferred localizations

2010-04-21 Thread Gregory Weston
Gary L. Wade wrote:

>The list you are getting is a set of preferred localizations, so when trying
>to get a resource from the first one, if not available, will go on to the
>next one and so forth.
>
>You should utilize the localization-aware methods to handle getting
>resources rather than trying to manage this yourself.  There's really only
>two reasons I've encountered a need for this kind of granularity, the first
>where you're forced to use a set of legacy resources that you're unable to
>move into the right places, and the second a localization utility.

I think one of us has misunderstood, because I'm not sure how this response 
actually addresses my question. I'll restate and try to be more clear.

I'm trying to present to the user a list of the attached displays. For any 
given display device, the "name" I get from IOKit is not a string but a 
dictionary mapping locale identifiers to localized versions of the device name. 
My goal is to determine which of the dictionary entries to use.

I thought NSBundle's preferredLocalizationsFromArray: and 
CFBundleCopyPreferredLocalizationsFromArray() would take an array made up of 
those dictionary keys and give me back a subset of the list, prioritized based 
on such things as the user's localization settings and the available 
localizations within the app. What I'm getting is an array containing a single 
entry which doesn't match the app's development region, doesn't match any set 
of localization resources in the app and is at an unpredictable (although 
consistent per machine) offset in the user's preferred language list.

System Profiler and the Displays pref pane both show the appropriate value. I'm 
sure I'm doing something wrong but I don't know what.

Short form: How do I get from an NSScreen or a CGDirectDisplayID to the most 
appropriate human-readable name for the display?

Greg
___

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

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

2010-04-21 Thread Chris Backas
On Apr 21, 2010, at 4:33 PM, Matt Neuburg wrote:

>> There are an awful lot of "Top 10" applications that use RegexKitLite
>> that don't acknowledge their use
>
> "An awful lot"? Ex hypothesi and by definition, there must be 10 such
> applications or fewer...! m.

Except that there can be many Top Ten lists (Mac Apps, iPad Apps,  
iPhone Apps, Productivity Apps) etc, and then different sites/people  
put different things on their lists.   You could pretty quickly get a  
list of unique programs much larger than 10 ;)

-Chris Backas



CONFIDENTIALITY NOTICE: This email (and any related attachments) contains 
information from InfoPlus (a service of Bristol Capital, Inc.).  It is intended 
only for the addressee and may contain information that is confidential and/or 
otherwise exempt from disclosure under applicable law. If you are not the 
intended recipient or are acting as agent for the intended recipient, any use 
or disclosure of this communication is prohibited. If you have received this 
communication in error, please notify me immediately to arrange for the 
appropriate method of returning or disposing of the communication. If our 
respective Companies have confidentiality provisions in effect, this email and 
the materials contained herein are deemed CONFIDENTIAL and should be treated 
accordingly unless expressly provided otherwise.


___

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

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

2010-04-21 Thread Matt Neuburg
On Tue, 20 Apr 2010 15:45:13 -0400, John Engelhart
 said:

>There are an awful lot of "Top 10" applications that use RegexKitLite
>that don't acknowledge their use

"An awful lot"? Ex hypothesi and by definition, there must be 10 such
applications or fewer...! m.

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



___

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

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

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

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


Re: CoreData: updating property of fetched object and refetching

2010-04-21 Thread olivier destrebecq
Thanks, that solved it.

Olivier
http://www.flickr.com/photos/otusweb/



On Tue, Apr 20, 2010 at 4:16 PM, Keary Suska wrote:

> On Apr 20, 2010, at 11:22 AM, olivier destrebecq wrote:
>
> > Just to clarify, when i say save, i mean call save: on the context and
> write
> > it to disk. Which  the documentation state that you don't have to call
> save:
> > to be able to query for objects and that modified object will be found.
>
> Yes. Everything the person said in their email was entirely false (even the
> statement about SQL). Ignore it completely.
>
> > If i wait a little bit (probably for the next event in the event loop)
> then
> > the object is found and i never called save: on the context (which will
> save
> > the context to disk). I actually only  call save:  when the app exits.
> >
> > The save: method will commit to disk, i'll looking for what trigger a
> commit
> > to context I guess.
>
> All the save: does is flush all changes to the context to the persistent
> store. Therefore, they must already be "committed" to the context, so to
> speak. Assuming that you have only one context and are not using multiple
> threads, you may be running into an issue where you have to call
> -processPendingChanges on the context. This might be why you see the delay
> in "committing", as processPendingChanges  is normally called in the run
> loop. Give that a shot.
>
> > I think what i'm running into is this:
> > "If you fetch some objects, work with them, and then execute a new fetch
> > that includes a superset of those objects, you do not get new
> > instances or*update data for the existing objects
> > *—you get the existing objects with their current in-memory state."
> >
> > The question is how do i commit the updated data to the in memory
> > representation?
>
> Just to clarify that statement, the docs are simply saying that, no matter
> what, you will always get the in-memory representation, and in fact, will
> get the very same manage object that you have previously edited, rather than
> a new object with updated values.
>
> > On Tue, Apr 20, 2010 at 9:23 AM, Joanna Carter <
> > cocoa...@carterconsulting.org.uk> wrote:
> >
> >> Hi Olivier
> >>
> >>> I create an object and insert it into the context, then i update a
> couple
> >>> properties.
> >>>
> >>> Later I i do a fetch request with a predicate on the property i updated
> >>> after the insertion. If i do this fetch right after the update of the
> >>> property (using the accessors provided by coreData), then the fetch
> does
> >> not
> >>> find the object I created. If i wait longer then it finds it.
> >>>
> >>> Is there a way to "commit" the change so that the fetch will find the
> >> object
> >>> without saving. I don't want to save every time i update a property.
> >>
> >> Since a fetch request returns fully saved objects, I can't see how you
> can
> >> expect it to see unsaved changes.
> >>
> >> Think about it in database terms - you wouldn't expect a SQL statement
> to
> >> return anything other than committed rows. Essentially Core Data is an
> "OO
> >> database" and, unless you write your own caching, I doubt if you are
> going
> >> to get what you want without saving.
> >>
> >> Joanna
> >>
> >> --
> >> Joanna Carter
> >> Carter Consulting
> >>
> >>
> > ___
> >
> > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> >
> > Please do not post admin requests or moderator comments to the list.
> > Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> >
> > Help/Unsubscribe/Update your Subscription:
> >
> http://lists.apple.com/mailman/options/cocoa-dev/cocoa-dev%40esoteritech.com
> >
> > This email sent to cocoa-...@esoteritech.com
> >
>
>
> 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: Why is compiler warning for +setKeys:triggerChangeNotificationsForDependentKey: ??

2010-04-21 Thread Greg Parker
On Apr 20, 2010, at 7:16 PM, Roland King wrote:
> Either way I still don't see why you'd get a method potentially not found 
> warning, I'd expect a deprecation warning.

There was a compiler bug wherein deprecation warnings on class methods did not 
work. It should be fixed in a future developer tools release, if it isn't fixed 
already.


-- 
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: using coregraphics with vector art from illustrator

2010-04-21 Thread Ross Carter
> Is there perhaps a way to create vector art paths in illustrator, and import
> the data into xcode and use those paths in CG and stroke/fill them there?

It might be worth looking at Opacity from likethought.com. It exports directly 
into source code.
___

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

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

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

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


Re: need help getting Apple sample code to compile

2010-04-21 Thread David Duncan
On Apr 21, 2010, at 3:51 AM, WT wrote:

> I'm trying to compile the XML Performance sample code for the iPhone, but I 
> have so far been unsuccessful.

I just downloaded and built the sample without issue, the ReadMe describes what 
you might need to do to include libXML in your own project, not modifications 
necessary to the sample (sample code is designed to be self contained and built 
without modification as a general case).

> What am I missing?


From what I can tell, your doing too much.
--
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: Determining preferred localizations

2010-04-21 Thread Gary L. Wade
The list you are getting is a set of preferred localizations, so when trying
to get a resource from the first one, if not available, will go on to the
next one and so forth.

You should utilize the localization-aware methods to handle getting
resources rather than trying to manage this yourself.  There's really only
two reasons I've encountered a need for this kind of granularity, the first
where you're forced to use a set of legacy resources that you're unable to
move into the right places, and the second a localization utility.


On 04/21/2010 6:59 AM, "Gregory Weston"  wrote:

> I'm trying to display a localized list of attached displays, and getting
> unexpected results in Carbon and Cocoa when attempting to determine the best
> localization. I did all the obvious-to-me Google searches without finding much
> except a couple of other people over the years having similar issues and no
> real resolution. Sample code and results follow. Hoping someone can point me
> in the right direction.
> 
> FWIW, I've tried both "en" and "English" for both the Info.plist development
> region and the localized resources folder in the app.
> 
> Thanks for any help.
> 
> Greg
> 
> - (NSString*)bestLocalization:(NSArray*)inChoices
> {
>   NSUserDefaults* theDefaults = [NSUserDefaults standardUserDefaults];
>   NSArray* theUserSettings = [theDefaults objectForKey:@"AppleLanguages"];
>   NSLog(@"User Settings: %@", theUserSettings);
> 
>   NSLog(@"Choices: %@", inChoices);
> 
>   NSArray* theBestOnes = [NSBundle preferredLocalizationsFromArray:inChoices];
>   NSLog(@"Chose: %@", theBestOnes);
> 
>   return [theBestOnes objectAtIndex:0];
> }
> 
> Mac mini (Early 2009) 10.6.3 with Dell 2007WFP:
> 
> User Settings: (English)
> Choices: ("en_US")
> Chose: ("en_US")
> 
> MacBook Core 2 Duo 10.6.3:
> 
> User Settings: (en, fr, ja, de, es, it, nl, sv, nb, da, fi, pt, "zh-Hans",
> "zh-Hant", ko, ru, pl, "pt-PT")
> Choices: ("nl_NL", "da_DK", "pl_PL", "en_US", "nb_NO", "fr_FR", "pt_BR",
> "pt_PT", "zh_CN", "es_ES", "ja_JP", "ru_RU", "sv_SE", "zh_TW", "de_DE",
> "fi_FI", "it_IT", "ko_KR")
> Chose: ("zh_CN")
> 
> MacBook Pro 10.5.8 plus Apple Cinema Display:
> 
> User Settings: (en, fr, ja, de, es, it, pt, "pt-PT", nl, sv, nb, da, fi, ru,
> pl, "zh-Hans", "zh-Hant", ko)
> Choices: ("it_IT", "en_US", "ko_KR", "fi_FI", "nb_NO", "ru_RU", "zh_CN",
> "nl_NL", "de_DE", "ja_JP", "pl_PL", "es_ES", "fr_FR", "zh_TW", "da_DK",
> "sv_SE", "pt_BR", "pt_PT")
> Chose: ("fr_FR")
> User Settings: (en, fr, ja, de, es, it, pt, "pt-PT", nl, sv, nb, da, fi, ru,
> pl, "zh-Hans", "zh-Hant", ko)
> Choices: ("it_IT", "en_US", "ko_KR", "fi_FI", "nb_NO", "ru_RU", "zh_CN",
> "nl_NL", "de_DE", "ja_JP", "pl_PL", "es_ES", "fr_FR", "zh_TW", "da_DK",
> "sv_SE", "pt_BR", "pt_PT")
> Chose: ("fr_FR")
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> 
http://lists.apple.com/mailman/options/cocoa-dev/garywade%40desisoftsystems.co>
m
> 
> This email sent to garyw...@desisoftsystems.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


playing QuickTime movies on iPhone/iPad?

2010-04-21 Thread Steve Christensen
I have a need to be able to play a QuickTime movie containing subtitle  
tracks, and to be able to turn specific tracks on or off. In looking  
through the iPhone/iPad docs, it looks like the movie player classes  
are pretty much restricted to simple playback functions. Have I missed  
something?


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: Custom progress bar for QTMovie??

2010-04-21 Thread douglas welton
Chase,

The method I use for doing this relies on QuickTime, not QTKit.  Even so, I 
think it is most effective.  I implement a movieController action callback 
filter.  This method is demonstrated in the "Adding New Capabilities to the 
QTKitPlayer Application" section of this document:



later,

douglas




Establish a 

On Apr 20, 2010, at 11:09 PM, Chase Meadors wrote:

> I'm making a completely custom CoreAnimation-based view that plays an audio 
> media stored in a QT movie. However, I'm struck with an implementation 
> problem with indicating the current time in the movie.
> 
> Ideally, if QTMovie defined a currentTime property, I could use bindings or a 
> binding-like design to handle the implementation of some time text & progress 
> bar. However, QTMovie does not define it as a property. It appears 
> setCurrentTime is not meant as an accessor to the variable; it's not called 
> when current time changes. There also is no delegate method or anything that 
> is called when currentTime changes.
> 
> I could setup a timer to check on my QTMovie's currentTime, but that seems 
> silly to setup a 1 second timer to check that the current time has increased 
> by 1 second, when I could just maintain my own current time property.
> 
> As said before, I could maintain my own currentTime property, incrementing it 
> every second that the QTMovie is playing, and I suppose re-sync it whenever 
> the user manually changes the currentTime. However, this just seems like 
> horrible design.
> 
> So anyway, QTMovie doesn't appear to support a bindings like design for it's 
> currentTime, so how would one go about implementing a custom progress slider, 
> or text, representing the current time of a QTMovie??
> 
> Thanks for any thoughts! -Chase

___

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

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


NaN Problem Adding Numbers from NSTableView

2010-04-21 Thread Philip Juel Borges

Hi,

I've googled this issue to no avail until now. In my application I  
have a tableview with 6 columns to enter numbers for statistic  
purposes. That works fine. Yet, I've run into a problem adding the  
numbers together. Under each column below the tableview I have placed  
an NSLabel to show the total amount. I bind that label under Value in  
the bindings panel like so:


Bind To: myArrayController
Controller Key: arrangedObjects
Model Key Path: properti...@sum.hours

But some times I need to leave a tableview cell blank and then it  
writes NaN in the label. If I type in 0 (zero) it adds up the numbers  
nicely. But I'd rather just leave the selection empty rather than  
typing in a zero.


Any ideas how to solve the NaN issue?

--Philip
___

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

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


Determining preferred localizations

2010-04-21 Thread Gregory Weston
I'm trying to display a localized list of attached displays, and getting 
unexpected results in Carbon and Cocoa when attempting to determine the best 
localization. I did all the obvious-to-me Google searches without finding much 
except a couple of other people over the years having similar issues and no 
real resolution. Sample code and results follow. Hoping someone can point me in 
the right direction.

FWIW, I've tried both "en" and "English" for both the Info.plist development 
region and the localized resources folder in the app.

Thanks for any help.

Greg

- (NSString*)bestLocalization:(NSArray*)inChoices
{
  NSUserDefaults* theDefaults = [NSUserDefaults standardUserDefaults];
  NSArray* theUserSettings = [theDefaults objectForKey:@"AppleLanguages"];
  NSLog(@"User Settings: %@", theUserSettings);

  NSLog(@"Choices: %@", inChoices);

  NSArray* theBestOnes = [NSBundle preferredLocalizationsFromArray:inChoices];
  NSLog(@"Chose: %@", theBestOnes);

  return [theBestOnes objectAtIndex:0];
}

Mac mini (Early 2009) 10.6.3 with Dell 2007WFP:

User Settings: (English)
Choices: ("en_US")
Chose: ("en_US")

MacBook Core 2 Duo 10.6.3:

User Settings: (en, fr, ja, de, es, it, nl, sv, nb, da, fi, pt, "zh-Hans", 
"zh-Hant", ko, ru, pl, "pt-PT")
Choices: ("nl_NL", "da_DK", "pl_PL", "en_US", "nb_NO", "fr_FR", "pt_BR", 
"pt_PT", "zh_CN", "es_ES", "ja_JP", "ru_RU", "sv_SE", "zh_TW", "de_DE", 
"fi_FI", "it_IT", "ko_KR")
Chose: ("zh_CN")

MacBook Pro 10.5.8 plus Apple Cinema Display:

User Settings: (en, fr, ja, de, es, it, pt, "pt-PT", nl, sv, nb, da, fi, ru, 
pl, "zh-Hans", "zh-Hant", ko)
Choices: ("it_IT", "en_US", "ko_KR", "fi_FI", "nb_NO", "ru_RU", "zh_CN", 
"nl_NL", "de_DE", "ja_JP", "pl_PL", "es_ES", "fr_FR", "zh_TW", "da_DK", 
"sv_SE", "pt_BR", "pt_PT")
Chose: ("fr_FR")
User Settings: (en, fr, ja, de, es, it, pt, "pt-PT", nl, sv, nb, da, fi, ru, 
pl, "zh-Hans", "zh-Hant", ko)
Choices: ("it_IT", "en_US", "ko_KR", "fi_FI", "nb_NO", "ru_RU", "zh_CN", 
"nl_NL", "de_DE", "ja_JP", "pl_PL", "es_ES", "fr_FR", "zh_TW", "da_DK", 
"sv_SE", "pt_BR", "pt_PT")
Chose: ("fr_FR")
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: appscript project gives warning with XCODE 3.2.2

2010-04-21 Thread Karl Moskowski

On 2010-04-21, at 8:17 AM, John Love wrote:

> Everything worked just dandy for SourceForge's "appscript" with XCODE 3.2.1.  
> But, with updating to 3.2.2, it is giving me some grief:
> 
> For one project, it's giving a warning:
> 
> ld: warning: directory '/Users/johnlove/Documents/XCode/Calculate 
> Medical/../../../appscript/Appscript Framework Project/build/Debug' following 
> -F not found
> 
> Being a warning, app still runs and runs impeccably.
> 
> I thought that maybe the appscript framework needed to be re-built with XCODE 
> 3.2.2 .. but that attempt generates an error:
> 
> There is no SDK with the name or path '/Developer/SDKs/MacOSX10.4u.sdk'.
> 
> I can hardly remember Tiger sdk's being on my hard drive.
> 
> Building with 3.2.1 gives no error.

I've seen the same problem with tool-type targets, though only in build configs 
with the setting Build Active Architecture Only unchecked (e.g., the Release 
config, in a new Foundation tool project). I first noticed it with Sparkle on 
3.2.2 - building the relaunch tool target shows these warnings.

It looks like it's a bug in 3.2.2. I filed it (rdar://7872548), in case anyone 
else wants to jump on the bandwagon.


Karl Moskowski 
Voodoo Ergonomics Inc. 



smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

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

appscript project gives warning with XCODE 3.2.2

2010-04-21 Thread John Love
Everything worked just dandy for SourceForge's "appscript" with XCODE 3.2.1.  
But, with updating to 3.2.2, it is giving me some grief:

For one project, it's giving a warning:

ld: warning: directory '/Users/johnlove/Documents/XCode/Calculate 
Medical/../../../appscript/Appscript Framework Project/build/Debug' following 
-F not found

Being a warning, app still runs and runs impeccably.

I thought that maybe the appscript framework needed to be re-built with XCODE 
3.2.2 .. but that attempt generates an error:

There is no SDK with the name or path '/Developer/SDKs/MacOSX10.4u.sdk'.

I can hardly remember Tiger sdk's being on my hard drive.

Building with 3.2.1 gives no error.

John Love
Touch the Future! Teach!


___

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

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


need help getting Apple sample code to compile

2010-04-21 Thread WT
Hello all,

I'm trying to compile the XML Performance sample code for the iPhone, but I 
have so far been unsuccessful. I followed the instructions on the readme file, 
namely, to set the HEADER_SEARCH_PATHS build setting to 
$SDKROOT/usr/include/libxml2. I also tried both recursive and non-recursive (I 
think it should be recursive, since the directory in question contains another 
directory, libxml, which then contains the header files, even though the readme 
instructions say nothing about the recursive option). I've also verified that 
the library is in fact included in the project.

Yet, I keep getting errors such as

.../XMLPerformance/XMLPerformance/Classes/LibXMLParser.h:49:0 Libxml/tree.h: No 
such file or directory in 
.../XMLPerformance/XMLPerformance/Classes/LibXMLParser.h

I searched the archives for prior messages about this sample code but nothing 
came up.

What am I missing?

Thanks in advance.
WT___

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

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


Increase area for autoscrolling in NSScrollview

2010-04-21 Thread Nikhil Khandelwal
Hi,

In my application I have a NSScrollView which has NSView s in it. When I drag n 
drop the views inside the scrollview  autoscrolling in scroll view doesn't 
start from half of scroll point. It starts below from expected. Scrolling 
should start from the black line while in my application it starts from around 
red line which results in slow scrolling. Is there any way to increase the area 
for auto scrolling. I have tried some stuff from NSScroller but doesn't work.

[cid:image002.png@01CAE15A.F0B80B20]
Please let me know if someone faced this situation before.

Thanks,
Nikhil

DISCLAIMER
==
This e-mail may contain privileged and confidential information which is the 
property of Persistent Systems Ltd. It is intended only for the use of the 
individual or entity to which it is addressed. If you are not the intended 
recipient, you are not authorized to read, retain, copy, print, distribute or 
use this message. If you have received this communication in error, please 
notify the sender and delete all copies of this message. Persistent Systems 
Ltd. does not accept any liability for virus infected mails.
<>___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: NSTableView delete row with key?

2010-04-21 Thread Ron Fleckner


On 21/04/2010, at 5:15 PM, Chris Idou wrote:




What would be the appropriate way to have an NSTableView notice that  
you hit the delete key and delete the current row?





Rough guess: override delete, remove the item in your storage class  
that the row represents, reload the tableview.


Ron
___

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

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


NSTableView delete row with key?

2010-04-21 Thread Chris Idou


What would be the appropriate way to have an NSTableView notice that you hit 
the delete key and delete the current row?



___

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

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