Re: NSOutlineView slow update w Core Data

2008-03-05 Thread David
I figured out a way around it. I added code in the controller to send the
"processPendingChanges" message to the ManagedObjectContext. That flushes
pending changes, but I still don't understand why this is needed.

On Wed, Mar 5, 2008 at 12:14 AM, David Melgar <[EMAIL PROTECTED]> wrote:

> I have an NSOutlineView subclass bound to a NSTreeController subclass
> which is bound to a simple data model representing a hierarchical tree
> structure.
> I've implemented drag and drop by having the view send a custom message to
> my NSTreeController subclass who then updates the model. The problem is that
> there is then a delay of about 1 second before the view displays the added
> node.
>
> I've noticed that if I move the mouse out of the OutlineView, then it
> seems to update immediately. Any idea what I maybe doing wrong? Is it
> possible that core data and all the observing patterns are really taking
> this long to percolate the change back to the view? Am I supposed to do
> something to wake up the view faster?
>
> I'm using Leopard (10.5.2), XCode 3, Objective-C 2.0. I don't have any
> code to deal with memory management. If I run with garbage collection
> unsupported, the OutlineView never updates UNTIL I move the mouse out of the
> OutlineView. If garbage collection is enabled, there is the 1 second delay.
> With garbage collection supported, there are no errors or exceptions listed
> in the console.
>
> MyOutlineView has the following method
>
> - (BOOL)performDragOperation:(id )sender {
>
> NSPasteboard *pboard;
>
> NSDragOperation sourceDragMask;
>
>  sourceDragMask = [sender draggingSourceOperationMask];
>
> pboard = [sender draggingPasteboard];
>
>  if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {
>
> NSArray *files = [pboard propertyListForType:NSFilenamesPboardType
> ];
>
> if (myTreeController != NULL) {
>
> [myTreeController addFiles:files];
>
> }
>
> }
>
> return YES;
>
> }
>
> MyTreeController method is as follows:
>
> - (void)addFiles:(NSArray *)droppedFilenames {
>
> NSManagedObjectContext *moc = [self managedObjectContext];
>
> for (NSString *name in droppedFilenames) {
>
> NSManagedObject *bfile = [NSEntityDescription
> insertNewObjectForEntityForName:@"bFiles" inManagedObjectContext:moc];
>
> [bFile setName: name];
>
> }
>
> }
>
>
> The model is:
>
> Entity name: bFiles
>
> Attribute: name
>
> relationship: parent, optional, bFiles
>
> relationship: child,  optional, bFiles
>
>
> I have MyTreeController nib configured with the following attributes
>
> Keypaths: children = children
>
> Options: avoid empty selection, preserve selection, select inserted
> objects
>
> ObjectController:
>
> Mode=Entity
>
> Entity name = bFiles
>
> Prepares content, editable
>
>
> I have MyTreeController bound as follows:
>
> Parameters, ManagedObjectContext
>
> bind to File's Owner
>
> Model key path = managedObjectContext
>
> Raises for not applicable keys
>
>
> I don't have my NSOutlineView bound to anything but I do have the
> contained TableColumn bound as follows:
>
> Value: bind to: Tree Controller
>
> Controller Key = arrangedObjects
>
> Model Key Path = name
>
> Allows editing multiple value selection
>
> Creates sort descriptor
>
> Raises for not applicable keys
>
>
> Thats about everything pertinent that I can think of. Any suggestions
> appreciated.
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Syntax error when declaring an IBOutlet

2008-03-06 Thread David
Whats in World.h?

On Thu, Mar 6, 2008 at 1:16 PM, Mark Teagarden <[EMAIL PROTECTED]> wrote:

> Hi,
>
> My app has three objects - world, mapview, and game, and they need to know
> about each other in various combinations: mapview needs an outlet to world
> and game, and game needs an outlet to world.  I've ctrl-clicked them all
> together appropriately in IB, and now I'm trying to declare the IBOutlets
> in
> code.  So in mapview.h:
>
> #import 
> #import "World.h"
> #import "Game.h"
>
> @interface WMapView : NSView {
>IBOutlet Game * game;
>IBOutlet World * world;
>int view_x, view_y, window;
>
> }
>
> This worked fine and complied correctly.  But the following code
> (identical,
> as far as I can tell) in game.h:
>
> #import 
> #import "World.h"
>
> @interface Game : NSObject {
>IBOutlet World * world;
> }
>
> Throws up: 'syntax error before World' in the IBOutlet statement.  I was
> able to get around this by replacing
>
> #import "World.h"
>
> with
>
> @class World
>
> in game.h.
>
> I have another class, Display, that gives me the same error as the one in
> game.h - I've omitted it here for clarity.  Basically, the mapview.h#import
> / IBOutlet is the only one that worked correctly.
>
> My questions are:
> 1.  Why does identical code work in one file and not in the others?
> 2.  Why should @class work when #import doesn't?  Hillegass flat out says
> that the two are interchangeable.
>
> Thanks,
> Mark
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Animation when adding view. Where should view come from, NIB or programmatic?

2008-03-20 Thread David
I think this is a basic question.In interface builder you can specify
animations which occur when adding a view. Question is, where does the view
typical come from? It seems desirable to be able to design a potentially
complex view in IB, obtain a reference to it and use it for animations. Or
is it assumed that you're programmatically creating the view?

I've been trying to find similar examples to popup windows and found some
discussions stating that you can't find a window in the nib and that you
should have a separate NIB per window.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Threads and Core Data, bindings results in view corruption

2008-03-29 Thread David
I would think this is the normal typical case, but can't figure it out.
The UI should run on one thread, another thread should be used for time
consuming updates/generation of an object tree maintained using Core Data. I
have a NSOutlineView (via NSTreeController subclass) which displays the
object tree from Core data.

I can not figure out how to make this thread safe. I periodically get random
data showing up in the outline view while the core data object tree is being
updated.

I've tried locking the managedObjectContext when I make additions or changes
to the object tree, but I still get erroneous data showing up in the view.

I don't understand how NSTreeController and bindings are interacting with
Core data to extract the data while I'm populating it.

Any suggestions greatly appreciated.

I've been reading and rereading the Core Data programming guide and
Threading programming guide to no avail.

The Core data programming guide says its best to maintain a separate
managedObjectContext per thread. But this appears to require the data to be
written to persistent store to make it work (file). That not reasonable in
my case where I'm adding many objects to an object tree. It takes a
significant amount to time to write it out, negating the benefit of trying
to make the UI seem responsive.

I'm running Leopard.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Threads and Core Data, bindings results in view corruption

2008-03-31 Thread David
Thank you very much for the response which is chock full of helpful
information. Its taken me some time to try and digest.I must admit being a
little demoralized. I've always considered threading to go hand and hand
with GUI programming. I'm having trouble envisioning the scenarios where
bindings and core data are intended to be used without threads.

I'm relatively new to Cocoa. From my previous work in win32 and Java this is
the normal scenario, not an unusual one. Can someone point me to some sample
code that illustrates how to have a worker thread updating data which is
displayed in the UI?

In my case I am/was trying to maintain a outline view representing files,
storing each node in core data. Based on these responses I'm not sure what
technologies I should reasonably be using. Is this too fine grained for Core
Data? Should I give up on bindings? Should I give up on NSTreeController?

If I try to maintain multiple MOCs, that means I have to save to get it to
show up in the other moc, right? The save as binary file can take 15 seconds
in my case when I have thousands of nodes. That hangs the UI longer than
adding the nodes to start with. Should I try to use a in memory persistent
store or will that still be slow or cause an excessive memory penalty?

Additional comments below:

On Sun, Mar 30, 2008 at 9:50 PM, Ben Trumbull <[EMAIL PROTECTED]> wrote:
>
> If you want multi-threaded work with the view and controller classes
> in Cocoa, you'll need to perform your background operations, and
> communicate back to the main thread (view & controllers) via the run
> loop.  -performSelectorOnMainThread and its friends in NSThread.h are
> your best bet.
>
> Using a run loop on a background thread and communicating from the
> main thread to it with the new 10.5 -performSelector... methods is
> often conceptually simpler (easier to debug) than many other
> threading patterns.
>
> Sharing a MOC with Cocoa Bindings and a background thread will end in
> tears.  Cocoa Bindings doesn't lock its bound MOC, so you're
> basically SOL.

Can I ask why don't bindings lock the bound MOC or provide the option to? I
had assumed (incorrectly) that bindings would handle threads OR provide some
means to control or configure its threading behavior.

>
> Even if it did work, though, it'd be a bad idea.  Sharing a MOC means
> a background thread would still at times block the main thread and
> SPOB your app.

Why doesn't core data support locking at a finer grain? Or to rephrase, it
would be very helpful if Core Data could lock at a ManagedObject level. I
expected there to be a locking or transaction mode where I can lock it while
I fill in an object. Nothing else should require me to worry about core data
getting corrupted with multiple threads.

>
>
> These 3 points (can't work, doesn't work, shouldn't work) are why the
> Core Data Programming Guide says don't do this.
>
 The Core Data programming guide in the threading section guidelines states:

"3) Pass managed objects or managed object contexts between threads.

This approach is strongly discouraged. You must ensure that you apply locks
as appropriate and necessary."

I have interpreted that to mean that locking the managedObjectContext would
be sufficient. I hadn't realized that bindings would try to obtain locks.

>
>
> The list archives also have these, which you should read:
> 
> 
>
> It's possible to shuttle pending changes between threads by hand using
> KVC.

Are you describing in general or specifically with Core Data? Can you give
more insight on this? Are you saying that I manually track changes from core
data?

If its my own objects, I would expect to manage fine grain locks or
synchronize code which modifies by object tree.

>
>
>
> If you're inserting a large number of new objects, you really should
> just batch the operation together, save, and present the user with
> new objects in the tree view in batches.


>
> On Leopard, in the scenarios under which you can save, you can also
> use -mergeChangesFromContextDidSaveNotification:

But isn't a notification received on the same thread on which it was
posted?

>
>
>
> Finally, in 4 years no one has filed a bug about this.

File a bug about what? Do you consider the threading behavior in bindings
and Core data to be a bug?

>
>
> --
>
> -Ben
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Threads and Core Data, bindings results in view corruption

2008-03-31 Thread David
On Mon, Mar 31, 2008 at 2:26 PM, Jeff LaMarche <[EMAIL PROTECTED]>
wrote:

> 4) You can, as Ben mentioned, use performSelector:onMainThread: to
> actually have the object inserted on the main thread's context. It's a bit
> of a pain, but threads are always at least a little painful.
>

How? Core data says that to use NSManagedObjects between threads you need to
pass an ID and access it from another context. But you don't even get an ID
until you perform a save on the original context. I'm then back to my
original problem where the save itself takes too long.

>From what I've read so far, my current thinking is that I need to give up on
Core data. I can easily create my own objects, handle my own locking or
synchronization. I was thinking to still use NSTreeController bound to my
objects.

Its a shame because core data sounds so cool. I love the data modeling
aspects. Nice way to think through the problem even if I end up not using
it.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Threads and Core Data, bindings results in view corruption

2008-03-31 Thread David
I found a post with a solution similar to what I was asking about,
http://lists.apple.com/archives/student-dev/2006/Jun/msg00104.html
Essentially he proposed to maintain multiple mocs in sync using an in memory
persistent store. But I worry that that will be too slow and consume
excessive memory.
___

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

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

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

This email sent to [EMAIL PROTECTED]


ButtonCell with Text in OutlineView

2008-05-15 Thread David
I'm trying to have a hierarchical set of choices with a checkbox next to
each one. How can I best set this up?
My current thinking was to try and create a NSButtonCell subclass which
would act like a NSTextCell in that setting its value would set its title,
but I'd parse the string which is encoded with a flag to indicate if the
button is selected or not.

I have NSTreeController bound to my model and the column in NSOutlineView
bound to the appropriate key path in NSTreeController.

I do not understand how the column in the NSOutlineView knows how to set the
property to the cell. How are the cell and column related? How do they
interact?

What method do I need to implement in my cell to intercept the value being
set so that I can in turn set the title and button state?

Is this the best approach? Is there some other preferred approach to this
common problem?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ButtonCell with Text in OutlineView

2008-05-16 Thread David
Is there a document which describes how columns interact with enclosed cells
when dealing with bindings?

There's a message flow going on that I'm not aware of. setObjectValue is
passed different things for the same binding depending on if my class
subclasses NSTextFieldCell or NSButtonCell. I don't see a way to fake it out
without seeing more of the message flow. Too bad the source code isn't
available. In the Java world, if worse comes to worse you can read the
source to understand how framework classes interact.

I've also read about a delegate method on
NSOutlineView, outlineView:willDisplayCell:forTableColumn:item:
Is this a more appropriate way to solve the problem? Should I be able to
modify the title of a button cell through this delegate method?

On Fri, May 16, 2008 at 1:58 AM, Kyle Sluder <
[EMAIL PROTECTED] <[EMAIL PROTECTED]>> wrote:

> On Thu, May 15, 2008 at 1:39 PM, David <[EMAIL PROTECTED]> wrote:
> > I do not understand how the column in the NSOutlineView knows how to set
> the
> > property to the cell. How are the cell and column related? How do they
> > interact?
>
> You bind the value of the column to a property, and then the column
> loops N times, where N is the number of rows, setting the cell's value
> and then drawing the cell in each row.  It's non-obvious until you
> really understand how the view/cell dichotomy works.
>
> > Is this the best approach? Is there some other preferred approach to this
> > common problem?
>
> I'm hesitant to suggest this because it seems like bad form (reminds
> me of the magic \t character in Windows menus that separates the menu
> item name from its accelerator key) but you could probably use a
> custom cell and override its -setObjectValue: method to parse your
> string and then call -setTitle: as appropriate.
>
> --Kyle Sluder
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Cocoa bindings and reluctance to use NSPopupButon

2008-05-18 Thread David
This is a very interesting topic.I've been writing my first large Cocoa
application. New to objective-C and Cocoa, very experienced with Java.

I started out wanting to learn what facilities are available in this new
platform, partly to try to get a quick feel if it was worth switching to
rather than just writing the app in Java.

So I started with CoreData and was able to get most of the application
working with some trouble.

My first problems were really with Core Animation. I wanted to do what
seemed like a simple transition effect, yet it seemed way more involved than
I wanted to get into. I abandoned that effort after learning a reasonable
amount about Core Animation.

Then I tried to add some optimization to my Core Data application to handle
threading. Whoa. Big catastrophe. Found out that Core Data and bindings are
NOT threadsafe. I had taken it for granted that they were threadsafe. The
hoops that are required to use it in a multi-threaded environment are way
more involved than I was willing to invest in. And I realized as a result
that I was very much using the wrong tool for the job. Core data is too big,
too heavy weight for what was really a simple outline view requirement.

So, I backed down to use bindings. Bindings are working pretty well for
me... until

Seems simple. I want to use a NSButtonCell in the first column of the
outline view. Again this seems to me to be the typical, in almost all cases,
use of a NSButtonCell in an outline view. Yet it seems like I've asked it to
make Martians. Too obscure. If I could find out what the message exchanges
are, it shouldn't be difficult. But a combination of minimal and hard to
find documentation, classes with unpublished interfaces and closed source
make it difficult for those not in the know.

So, I'm realizing that maybe its more reasonable to back down to just using
a data source, target/action and delegates.

I'm still having trouble understanding the delegate signatures when they
throw in some (id) types, I'm not sure what data types are expected.

In anycase, I started with the highest level facilities expressly because
I'm a newbie. Coredata and in turn bindings, seemed simple to configure and
use. I didn't have to learn all the underlying gorp. Sadly that doesn't seem
to be the case. It reminds me of trying to understand MFC without knowing
anything about Win32. It helps to know Win32 to see that MFC is simply an OO
wrapper around Win32 to understand some of its awkwardness.

In the end, unfortunately it makes me question if I've made the right choice
writing for Cocoa and Obj-C rather than Java. Much of the value add I saw in
Cocoa, with Core Data, Core Animation, bindings etc. has slowly whittled
away. I'm now fairly comfortable with Obj-C so I'll probably stick it out in
hopes that more value will become apparent over time.

On Sun, May 18, 2008 at 8:03 PM, Erik Buck <[EMAIL PROTECTED]> wrote:

> Johnny Lundy had a difficult time using NSPopupButon along with bindings.
>  The struggles are archived via www.cocoabuilder.com for posterity.  Mr.
> Lundy recently wrote "...I am still very very hesitant to put another
> NSPopUpButton on my interface, because of the complete absence of guidance
> on how to implement the thing, and the many days it took to get a single one
> working, and even now I have no idea why it works..."
>
> Having just now re-read Mr. Lundy's questions and follow-up, I don't think
> he had any problem with NSPopupButton at all.  That makes sense because
> NSPopupButton is not particularly difficult to use.  I think Mr. Lundy's
> struggles were all with "bindings."  Had I been inclined to participate in
> the threads at the time, I would have said the following:
>
> 1) Bindings are an ADVANCED technique that was recently introduced and not
> yet completely documented.  If someone tries to use bindings in a situation
> where he/she doesn't already know how to write the application without
> bindings, it is a mistake to use bindings.
> 2) Bindings exist to _reduce_ the amount of Controller code needed when the
> Model View Controller pattern is used.  Bindings don't eliminate controller
> code and can't handle all Controller responsibilities.
> 3) Bindings appear to be magic, but they are in fact just an abstraction
> that enables reuse in place of commonly re-written controller code.
> 4) Bindings ARE NOT A REPLACEMENT FOR ALL CONTROLLER CODE, and bindings are
> often not the best technique to use.
>
> Mr. Lundy would have been better off writing his controller code explicitly
> and using the established outlet, target and action patterns instead of
> bindings.  Not only would he have achieved complete control over all aspects
> of his application's behavior, he would have gained insight into how, and
> and why bindings work or not.  I find that I hardly ever use bindings in my
> own applications.  I am more comfortable doing things the good old fashion
> way in part because I often want very fine control over appli

XML schema support

2008-05-18 Thread David
Is there a Cocoa package that supports XML schema for either event driven
(SAX like) or tree based (DOM like) XML parsing?
I haven't seen any reference to XML schema for either Cocoa packages other
than a statement saying you can do your own validation.
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSButtonCell in NSOutlineView

2008-05-20 Thread David
I'm still trying to get a NSButtonCell in an NSOutlineView where the button
cell is in the first column, is a checkbox style AND the title of the cell
is set based on the row so that it shows data rather than needing a separate
column for its title.
I've rewritten it from using bindings to using a data source.

I've created a delegate and set it to the NSOutlineView.
I thought that I could set the button state AND title in
outlineView:willDisplayCell:forTableColumn:item:
The documetation says you can modify the passed in cell.
However it is not behaving as advertised.

1) I have two columns, yet this delegate method is only being called for the
first column. Why? And its not being called very frequently. The docs says
this is called right before drawing the cell. That makes it sound like it
should be called very often.

2) Even if I do modify the cell, the title of the cell reverts back to what
it was set to in IB. I can even set the title and retrieve it back. its the
value I set, but when it draws its the value from IB.

What gives?
I have been successful getting this to work by implementing the delegate
method outlineView:dataCellForTableColumn:item:
Any ideas whats going on?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


IB bug in latest beta SDK? Datasource not invoked from NSOutlineView

2008-06-11 Thread David
I don't know if this is a new bug or even a bug at all.
I have an outline view which was bound to a NSTreeController subclass. I've
since removed the binding and have written a controller which implements the
datasource methods. I have set the new controller as the datasource for the
outline view.

The code is the same as another controller I have working with another
outline view.

The controller's datasource methods are never being called. The outline view
doesn't display anything. No errors show up in the log or elsewhere.

It acts as if the datasource has not been set.

Any ideas what maybe wrong? Does IB remember that it was using bindings
somewhere and ignore the datasource setting?

I've even checked in the debugger and it looked like the outlineview new
about the datasource and was pointing to the correct object.

I've tried deleting the outline view and creating a new one. Same with the
controller in IB.

I did have an earlier case where IB's state became inconsistent. I had tried
to add 2 new outlets to a new controller class in IB. It somehow became
confused and was showing those two outlets on all classes in IB. I could not
get rid of them. I had rely in Timemachine (savior!) to retrieve a version
of my XIB file before I had added those outlets.

But whatever I try, I cannot get it to recognize the datasource.

Any ideas appreciated! Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSOutlineView threading problem

2008-06-14 Thread David
I'm having various intermittent problems with NSOutlineView which I can only
presume is somehow caused by my use of a secondary thread to augment the
node tree supplied via a data source.

My assumption has been that I'm not doing anything that should cause
NSOutlineView a problem. I am strictly adding additional nodes to the tree.
I am not removing nor modifying existing trees.

I am using NSMutableArrays to hold the nodes in the tree. One thread is
adding child nodes while the main thread maybe accessing the arrays through
the data source. I find it hard to imagine that NSMutableArray could be
causing the problem.

I cannot figure out what type of scenario could or should cause
NSOutlineView a problem. Any suggestions appreciated. So far I've noticed
three types of errant behavior at random inconsistent times:

1) A crash occurs with a nil pointer deep in the bowels of NSOutlineView
processing. I don't have source, so the stack trace doesn't mean much to me.
I never have even an intermediate state where any property or pointer is
nil. I fully construct the node before adding it to the tree.
2) The view displays the tree. I have code to expand the tree down to a
level of nodes created in the main thread. Sometimes after the view displays
the tree, it suddenly disappears as if some other layer redrew over it. The
outline view itself is still visible where I have it configured to a banded
background.
3) In the main thread, I create a few nodes, then spawn a thread to populate
the deepest node with children. In the main thread I tell the NSOutlineView
to expand the nodes that were created by the main thread, one layer higher
than where the children are being added.
The expanded view sometimes gets messed up. Sometimes it does not display
the last node as expandable even though I have code asking to reload the
nodes added in the main thread, and display the view.

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSOutlineView threading problem

2008-06-15 Thread David
Thanks for the responses. I've SOLVED IT. WooHoo!

What I thought I was doing seems to be working. I am able to run a secondary
thread, adding nodes to the tree I'm displaying in the primary thread. All
problems appear to have been resolved. No need for locking or any other
magic.
I think folks are a little too spooked by Apple saying that Cocoa isn't
thread safe. That doesn't mean you have to avoid threads like the plague.

The problem was that when I was done adding nodes on the 2nd thread, I was
sending a notification. When the notification was received, I was doing a
reloadData and display on the outline view.

I forgot that I was doing that from the secondary thread. That meant the
receiver of the notification was also on the secondary thread. That meant
that I had both threads possibly doing reloads and displays of the same view
at the same time.

THAT, I can understand as being a really bad thing to do.

I used performSelectorOnMainThread to send the notification from the main
thread and voila, problems "appear" to be gone.

Thanks for the responses.

NSLog came to the rescue showing me the timestamp and thread id, showing me
that I was doing things I didn't think I was doing on the secondary thread.



On Sat, Jun 14, 2008 at 10:19 PM, David <[EMAIL PROTECTED]> wrote:

> I'm having various intermittent problems with NSOutlineView which I can
> only presume is somehow caused by my use of a secondary thread to augment
> the node tree supplied via a data source.
>
> My assumption has been that I'm not doing anything that should cause
> NSOutlineView a problem. I am strictly adding additional nodes to the tree.
> I am not removing nor modifying existing trees.
>
> I am using NSMutableArrays to hold the nodes in the tree. One thread is
> adding child nodes while the main thread maybe accessing the arrays through
> the data source. I find it hard to imagine that NSMutableArray could be
> causing the problem.
>
> I cannot figure out what type of scenario could or should cause
> NSOutlineView a problem. Any suggestions appreciated. So far I've noticed
> three types of errant behavior at random inconsistent times:
>
> 1) A crash occurs with a nil pointer deep in the bowels of NSOutlineView
> processing. I don't have source, so the stack trace doesn't mean much to me.
> I never have even an intermediate state where any property or pointer is
> nil. I fully construct the node before adding it to the tree.
> 2) The view displays the tree. I have code to expand the tree down to a
> level of nodes created in the main thread. Sometimes after the view displays
> the tree, it suddenly disappears as if some other layer redrew over it. The
> outline view itself is still visible where I have it configured to a banded
> background.
> 3) In the main thread, I create a few nodes, then spawn a thread to
> populate the deepest node with children. In the main thread I tell the
> NSOutlineView to expand the nodes that were created by the main thread, one
> layer higher than where the children are being added.
> The expanded view sometimes gets messed up. Sometimes it does not display
> the last node as expandable even though I have code asking to reload the
> nodes added in the main thread, and display the view.
>
> Thanks
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSOutlineView threading problem

2008-06-15 Thread David
On Sun, Jun 15, 2008 at 8:46 PM, Bill Bumgarner <[EMAIL PROTECTED]> wrote:

> I would highly recommend that you look long and hard at how are you are
> managing the data structures that are also used by NSOutlineView.  In
> particular, if you are futzing with an NSMutableArray from one thread while
> the AppKit is enumerating it in another, that can be very problematic.   In
> particular, NSMutableArray may effectively realloc() its contents as it
> crosses certain capacity thresholds.  If the other thread happens to be in
> the middle of reading from the old buffer at that time, well... *boom*.
>

Thanks for the good example of a specific threading issue. In my case, the
outlineview is using my code as the data source. I can control how I access
the NSMutableArray. I do not enumerate the array in that code. If I wanted
to be safe, I should be ok putting locking around my use of the array since
I'm the one populating it and I'm the one reading it in behalf of the
outlineview. That should be sufficient. The outlineview doesn't have any
other mystical connection to the arrays other than through my data source.

I'm still having heartburn with some things in Cocoa. I came from the Java
world. I was excited to hear about CoreData and bindings and all this high
power stuff. But I ran into threading issues with core data which made it
not practical for my usecase. And I needed more flexibility than is
documented with bindings. So now I've downshifted to using a data source,
which is similar to the normal approach in Java.

Threading is hard for me to comprehend in the objective-c world. In Java,
threading is powerful and relatively simple to implement with simple
relatively consistent rules and many classes which are thread safe. Cocoa
seems to have thrown in the towel on threading and completely leaves it up
to the developer. This leads to solutions earlier proposed to use
performSelectorOnMainThread. That solution reminds me of the ancient Windows
3.0 days on DOS when there was no real threading support and you had to
perform all operations in little chunks so you could go back to the event
loop and see if a more important event had come in.

Threading is powerful. It doesn't need to be as hard as Cocoa has made it.
Java makes it easy. It reminds me of garbage collection. Never have to think
about it in Java. It just works. But in Cocoa, garbage collection was
finally just implemented. Maybe someday they'll go back and do some basic
thinking about threads and make it easier to write thread safe code using
Cocoa. As it stands its a nightmare if something as trivial as an Array
isn't even thread safe.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSOutlineView threading problem

2008-06-16 Thread David
On Sun, Jun 15, 2008 at 12:03 AM, Jens Alfke <[EMAIL PROTECTED]> wrote
>
> I don't think that's safe. I have seen no assurances that NSOutlineView is
> thread-safe, and in general most AppKit control classes should _not_ be
> accessed from background threads.
>

While I've been investigating this, I have found more documentation on
thread safety issues in the "Threading Programming Guide". I'd read it
before but it helps to re-read. It says that NSView classes ARE thread
safe... to an extent.

NSView

The NSView class is generally thread-safe, with a few exceptions. You should
create, destroy, resize, move, and perform other operations on NSView objects
only from the main thread of an application. Drawing from secondary threads
is thread-safe as long as you bracket drawing calls with calls to
lockFocusIfCanDraw and unlockFocus.

If a secondary thread of an application wants to cause portions of the view
to be redrawn on the main thread, it must not do so using methods like
display, setNeedsDisplay:, setNeedsDisplayInRect:, or setViewsNeedDisplay:.
Instead, it should send a message to the main thread or call those methods
using the performSelectorOnMainThread: method instead.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSOutlineView threading problem

2008-06-16 Thread David
On Mon, Jun 16, 2008 at 1:25 AM, Michael Ash <[EMAIL PROTECTED]> wrote:
>
> I'm not sure how having thread safe arrays would help. If you're
> mutating a collection in one thread while you're accessing it from
> another then you will have trouble no matter what happens.
>
> Take this example. The outline view asks you how many items there are.
> You say 3. Now your background thread deletes one. Now your outline
> view asks you for item #3. Your code explodes violently.


Seriously? Folks are so scared of threading can't even imagine how it might
work.
No Java won't explode in that scenario with a Vector. In that scenario, when
the second thread goes to retrieve the item that is no longer there, it
behaves predictably, as documented. In this scenario the vector no longer
has item #3, it throws an ArrayIndexOutOfBoundsException. Your code then
needs to deal with this, but it doesn't "explode".


>
>
> Handling this properly really requires a whole new API. You need a
> concept of transactions, or views on the data, or explicit locking of
> the data structures. Simply making NSMutableArray thread safe gives
> you essentially nothing, it just moves the problem around.
>
> Essentially thats what making it thread safe does... lock critical data
structures. So in the vector example, methods are synchronized so that
critical internal structures can't be modified and read at the same time. It
can be argued that you can accomplish the same thing externally in the
developers code, but it leads to wild fears as mentioned earlier in this
thread that no amount of locking can protect you from using non-thread safe
classes in Cocoa. That fear should be alleviated with better descriptions
from Apple of what is necessary to make their classes thread safe or by
providing some option on the classes to enable thread safe behavior.
If the argument against basic thread safety is performance... then make it
an option.
If the argument is that thread safety requires higher level semantics, such
as transactions which can only be implemented in the application... then
Apple should do a better job documenting how to make them tread safe so that
people don't imagine wild scenarios which locking cannot protect against.

Writing code which effectively uses threads in a safe manner is clearly more
complex and requires careful thinking. But at least in Java you can predict
behavior because thread safe classes are available, and because the source
is available to remove any ambiguity on what might actually be taking place.
Apple's lack of source, lack of documentation and providing too few or too
restrictive guidelines makes it more dangerous in the Cocoa world that it
should be.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Gradient panel

2008-10-31 Thread David
Is there an easy way to instantiate a Cocoa panel with a gradient background?

Are there any code samples?

Is NSGradient the key? Any examples of how you hook this in with a
panel or window?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Crash in NSFileManager

2008-11-08 Thread David
I'm trying to understand a crash log a customer sent me.
Some sections that seem of interest are included at the end of this note.

This is a universal application using GC on Leopard. If I'm reading it
correctly, it looks like the application was being run on a PowerPC
machine with Leopard.

My application is invoking NSFileManager copyPath:toPath:handler:
It is possible that the user picked some weird value for toPath but it
must exist because they picked it using NSOpenPanel.

How or why can this be causing a crash? Especially inside
NSFIleManager dealing with retain in a GC application?

Is this a Cocoa bug? Are there things I can do to prevent this crash?

Are there other things I should be looking at in the crash log to help
figure out what may have gone wrong?

Thanks


Code Type:   PPC (Native)
Parent Process:  launchd [119]

OS Version:  Mac OS X 10.5.5 (9F33)
Report Version:  6

Exception Type:  EXC_BAD_ACCESS (SIGBUS)
Exception Codes: KERN_PROTECTION_FAILURE at 0x0005
Crashed Thread:  10

Application Specific Information:
objc[8909]: garbage collection is ON

Thread 10 Crashed:
0   com.apple.CoreFoundation0x9069ebd0 __CFTypeCollectionRetain + 76
1   com.apple.CoreFoundation0x906709cc CFDictionaryAddValue + 684
2   com.apple.CoreFoundation0x90670f4c CFDictionaryCreate + 104
3   com.apple.Foundation0x921a2458 -[NSFileManager
_replicatePath:atPath:operation:fileMap:handler:] + 280
4   com.apple.Foundation0x921a2318 -[NSFileManager
copyPath:toPath:handler:] + 220
5   ...oadreachsoftware.archiveMac  0x8318 -[RestoreController
copyFiles:] + 1212
6   com.apple.Foundation0x920ecb78 __NSThread__main__ + 1004
7   libSystem.B.dylib   0x90e21658 _pthread_start + 316

Thread 10 crashed with PPC Thread State 32:
  srr0: 0x9069ebd0  srr1: 0x0200f030   dar: 0x0005 dsisr: 0x4000
r0: 0xa0029174r1: 0xf048fd00r2: 0xa002eb8cr3: 0xa0029174
r4: 0xr5: 0xr6: 0x50a05000r7: 0x50a05000
r8: 0x50a05000r9: 0x0100   r10: 0x0003   r11: 0xa0029fc0
   r12: 0x9069eb84   r13: 0x   r14: 0x   r15: 0x
   r16: 0x010615c0   r17: 0x   r18: 0x   r19: 0x
   r20: 0x013834d0   r21: 0x   r22: 0x01020250   r23: 0x010fe9f0
   r24: 0x01020250   r25: 0xf048fe80   r26: 0xa0029174   r27: 0xa024e030
   r28: 0x   r29: 0xa024e030   r30: 0x   r31: 0x9069eb8c
cr: 0x28002422   xer: 0xlr: 0x9069eb8c   ctr: 0x9069eb84
vrsave: 0x
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Crash in NSFileManager

2008-11-08 Thread David
I am using NSFileManager on a secondary thread. I am using the defaultManager.

But during this processing its hard to imagine how the primary thread
could possibly be using the defaultManager.

Isn't the potential issue with NSFileManager that having two threads
use it at the same time can cause problems. If only one thread uses
it, that shouldn't cause a problem should it, even if its the
secondary thread?

I never cease to be amazed at how unthread safe Cocoa is.

Stepping back... what I'm trying to do is copy a mess of files which
is time consuming, while allowing the user to cancel. Currently a put
up a window showing a progress indicator and allowing them to cancel.
If they cancel I set the cancel flag for the background thread.

What is the best design approach in Cocoa for this type of scenario?

Should I avoid using a background thread and do all the processing via
the run loop? I assume I'd then chunk the processing so that I copy
one file at a time in some method invoked off the run loop, while
allowing the UI to continue to run and cancel, setting some flag I
check.

If this is the preferred way to implement it, what is the best way to
send a message to the run loop. Two ways that I've found so far are
to:
1. use performSelectorOnMainThread or performSelector:delay:
2. Send a notification. When I process the notification, I copy the
file and send myself another notification.

Thanks for the suggestions and info.

On Sat, Nov 8, 2008 at 4:01 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote:
>
> On Nov 8, 2008, at 11:57 AM, David wrote:
>
>> My application is invoking NSFileManager copyPath:toPath:handler:
>> It is possible that the user picked some weird value for toPath but it
>> must exist because they picked it using NSOpenPanel.
>>
>> How or why can this be causing a crash? Especially inside
>> NSFIleManager dealing with retain in a GC application?
>
> I notice you're crashing on thread 10.  Do you instantiate a new
> NSFileManager instance with alloc/init per thread?  Using +[NSFileManager
> defaultManager] from a background thread will cause problems (and note that
> NSFileManager alloc/init doesn't work properly on 10.4 and earlier).
>
> --
> Adam
>
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


How to write a remote control app for Mac

2008-11-10 Thread David
Hello,
Can someone point me to general documentation that would give me an
idea how to write a remote control application for the Mac.

The hardest part seem to be how to capture what's currently on the
screen and when it changes.

I have no idea where to look. Is it even possible to do this while
using public APIs?

I've seen a variety of other programs which must do this, including
VNC, but I haven't found source for any yet that might give a clue.

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Stop NSFileManager copyFile in progress? Can you kill a thread?

2008-11-10 Thread David
I have NSFIleManager copying files in a secondary thread. The user can
select to cancel the copy.
Is there a way to force NSFileManager to stop copying a file? The
files could be of arbitrary size. A large file could take quite a
while to end. I currently check if the thread has been cancelled
between files, but I can't figure out how to stop it if its in the
middle of copying one file.

Is there a way to make NSFileManager stop a copy operation?
Is there a way to forcibly kill a thread and thereby stop NSFileManager?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Help mangling my server URL

2008-11-13 Thread David
I'm setting up help for my application to have priority for a server
copy. In Help Indexer I've specified my remote root as
http://foo/help/1.0/ and told it to prefer network files to local
files.

When I run the application and try to look at help it says that
"/help/1.0index.html" could not be found. It should be looking for
/help/1.0/index.html. Why did it mangle the name?

Any ideas appreciated.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Does HELP cache source location?

2008-11-13 Thread David
I'm getting really wierd results that make me think the Help system is
caching its source location somewhere. I changed the URL used in Help
Indexer for a network location for help. Sometimes the changes seems
to take effect and often it doesn't. Is it stored in preferences? Does
Help remember across invocations of an application?

I'm originally had http://foo/help. No complaints, but it didn't read anything.
Then switched to using http://foo/help/1.0

I uploaded my content. Now it complains that it can't find,
http://foo/help/1.0index.html. What happened to the directory
delimiter between 1.0 and index.html?

So I added a / at the end of the root URL, http://foo/help/1.0/
No change, same error.

I changed it to http://foo/help1.0/ and I still got an error about
http://foo/help/1.0index.html even though that wasn't the path
anymore.

Now I'm getting weird results where sometimes it complains, and
sometimes it shows the local page.

I need more clarity on what the help system is doing. This black box
magic stuff is ok if it works, but when it doesn't its a HUGE waste of
time.

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does HELP cache source location?

2008-11-13 Thread David
I've removed all references to http://foo/help/1.0 and still it
complains that the url can't be found.

Where is it getting this URL from? I've erased my application's
preferences plist. I've rebooted the whole machine. I've scanned my
project directory for this string even in binary files. I've checked
the helpindex file.

IT IS NOT THERE.

Where is it coming from? Where does Mac help pick this stuff up from?

The "Apple Help Programming Guide" says that help will show up in the
"Library" menu. Library menu of what application? I don't see a
library menu and I don't see it show up.

I'm running Leopard.

On Thu, Nov 13, 2008 at 12:00 PM, David <[EMAIL PROTECTED]> wrote:
> I'm getting really wierd results that make me think the Help system is
> caching its source location somewhere. I changed the URL used in Help
> Indexer for a network location for help. Sometimes the changes seems
> to take effect and often it doesn't. Is it stored in preferences? Does
> Help remember across invocations of an application?
>
> I'm originally had http://foo/help. No complaints, but it didn't read 
> anything.
> Then switched to using http://foo/help/1.0
>
> I uploaded my content. Now it complains that it can't find,
> http://foo/help/1.0index.html. What happened to the directory
> delimiter between 1.0 and index.html?
>
> So I added a / at the end of the root URL, http://foo/help/1.0/
> No change, same error.
>
> I changed it to http://foo/help1.0/ and I still got an error about
> http://foo/help/1.0index.html even though that wasn't the path
> anymore.
>
> Now I'm getting weird results where sometimes it complains, and
> sometimes it shows the local page.
>
> I need more clarity on what the help system is doing. This black box
> magic stuff is ok if it works, but when it doesn't its a HUGE waste of
> time.
>
> Thanks
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does HELP cache source location?

2008-11-13 Thread David
For the benefit of others who may run across this horrible Help design...

I was trying to create help for my application. Used Help Indexer to
give it a remote root url to use overriding local help.

When I first put in the URL, I did it in the form, http://foo/help/1.0

Little did I know that Help does a non-intelligent concatenation of
the URL with the path in the help. This results in the help viewer
looking for http://foo/help/1.0index.html.

Seems very simple right? Just add the / at the end. How hard could that be...

Well turns out that this value gets cached. I've wasted an entire day
because of a lack of transparency regarding what the help system does.

I have to scan the entire file system to figure out where this was
being stored. Turns out it was being cached in
~/Library/Caches/com.apple.helpui/

I erased the application's help cache directory and suddenly it FINALLY worked.

On Thu, Nov 13, 2008 at 12:00 PM, David <[EMAIL PROTECTED]> wrote:
> I'm getting really wierd results that make me think the Help system is
> caching its source location somewhere. I changed the URL used in Help
> Indexer for a network location for help. Sometimes the changes seems
> to take effect and often it doesn't. Is it stored in preferences? Does
> Help remember across invocations of an application?
>
> I'm originally had http://foo/help. No complaints, but it didn't read 
> anything.
> Then switched to using http://foo/help/1.0
>
> I uploaded my content. Now it complains that it can't find,
> http://foo/help/1.0index.html. What happened to the directory
> delimiter between 1.0 and index.html?
>
> So I added a / at the end of the root URL, http://foo/help/1.0/
> No change, same error.
>
> I changed it to http://foo/help1.0/ and I still got an error about
> http://foo/help/1.0index.html even though that wasn't the path
> anymore.
>
> Now I'm getting weird results where sometimes it complains, and
> sometimes it shows the local page.
>
> I need more clarity on what the help system is doing. This black box
> magic stuff is ok if it works, but when it doesn't its a HUGE waste of
> time.
>
> Thanks
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does HELP cache source location?

2008-11-13 Thread David
I take it back. Its not working. Its acting even weirder.

For a file that's missing locally... it works. It obtains it from the
web at the /help/1.0/file.html location.

But for files which ARE present locally, it fails. I get a message such as:

"Multiple Choices
The document you requested (/htlp/1.0file.html) could not be found on
this server. However, we found documents with names similar to the one
you requested.

Available document:
-  /help/1.0 (common basename)"

And the /help/1.0 is a link. If I follow it, I can then access all the
server based files.

I'm at wits end. I cannot figure this beast out.

Can anyone provide any guidance or pointers. Is there some other
mailing list where folks know more about this subsystem?

Again this is on Leopard which apparently has changed the help system.

On Thu, Nov 13, 2008 at 4:23 PM, David <[EMAIL PROTECTED]> wrote:
> For the benefit of others who may run across this horrible Help design...
>
> I was trying to create help for my application. Used Help Indexer to
> give it a remote root url to use overriding local help.
>
> When I first put in the URL, I did it in the form, http://foo/help/1.0
>
> Little did I know that Help does a non-intelligent concatenation of
> the URL with the path in the help. This results in the help viewer
> looking for http://foo/help/1.0index.html.
>
> Seems very simple right? Just add the / at the end. How hard could that be...
>
> Well turns out that this value gets cached. I've wasted an entire day
> because of a lack of transparency regarding what the help system does.
>
> I have to scan the entire file system to figure out where this was
> being stored. Turns out it was being cached in
> ~/Library/Caches/com.apple.helpui/
>
> I erased the application's help cache directory and suddenly it FINALLY 
> worked.
>
> On Thu, Nov 13, 2008 at 12:00 PM, David <[EMAIL PROTECTED]> wrote:
>> I'm getting really wierd results that make me think the Help system is
>> caching its source location somewhere. I changed the URL used in Help
>> Indexer for a network location for help. Sometimes the changes seems
>> to take effect and often it doesn't. Is it stored in preferences? Does
>> Help remember across invocations of an application?
>>
>> I'm originally had http://foo/help. No complaints, but it didn't read 
>> anything.
>> Then switched to using http://foo/help/1.0
>>
>> I uploaded my content. Now it complains that it can't find,
>> http://foo/help/1.0index.html. What happened to the directory
>> delimiter between 1.0 and index.html?
>>
>> So I added a / at the end of the root URL, http://foo/help/1.0/
>> No change, same error.
>>
>> I changed it to http://foo/help1.0/ and I still got an error about
>> http://foo/help/1.0index.html even though that wasn't the path
>> anymore.
>>
>> Now I'm getting weird results where sometimes it complains, and
>> sometimes it shows the local page.
>>
>> I need more clarity on what the help system is doing. This black box
>> magic stuff is ok if it works, but when it doesn't its a HUGE waste of
>> time.
>>
>> Thanks
>>
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does HELP cache source location?

2008-11-13 Thread David
In the message, it should have read, (/help/1.0file.html)

On Thu, Nov 13, 2008 at 5:16 PM, David <[EMAIL PROTECTED]> wrote:
> I take it back. Its not working. Its acting even weirder.
>
> For a file that's missing locally... it works. It obtains it from the
> web at the /help/1.0/file.html location.
>
> But for files which ARE present locally, it fails. I get a message such as:
>
> "Multiple Choices
> The document you requested (/htlp/1.0file.html) could not be found on
> this server. However, we found documents with names similar to the one
> you requested.
>
> Available document:
> -  /help/1.0 (common basename)"
>
> And the /help/1.0 is a link. If I follow it, I can then access all the
> server based files.
>
> I'm at wits end. I cannot figure this beast out.
>
> Can anyone provide any guidance or pointers. Is there some other
> mailing list where folks know more about this subsystem?
>
> Again this is on Leopard which apparently has changed the help system.
>
> On Thu, Nov 13, 2008 at 4:23 PM, David <[EMAIL PROTECTED]> wrote:
>> For the benefit of others who may run across this horrible Help design...
>>
>> I was trying to create help for my application. Used Help Indexer to
>> give it a remote root url to use overriding local help.
>>
>> When I first put in the URL, I did it in the form, http://foo/help/1.0
>>
>> Little did I know that Help does a non-intelligent concatenation of
>> the URL with the path in the help. This results in the help viewer
>> looking for http://foo/help/1.0index.html.
>>
>> Seems very simple right? Just add the / at the end. How hard could that be...
>>
>> Well turns out that this value gets cached. I've wasted an entire day
>> because of a lack of transparency regarding what the help system does.
>>
>> I have to scan the entire file system to figure out where this was
>> being stored. Turns out it was being cached in
>> ~/Library/Caches/com.apple.helpui/
>>
>> I erased the application's help cache directory and suddenly it FINALLY 
>> worked.
>>
>> On Thu, Nov 13, 2008 at 12:00 PM, David <[EMAIL PROTECTED]> wrote:
>>> I'm getting really wierd results that make me think the Help system is
>>> caching its source location somewhere. I changed the URL used in Help
>>> Indexer for a network location for help. Sometimes the changes seems
>>> to take effect and often it doesn't. Is it stored in preferences? Does
>>> Help remember across invocations of an application?
>>>
>>> I'm originally had http://foo/help. No complaints, but it didn't read 
>>> anything.
>>> Then switched to using http://foo/help/1.0
>>>
>>> I uploaded my content. Now it complains that it can't find,
>>> http://foo/help/1.0index.html. What happened to the directory
>>> delimiter between 1.0 and index.html?
>>>
>>> So I added a / at the end of the root URL, http://foo/help/1.0/
>>> No change, same error.
>>>
>>> I changed it to http://foo/help1.0/ and I still got an error about
>>> http://foo/help/1.0index.html even though that wasn't the path
>>> anymore.
>>>
>>> Now I'm getting weird results where sometimes it complains, and
>>> sometimes it shows the local page.
>>>
>>> I need more clarity on what the help system is doing. This black box
>>> magic stuff is ok if it works, but when it doesn't its a HUGE waste of
>>> time.
>>>
>>> Thanks
>>>
>>
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


How to extract individual icons from icns file?

2008-12-04 Thread David
Is there a tool available to extract individual icons from an icns
file? In particular the smaller ones. I've tried several tools but
none of them work with the 16x16 size. I've seen Linux and Windows
tools but no Mac tools. How can that be. Is there a better place for
me to ask this question?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


How to obtain icon displayed by Finder for a file

2009-01-07 Thread David
Hello,Is there a way to obtain the icon that finder uses to display for a
file system object? Such things as the folder icon for folders, PDF icon for
pdfs etc.

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: How to obtain icon displayed by Finder for a file

2009-01-07 Thread David
Great! Thanks for the info. I hoped it was something simple.
Next question though... how do I set the icon (image) for a 1st column of an
outline view and have it show text as well?

I found an example using NSBrowserCell but that doesn't seem to work in an
outline view. I can't find any other cell which seems to support both an
image and text. Does that mean I need to subclass and create my own?



On Wed, Jan 7, 2009 at 4:49 PM, Jelle De Laender wrote:

> Did you try
>
> - (NSImage *)iconForFile:(NSString *)*fullPath*
> from NSWorkSpace?
> *
> *
>
>  CodingMammoth
> Jelle De Laender
> i...@codingmammoth.com
>
>
>
> On 07 Jan 2009, at 22:42, David wrote:
>
> Hello,Is there a way to obtain the icon that finder uses to display for a
> file system object? Such things as the folder icon for folders, PDF icon
> for
> pdfs etc.
>
> 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/info%40codingmammoth.com
>
> This email sent to i...@codingmammoth.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 obtain icon displayed by Finder for a file

2009-01-07 Thread David
I must complain again. Cocoa does not have a clean well designed object
model. It seems haphazard. Someone needed a function here, but not there.
Apple doesn't go back and look at making general purpose classes and
methods.
Some of the cell classes seem very specialized. I had assumed that
NSTextFieldCell could display an icon. Frequently there are outline views of
files which display icons and names, yet there is no simple class which
implements this functionality. Instead everyone needs to write their own
with inconsistent behavior.

I've been able to get NSBrowserCell to work somewhat by setting
setLeaf:TRUE. However, now I get the icon smashed up right next to the
disclosure triangle. There again, there are no basic controls to add some
spacing. Argh.

Thanks for the responses. I guess I'll have to bail on the NSBrowserCell and
write my own NSCell subclass unless I can come up with a way to add some
spacing.

On Wed, Jan 7, 2009 at 6:03 PM, Rob Rix  wrote:

> Either make your own cell class, or use two columns for that. I'd recommend
> the latter due to simplicity, but it may not give you the look you're going
> for.
>
> Sincerely,
> Rob
>
>
> On 7-Jan-09, at 5:36 PM, David wrote:
>
>  Great! Thanks for the info. I hoped it was something simple.
>> Next question though... how do I set the icon (image) for a 1st column of
>> an
>> outline view and have it show text as well?
>>
>> I found an example using NSBrowserCell but that doesn't seem to work in an
>> outline view. I can't find any other cell which seems to support both an
>> image and text. Does that mean I need to subclass and create my own?
>>
>>
>>
>> On Wed, Jan 7, 2009 at 4:49 PM, Jelle De Laender > >wrote:
>>
>>  Did you try
>>>
>>> - (NSImage *)iconForFile:(NSString *)*fullPath*
>>> from NSWorkSpace?
>>> *
>>> *
>>>
>>> CodingMammoth
>>> Jelle De Laender
>>> i...@codingmammoth.com
>>>
>>>
>>>
>>> On 07 Jan 2009, at 22:42, David wrote:
>>>
>>> Hello,Is there a way to obtain the icon that finder uses to display for a
>>> file system object? Such things as the folder icon for folders, PDF icon
>>> for
>>> pdfs etc.
>>>
>>> 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/info%40codingmammoth.com
>>>
>>> This email sent to i...@codingmammoth.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/rix.rob%40gmail.com
>>
>> This email sent to rix@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: How to obtain icon displayed by Finder for a file

2009-01-07 Thread David
Amazingly difficult, but I have it working almost 2 different ways. I
created my own ImageAndTextCell class and handle my own drawing based on
some code from Dave Blanton.
I've also tried the NSAttributedString since that sounded potentially
cleaner, more powerful and generally useful.

Argh.
So I go through some amazingly convoluted steps to create the string, partly
because of inconsistency of when you can or cannot append a string.

Now I appear to be having a problem with the baseline. By default, the icon
looks fine, but the text is a few pixels too low and the bottom of letters
gets cut off. If I try to raise it by messing with the
NSBaselineOffsetAttributeName, then the icon gets off center vertically. I
tried setting ranges on the attribute specific to the string without the
attachment but it didn't work. Changes are always propogated to the icon, or
at least I can't figure out how to isolate it.

Here's my code so far. This is in my datasource delegate where I return a
value for a cell.

NSTextAttachment *ta = [[NSTextAttachment alloc]init];

NSTextAttachmentCell *tac = [[NSTextAttachmentCell alloc]init];

NSImage *image = [[NSWorkspace sharedWorkspace]iconForFile:[node pathName]];

[image setScalesWhenResized:TRUE];

NSSize mySize;

mySize.width=16;

mySize.height=16;

[image setSize:mySize];

[tac setImage:image];

[ta setAttachmentCell:tac];

NSAttributedString *as = [NSAttributedString attributedStringWithAttachment
:ta];

NSMutableAttributedString *mas = [[NSMutableAttributedString alloc]
initWithAttributedString:as];

 NSString *name = [@" " stringByAppendingString:[node name]];

 NSMutableAttributedString *attribName = [[NSMutableAttributedString alloc]
initWithString:name];

[mas appendAttributedString:attribName];

NSRange range;

range.location = 0;

range.length = [mas length];

 [mas addAttribute:NSBaselineOffsetAttributeName value:[NSNumber
numberWithFloat: -4.0] range:range];

result = mas;

Thanks


On Wed, Jan 7, 2009 at 9:03 PM, Michael Ash  wrote:

> On Wed, Jan 7, 2009 at 7:39 PM, David  wrote:
> > I must complain again. Cocoa does not have a clean well designed object
> > model. It seems haphazard. Someone needed a function here, but not there.
> > Apple doesn't go back and look at making general purpose classes and
> > methods.
> > Some of the cell classes seem very specialized. I had assumed that
> > NSTextFieldCell could display an icon. Frequently there are outline views
> of
> > files which display icons and names, yet there is no simple class which
> > implements this functionality. Instead everyone needs to write their own
> > with inconsistent behavior.
> >
> > I've been able to get NSBrowserCell to work somewhat by setting
> > setLeaf:TRUE. However, now I get the icon smashed up right next to the
> > disclosure triangle. There again, there are no basic controls to add some
> > spacing. Argh.
> >
> > Thanks for the responses. I guess I'll have to bail on the NSBrowserCell
> and
> > write my own NSCell subclass unless I can come up with a way to add some
> > spacing.
>
> Cocoa can't very well do *everything* for you. If it did, we'd all be
> out of a job, for one Personally I find that Cocoa provides plenty
> of facilities and building blocks for more. Just because it doesn't do
> what you want in this one particular case certainly doesn't make it
> generally deficient.
>
> However in this case Cocoa is able to do what you want, using built-in
> features and nothing more. Simply create an NSAttributedString
> containing your image and your text, and using the available
> attributes to control horizontal and vertical spacing. A plain
> NSTextFieldCell can display an NSAttributedString with no
> customization.
>
> Mike
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to enki1...@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: How to obtain icon displayed by Finder for a file

2009-01-08 Thread David
I was thinking using NSAttributedString seems like a more general purpose
solution because they sound powerful and can be used all over the place.
I've used it for HTML which seems like way overkill for this. But I haven't
successfully come up with a string that looks correct, whereas I have been
able to get the ImageAndTextCell approach to work to my satisfaction,
although still convoluted.

On Thu, Jan 8, 2009 at 2:05 AM, Rob Keniger  wrote:

>
> On 08/01/2009, at 3:16 PM, Kyle Sluder wrote:
>
>  I'd disagree.  I'd say that the proper way to do this is to implement
>> a custom NSCell subclass (a la ImageAndTextCell).  This is more in
>> line with the framework: the cell is given an object value, which the
>> cell represents by drawing into a view.  That object value happens to
>> have two valid representations: an image and a textual label.
>> Therefore the cell should draw those two representations.
>>
>
>
> Correct, and Apple's ImageAndTextCell class, which is in the project linked
> from my previous post, does exactly that:
>
> http://developer.apple.com/samplecode/SourceView/
>
> --
> Rob Keniger
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to enki1...@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


What is the best way to copy files

2009-01-10 Thread David
This is sort of a conceptual question.
The broader question is what is the purpose of Cocoa and how does it
relate to Core Foundation and Unix.
The specific question is, what is the best way to copy files. Several
different ways to copy files come to mind including:

Use Cocoa
- NSFileManager copyPath:toPath:handler:
- NSWorkspace performFileOperation:source:destination:files:tag: using
NSWorkspaceCopyOperation
- Manually copy blocks of data using NSFileHandle readDataOfLength:
and writeData:

Using core foundation
- Carbon's file manager. PSFSCopyFileAsync (or sync)

Using unix functions
- read, write

Unix standard C functions
- fread, fwrite

I'm looking for what I think are some fairly common requirements from
a file copy mechanism.
- simple. Why write something if you can reuse.
- support multi-threading so that you can stay responsive to the UI
while copying large files.
- good error handling. To be able to clearly handle and report errors.
- provides ways to control, ie cancel a large file copy in progress.

I didn't think this should be a difficult question, but I haven't
found an answer so far.
I've currently used NSFileManager in my application but have been
disappointed for several reasons:
1. I can't find a reasonable way to cancel a large file copy in progress.
2. The error reporting is very poor. Very little information is
provided on errors which may occur.

So I need to pick something else and would like suggestions on which
approach will provide the needed flexibility.
This also addresses a broader question I have about how Cocoa relates
to Core Foundation, to Unix APIs and even to standard C functions.

I had thought Cocoa was a wrapper for Core Foundation, but
NSFileManager is not a wrapper. There is no equivalent in Core
Foundation, while the Carbon file manager has no equivalent in Cocoa.

Are Unix APIs the best way to go?
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


2 Problems with setAnimationTransition

2009-11-20 Thread David


I'm having two problems with UIView setAnimationTransition.  I have a  
single image that I am flipping (a UIImageVIew).  The effect I am  
aiming for is flipping the image over such that when it is flipped  
over there is a resulting blank (black) space where the image should  
be.  Also, in order for there to be something visible in the second  
half of the animation (when the black back in rotating into place)  
I've added an alpha fade so you can still see the (fading) image until  
the animation is complete.  Here is the code:


- (void)flipView: (UIView *)aView {
aView.transform = (aView.alpha == 1.0)
? CGAffineTransformMake(-1.0, 0.0, 0.0, 1.0, 0.0, 0.0) :  
CGAffineTransformMake(1.0, 0.0, 0.0, 1.0, 0.0, 0.0);

[UIView beginAnimations: @"Flip" context: nil];
[UIView setAnimationDuration: 2.5];
[UIView setAnimationTransition:  
UIViewAnimationTransitionFlipFromRight forView: aView cache: FALSE];

aView.alpha = (aView.alpha == 0.0 ? 1.0 : 0.0);
[UIView commitAnimations];
}

- (void)viewDidAppear: (BOOL)animated {
[self flipView: myUIImageView];
[super viewDidAppear: animated];
}

-(IBAction) viewTouched: (id)sender {
[self flipView: myUIImageView];
}

The image starts off not visible.  (I.e. alpha = 0.0).  The first  
problem I am having is that the first time viewDidAppear gets called  
(when my application launches) there is no flip animation.  The alpha  
fades in (to 1.0) but there is no flip.


The second problem I am having is that when I flip from not visible to  
visible, there is no alpha fade in on the first half of the  
transition.  Which means that nothing visible is occurring.  Going  
from visible to not visible is fine.  There is a very nice alpha fade  
during the second half of the animation.


Your thoughts?

Thanks,
David

___

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

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

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

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


How to write a string to a file

2008-08-18 Thread David
I know it sounds like a basic question, but I've looked and it doesn't seem
as obvious to me as it should.
I want to write out data to a file to describe my tree structure.

I'd like to have a method which appends a string to the end of a text file.

I don't really want to store everything in memory and write out one big
string because it might get quite large.

How are you supposed to do this in Cocoa? Why isn't it more obvious?

I've looked in NSString, NSData, NSFileHandle, NSOutputStream, but I don't
see a simple way to append a string to a file. Can it really be this hard?

NSString doesn't have a method to append to a file, nor a stream, nor
NSData.
And the other classes don't have a method to accept a string.

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to write a string to a file

2008-08-18 Thread David
Thanks for the quick responses. Why isn't this already in NSString?I found
an old reference saying to use [filehandle writeData:[nsstring
dataUsingEncoding:...]]
This seems obtuse. I have been using Cocoa for 6 months and it is not
seeming any more consistent nor powerful than when I started.

I find Cocoa to be inconsistent with random pockets of powerful features
with many areas of spotty coverage of basic methods that I'd expect to be
present.

Some issues:
NSString includes lots of methods to work with paths, URLs, etc. This breaks
encapsulation. It does not seem to be good design for NSString to have this
unique function dealing with paths. That should be in another class.

Basic methods should exist somewhere for writing primitive types to a file.

NSString writeToFile seems like an odd method. Why just this one means to
write in this class? Why such an emphasis on atomic, which seems like such a
complex uncommon algorithm? Why is there no option to append to a file?

Similarly, NSFileHandle and NSOutputStream could have methods to write
primitive types, or at least NSString.

NSOutputStream provides the following method,
- (NSInteger)write:(const uint8_t *)*buffer* maxLength:(NSUInteger)*length*
Why doesn't it use NSData? What's the point of having the NSData construct
if it isn't even used?

I could go on, but I should stop. The method name makeKeyAndOrderFront
amazes me on NSWindow. It took me way too long to find that. It is my
current winner for least discoverable name.

On Mon, Aug 18, 2008 at 11:00 PM, David <[EMAIL PROTECTED]> wrote:

> I know it sounds like a basic question, but I've looked and it doesn't seem
> as obvious to me as it should.
> I want to write out data to a file to describe my tree structure.
>
> I'd like to have a method which appends a string to the end of a text file.
>
> I don't really want to store everything in memory and write out one big
> string because it might get quite large.
>
> How are you supposed to do this in Cocoa? Why isn't it more obvious?
>
> I've looked in NSString, NSData, NSFileHandle, NSOutputStream, but I don't
> see a simple way to append a string to a file. Can it really be this hard?
>
> NSString doesn't have a method to append to a file, nor a stream, nor
> NSData.
> And the other classes don't have a method to accept a string.
>
> Thanks
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Crash in garbage collection, NSOpenPanel

2008-08-27 Thread David
Hello,Sometimes my application crashes when I go to run an NSOpenPanel. The
app is using garbage collection and runs on Leopard only.

I found the following thread
http://www.cocoabuilder.com/archive/message/cocoa/2008/5/28/208589 which
makes it look like a known and unresolved issue with NSOpenPanel. The
thread alludes to a workaround something about preferences but I couldn't
understand what they are saying to do as a work around nor the cause.

Does anyone know how to work around or prevent this crash? I had been hoping
it was an artifact of running the debugger but its looking much more serious
than that.

The stack trace includes:
__CFTypeCollectionRelease
__CFDictionaryDeallocate
-[NSCFDictionary finalize]
finalizeOneObject
foreach_block_do
batchFinalize
batchFinalizeOnTwoThreads
auto_collect_internal
auto_collection_thread
_pthread_start
thread_start
___

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

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

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

This email sent to [EMAIL PROTECTED]


Crash in DRBurnSetupPanel

2008-09-08 Thread David
I'm sometimes getting a crash in DRBurnSetupPanel. Its when the panel is
starting up and a device is loading media. Does anyone know if there's a
workaround? Could I be doing something to cause this?
Here's a back trace

#0  0x90ed46e8 in objc_msgSend ()

#1  0x00175701 in NotificationCallback ()

#2  0x0014e764 in DRNotificationCenterObject::AddObserver ()

#3  0x00175341 in _DRNotificationCenterAddObserver ()

#4  0x00175218 in -[DRNotificationCenter addObserver:selector:name:object:]
()

#5  0x0004c483 in -[DRDeviceChooserCell setFilter:] ()

#6  0x0004bfc6 in -[DRDeviceChooserCell init] ()

#7  0x968b8b4b in -[NSControl initWithFrame:] ()

#8  0x968cf16e in -[NSCustomView nibInstantiate] ()

#9  0x968b0ff1 in -[NSIBObjectData instantiateObject:] ()

#10 0x968b0712 in -[NSIBObjectData nibInstantiateWithOwner:topLevelObjects:]
()

#11 0x968a6e12 in loadNib ()

#12 0x968a6774 in +[NSBundle(NSNibLoading)
_loadNibFile:nameTable:withZone:ownerBundle:] ()

#13 0x968a63b7 in +[NSBundle(NSNibLoading)
loadNibFile:externalNameTable:withZone:] ()

#14 0x0004bd1c in _DRUILoadNibPanelFromBundle ()

#15 0x0004b816 in -[DRSetupPanel initWithNibName:] ()

#16 0x0004b63c in -[DRBurnSetupPanel initWithNibName:] ()

#17 0x0004b5fa in -[DRBurnSetupPanel init] ()

#18 0x0004b5b8 in +[DRBurnSetupPanel setupPanel] ()

...
___

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

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

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

This email sent to [EMAIL PROTECTED]


How do create a DMG with license agreement?

2008-09-08 Thread David
Hello,
I've seen many applications present a license agreement before their
DMG can be mounted. I read in the "Software Delivery Guide" about a
SLA for UDIF SDK. So I got the SDK. But its dated from 2003. Within
its documentation it says you need to use ResEdit and gives a location
of
http://download.info.apple.com/Apple_Support_Area/Apple_Software_Updates/English-North_American/Macintosh/Utilities/ResEdit_2.1.3.sea.bin.

However that turns out to be a classic application which doesn't run
on Intel machines.

Am I looking in the right place on how to add a license agreement to a DMG?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Crash in NSOpenPanel. Garbage collection thread

2008-09-08 Thread David
I've found other reports of NSOpenPanel crashing with garbage collection,
but I haven't found a workaround.
Does anyone know what scenarios cause this? It appears random or timing
dependent, but is a serious issue.

It happens in my application sometimes frequently, sometimes not.

With this current crash, the NSOpenPanel showed up except without listing
any files, then it crashed.

Here's the stack trace for the offending thread,

#0  0x94ea4cf0 in __CFTypeCollectionRelease ()

#1  0x94e71d49 in __CFDictionaryDeallocate ()

#2  0x913a42d1 in -[NSCFDictionary finalize] ()

#3  0x90ec9976 in finalizeOneObject ()

#4  0x9264ddab in foreach_block_do ()

#5  0x90ec9b3b in batchFinalize ()

#6  0x90ec9e02 in batchFinalizeOnTwoThreads ()

#7  0x9264ef0e in auto_collect_internal ()

#8  0x9264fb8f in auto_collection_thread ()

#9  0x962206f5 in _pthread_start ()

#10 0x962205b2 in thread_start ()


Here are all the threads editing out my application specific layers


Thread 12 (process 10123 thread 0xa17b):

#0  0x961ef506 in semaphore_timedwait_signal_trap ()

#1  0x9622184f in _pthread_cond_wait ()

#2  0x962230d3 in pthread_cond_timedwait_relative_np ()

#3  0x92c601ba in TSWaitOnConditionTimedRelative ()

#4  0x92c80ecc in MPWaitOnQueue ()

#5  0x905e2f24 in TFolderSizeTask::FolderSizeTaskProc ()

#6  0x92c7f463 in PrivateMPEntryPoint ()

#7  0x962206f5 in _pthread_start ()

#8  0x962205b2 in thread_start ()


Thread 11 (process 10123 thread 0xa083):

#0  0x961ef506 in semaphore_timedwait_signal_trap ()

#1  0x9622184f in _pthread_cond_wait ()

#2  0x962230d3 in pthread_cond_timedwait_relative_np ()

#3  0x92c601ba in TSWaitOnConditionTimedRelative ()

#4  0x92c80ecc in MPWaitOnQueue ()

#5  0x905e2f24 in TFolderSizeTask::FolderSizeTaskProc ()

#6  0x92c7f463 in PrivateMPEntryPoint ()

#7  0x962206f5 in _pthread_start ()

#8  0x962205b2 in thread_start ()


Thread 10 (process 10123 thread 0x9b03):

#0  0x9623f5e2 in select$DARWIN_EXTSN ()

#1  0x94ead50f in __CFSocketManager ()

#2  0x962206f5 in _pthread_start ()

#3  0x962205b2 in thread_start ()


Thread 9 (process 10123 thread 0x9403):

#0  0x9621ff66 in kevent ()

#1  0x94e7749f in __monitor_file_descriptor__ ()

#2  0x962206f5 in _pthread_start ()

#3  0x962205b2 in thread_start ()


Thread 8 (process 10123 thread 0x8703):

#0  0x961ef506 in semaphore_timedwait_signal_trap ()

#1  0x9622184f in _pthread_cond_wait ()

#2  0x962230d3 in pthread_cond_timedwait_relative_np ()

#3  0x92c601ba in TSWaitOnConditionTimedRelative ()

#4  0x92c80ecc in MPWaitOnQueue ()

#5  0x905e8901 in TPropertyTask::PropertyTaskProc ()

#6  0x92c7f463 in PrivateMPEntryPoint ()

#7  0x962206f5 in _pthread_start ()

#8  0x962205b2 in thread_start ()


Thread 7 (process 10123 thread 0x7f5b):

#0  0x961f668e in __semwait_signal ()

#1  0x96221986 in _pthread_cond_wait ()

#2  0x9622136d in pthread_cond_wait$UNIX2003 ()

#3  0x92c8124f in TSWaitOnCondition ()

#4  0x92c6018e in TSWaitOnConditionTimedRelative ()

#5  0x92c80ecc in MPWaitOnQueue ()

#6  0x905e0fda in TNodeSyncTask::SyncTaskProc ()

#7  0x92c7f463 in PrivateMPEntryPoint ()

#8  0x962206f5 in _pthread_start ()

#9  0x962205b2 in thread_start ()


Thread 6 (process 10123 thread 0x7003):

#0  0x961ef4a6 in mach_msg_trap ()

#1  0x961f6c9c in mach_msg ()

#2  0x94ea20ce in CFRunLoopRunSpecific ()

#3  0x94ea2d54 in CFRunLoopRun ()

#4  0x905d601c in TFSEventsNotificationTask::FSEventsNotificationTaskProc ()

#5  0x92c7f463 in PrivateMPEntryPoint ()

#6  0x962206f5 in _pthread_start ()

#7  0x962205b2 in thread_start ()


Thread 5 (process 10123 thread 0x6b03):

#0  0x961ef4a6 in mach_msg_trap ()

#1  0x961f6c9c in mach_msg ()

#2  0x94ea20ce in CFRunLoopRunSpecific ()

#3  0x94ea2d54 in CFRunLoopRun ()

#4  0x905d5ea3 in TSystemNotificationTask::SystemNotificationTaskProc ()

#5  0x92c7f463 in PrivateMPEntryPoint ()

#6  0x962206f5 in _pthread_start ()

#7  0x962205b2 in thread_start ()


Thread 4 (process 10123 thread 0x640f):

#0  0x961ef506 in semaphore_timedwait_signal_trap ()

#1  0x9622184f in _pthread_cond_wait ()

#2  0x962230d3 in pthread_cond_timedwait_relative_np ()

#3  0x912dbe8c in -[NSCondition waitUntilDate:] ()

#4  0x912dbca0 in -[NSConditionLock lockWhenCondition:beforeDate:] ()

#5  0x912dbc05 in -[NSConditionLock lockWhenCondition:] ()

#6  0x96946470 in -[NSUIHeartBeat _heartBeatThread:] ()

#7  0x91295f1d in -[NSThread main] ()

#8  0x91295ac4 in __NSThread__main__ ()

#9  0x962206f5 in _pthread_start ()

#10 0x962205b2 in thread_start ()


Thread 3 (process 10123 thread 0x5613):

#0  0x961ef4a6 in mach_msg_trap ()

#1  0x961f6c9c in mach_msg ()

#2  0x94ea20ce in CFRunLoopRunSpecific ()

#3  0x94ea2cf8 in CFRunLoopRunInMode ()

#4  0x90d49a32 in CFURLCacheWorkerThread ()

#5  0x962206f5 in _pthread_start ()

#6  0x962205b2 in thread_start ()


Thread 2 (process 10123 thread 0x2903):

#0  0x94ea4cf0 in __CFTypeCollectionRelease ()

#1  0x94e71d49 in __CFDictionaryDeallocate ()

#2  0x913a42d1 in -[N

Re: How do create a DMG with license agreement?

2008-09-08 Thread David
Is it just me or should an Apple operating system facility have a
public API rather than apparently a non-published API?

Are there many things in the Mac world with unpublished APIs where you
have to rely on 3rd party tools to access operating system functions?
Or is the DMG format unique because of some legacy issue?

Thanks

On Mon, Sep 8, 2008 at 6:16 PM, Seth Willits <[EMAIL PROTECTED]> wrote:
> On Sep 8, 2008, at 1:47 PM, Dave Carrigan wrote:
>
>>> Am I looking in the right place on how to add a license agreement to a
>>> DMG?
>>
>> You're looking in the right place, but IMHO, you're better off just
>> forking over $20 for DropDMG, which does it all for you.
>
> http://www.araelium.com/dmgcanvas/
>
>
> --
> 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/enki1711%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: While we're on the subject of DMG's for software distribution...

2008-09-08 Thread David
I'm certainly no expert but...
Application bundles are just directories which some special
characteristics that makes Finder hide the fact that its a directory
to make it look like an application. Finder just looks at any
directory that ends in .app and thinks its an application. It then
looks inside for an application, but in anycase, it doesn't show the
user the directory as a directory.

If the files you need are shipped as part of the application, the
appropriate place to put them is somewhere within the application
bundle (directory).

If the files are added during runtime or after installation, then they
typically go in the user directory in ~/Library/Application
Support/programName.

Some of this is spelled out in "File System Overview",
http://developer.apple.com/documentation/MacOSX/Conceptual/BPFileSystem/BPFileSystem.html

On Mon, Sep 8, 2008 at 11:31 PM, Chris Markle <[EMAIL PROTECTED]> wrote:
> Hi Folks,
>
> (Not super saavy about Mac OS X here so bear with me please...)
>
> On the subject of DMG's... I inherited a software product that
> currently ships using some moldy-oldy version of the Wise installer. I
> think basically all it does is put the application _folder_ into the
> Applications folder. In the application folder I am referring to is
> the application bundle, some PDFs (doc) and a Plugins folder with one
> plugin bundle in it. I think the application expects the plugins to be
> in this specific place i.e., the Plugins folder in the applications
> folder.
>
> I'd prefer to ship this as a DMG... But if I understand DMG-based
> delivery correctly, the idea is that Mac users are used to this and
> "know" to copy the application bundle to the Applications folder. But
> I need the user to copy the application folder (not just the bundle)
> into the Applications folder. otherwise the plugin won't be found and
> life as we know it will cease ;)
>
> Is DMG just a non-starter for this or is there a way with a DMG format
> to someone clue in the user that the folder needs to be copied, not
> just the application bundle.
>
> Thanks in advance...
>
> Chris
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: [moderator] Re: While we're on the subject of DMG's for software distribution...

2008-09-10 Thread David
In my mind, the installer issue is an issue of trust.

Do you trust the "installer" of an application to install the
application in the best interest of the user. Do you trust that the
installer won't install things you don't want. Do you trust that the
installer provides a way to uninstall the application completely when
its done.

The resounding answer to all of these questions is NO. This is one of
the primary reasons why the Windows platform gets a black eye.
Applications typically recklessly install themselves, overwriting
other applications data, installing additional unwanted features deep
into the operating system without the user being told resulting in
spyware, nagware or annoyware under the guise of providing the user
some wonderful feature.

I've worked on many platforms for many years, from Windows to many
varieties of Unix to mainframes.

I believe that the only way to solve this problem of trust is to not
trust the installer.

That means that the operating system provides rigid constraints on
what the installer can do without asking the operating system.

Two options work:
1. Do not allow the application to modify anything that can affect
other applications or the system overall. In my mind this is the
typical Mac OS X approach today doing a manual install. The
application is contained within one directory (bundle). The user can
place that application wherever they want. It does NOT need to be a
priviledged location.

2. If an application must modify the system beyond its own bounds,
then the installer is forced to run within a sandbox controller by the
operating system. The operating system provides an API through which
ANY system modification is done. In this way the operating system can
audit and log any activities the installer is doing. In this way the
operating system can ensure that the operations can be undone to
completely remove the application at a later time. A user could
potentially use the install log to determine if unwanted activities
have occurred.

To emphasize what others have said... if Mac OS X moves away from its
current manual install model, it risks the same installer abuses
common in the WIndows world and one of its primary advantages over
Windows will have been lost.

>From a security perspective, I deride any Mac OS X application which
requires an installer. I have never seen one which allowed me to
install in a non privileged location.

On Wed, Sep 10, 2008 at 9:21 AM, Scott Anguish <[EMAIL PROTECTED]> wrote:
> probably best not to debate this particular aspect of things...
>
> As I said, I'll about getting this clarified in the docs, and a consistent
> message in it.
>
>
> On 10-Sep-08, at 3:40 AM, Charles Srstka wrote:
>
>> On Sep 9, 2008, at 4:26 PM, Bill Cheeseman wrote:
>>
>>> The poster didn't say why he assumes the Software Delivery Guide to be
>>> more
>>> authoritative. The only evidence I'm aware of is that the Software
>>> Delivery
>>> Guide was last updated over two years ago, in July 2006, before Leopard
>>> was
>>> released. The PackageMaker User Guide is a year newer, and it states that
>>> it
>>> applies to Leopard. On that evidence, I'm more inclined to think the
>>> PackageMaker User Guide is authoritative with respect to Leopard.
>>
>> Well, the Software Delivery Guide is, as the name suggests, the guide to
>> how you should deliver software, and is not intended to be a usage manual
>> for any one specific method. The PackageMaker manual is a document
>> describing how to use one specific application for software delivery,
>> written by people who probably *would* like you to use their product. To my
>> mind, it's like the difference between getting polling data from an
>> independent polling site vs. getting data from Obama or McCain's web site.
>>
>> Anyway, if Mac software starts heading back down the road to everything
>> having an installer, the appeal of the Mac platform vs. Windows will be
>> severely diminished in my eyes. Drag and drop puts the user in control -
>> installers put the user at their mercy. Whenever I see an installer that
>> does nothing but put an app in /Applications, I tend to think twice about
>> using that app, because it's often a sign of a poorly thought out product.
>> Often I will send an e-mail to the author complaining about this as well.
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

Help/Unsubscribe/Update your Subscription:
htt

Re: Cocoa-dev Digest, Vol 5, Issue 1598

2008-09-10 Thread David
Dragging an application to "Applications" may seem hard or unusual to
a user the 1st time they ever install an application on the Mac, but
after that its the assumed way to install applications.

Consistency is a big deal. Apple should define and enable some
consistent application installation models. Dragging an application to
"Applications" is fine since that has been the convention and many
applications perform their install in this fashion.

Unfortunately, I think Apple is making this space ripe for confusion
by not providing easy tools nor documentation on how to work with
DMGs. Most applications require acceptance of a license agreement.
Having outdated documentation referring to tools which can no longer
be run adds to the confusion.

If the convention is to manually install by dragging the app to
'Applications', and if the convention is to use a DMG which shows the
application and 'Applications' so you can more easily drag it then
Apple should provide an easy way to create such a DMG.

As far as I understand it, you need to come up with your own graphics
for a custom background, then somehow fiddle with the location of your
application and Applications alias to make it work.


On Wed, Sep 10, 2008 at 10:32 AM, Bill Royds <[EMAIL PROTECTED]> wrote:
>
> On 10-Sep-08, at 04:59 , [EMAIL PROTECTED] wrote:
>
>> Anyway, if Mac software starts heading back down the road to everything
>> having an installer, the appeal of the Mac platform vs. Windows will be
>> severely diminished in my eyes. Drag and drop puts the user in control -
>> installers put the user at their mercy. Whenever I see an installer that
>> does nothing but put an app in /Applications, I tend to think twice about
>> using that app, because it's often a sign of a poorly thought out product.
>> Often I will send an e-mail to the author complaining about this as well.
>
>
> But you are not a typical user so your preferences are not the most
> important.
>
> Most users who want to install software only want to b able to click on the
> downloaded package and have it install.It might ask some questions like
> password or ask whether you want advanced control, but even the concept of
> moving to /Applications is more than most users want to know.
> Windows installers are much easier for naive users to handle than anything
> that requires knowledge of the system structure such as drag and drop to
> /Applications.
>
> Of course, it is still better to have a simple install logic and a bundled
> app that you could drag and drop to /Applications is better than one that
> requires many different steps. probably the double click on an app package
> should just invoke a shell script the\at does
> sudo cp MyApp.app /Applications
>
> with the sudo password prompt in a gui window.
>
>
>
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Menu for multiple document types

2008-09-10 Thread David
What is the convention of the application menu when an application
supports multiple document types?

Should the menu change to show the actions available to the type of
document currently open?

Can the menu show the superset of actions available to each document
type, then disable the actions (but still make them visible) which are
inappropriate for the currently open document?

I don't see any built in support in the document architecture for
changing the menu based on the currently open document type.

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


First responder design question. Are controllers in the chain?

2008-09-11 Thread David
I'm just starting to delve into the first responder chain to handle
menu actions.

My conceptual understanding of MVC is that the controller is the one
who determines what to do with actions. When someone wants to do
something the controller is told by a control in the view, it updates
the model and in turn updates the display.

I've been conceptually thinking of the document as part of the model.

The first responder chain in the document architecture goes through
the view hierarchy and checks the document. It doesn't go through the
controllers. I'm not sure how it would even know about them.

But in any case, the actions that I want the menu to invoke are on my
controllers. I want them invoked in the same way that I have buttons
in the UI which send actions to the controller.

Given that the default first responder chain does NOT include
controllers... architecturally, what is the best approach to get the
actions invoked?

Options include:
1. I can add methods to my Document to forward the messages to the
controller. But this seems to confuse the model and controller. Now
I'd have the model receiving the action, sending it to the controller
which may in turn send it back to the model.
2. Subclass something in the view so that it forwards the message to
the controller. Maybe an NSWindow delegate? I've been trying to avoid
subclassing view classes if I don't need to. So far I haven't had to
subclass any of them.
3. Modify the first responder chain and specifically add one or more
controllers to the chain. Where would be the appropriate place to
modify the first responder chain?

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Release build wrong executable name, but debug build it correct

2008-09-30 Thread David
I changed my applciation name after I created my XCode project. I was
able to change the appropriate values to get the build to generate the
correct new name for the executable.

Except that it only does it for a debug build. For the release build
it reverted back to the old name.

What gives? I can't figure out why its doing this.

Any help greatly appreciated. I can't confidently remember what the
supposed thread of variables is to set the name of the executable.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Release build wrong executable name, but debug build it correct

2008-09-30 Thread David
I was looking under the project properties not under target
properties. Product name was set to the old value.

Thanks!

On Tue, Sep 30, 2008 at 5:16 PM, Mark Dawson <[EMAIL PROTECTED]> wrote:
>
> On Tuesday, September 30, 2008, at 01:09PM, "Nick Zitzmann" <[EMAIL 
> PROTECTED]> wrote:
>>
>>On Sep 30, 2008, at 2:02 PM, David wrote:
>>
>>> Except that it only does it for a debug build. For the release build
>>> it reverted back to the old name.
>>>
>>> What gives? I can't figure out why its doing this.
>>
>>
>>Are you sure you have your product name in sync across configurations?
>>In the target's build tab, if you change the configuration to "all
>>configurations", what happens to the product name?
>>
> I would check 3 places:
> - Under Target Info:
>  (1) Check the "General" name
>  (2) Check the "Build", "Product" name
>
> - Under the Executables section (bottom, left of an Xcode project), check to 
> make sure that it has the correct name.  Usually the "General" name syncs to 
> the "Executable" name, but not always.
>
> Mark
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/enki1711%40gmail.com
>
> This email sent to [EMAIL PROTECTED]
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Universal app fails on PPC.

2008-10-06 Thread David
I'm trying to test my universal app to make sure its really universal.
In finder I did "get info" then selected "run with rosetta". When I do
that the application traps. The console log says,

Exited abnormally: Trace/BPT trap

What does that mean? How can I determine why its not working? Is there
a way to run it in the debugger using rosetta?

I'm including two other frameworks, Sparkle and AquaticPrime. Both of
which I've compiled on my own to make sure settings said its
generating universal output... or at least I think I set that right.

Thanks
___

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

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

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

This email sent to [EMAIL PROTECTED]


Why does toolbar use validation and not enable/disable?

2008-10-08 Thread David
Why does toolbar use validation and not enable/disable like most every
other Cocoa control does? It doesn't seem "consistent".
When does the toolbar call validateToolbarItem?
___

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

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

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

This email sent to [EMAIL PROTECTED]


Where is close/cancel icon used in search field & Safari etc.

2008-10-08 Thread David
Hello,
I'd like to have a button that looks like the close or cancel icon
that is often present in Cocoa applications, but I can't find the
icon. I'm surprised it doesn't show up as a choice in interface
builder.

Some places where this icon shows up includes:
- When you have multiple tabs in Safari, its the X in a circle by the
tab that you use to close the tab.
- In a standard Cocoa search field used in Finder, if you enter
something and want to cancel the search it shows up.

In my application a user can initiate a long running activity that I'd
like to allow them to stop. I could put a STOP icon on the toolbar, or
I was thinking of using the X in a circle icon next to a spinning
progress indicator. I'm not sure which approach is more typical in Mac
OS X.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Where is close/cancel icon used in search field & Safari etc.

2008-10-08 Thread David
Thats exactly what I was looking for. Thanks!

On Wed, Oct 8, 2008 at 1:12 PM, Randall Meadows <[EMAIL PROTECTED]> wrote:
> On Oct 8, 2008, at 10:24 AM, David wrote:
>
>> Hello,
>> I'd like to have a button that looks like the close or cancel icon
>> that is often present in Cocoa applications, but I can't find the
>> icon. I'm surprised it doesn't show up as a choice in interface
>> builder.
>>
>> Some places where this icon shows up includes:
>> - When you have multiple tabs in Safari, its the X in a circle by the
>> tab that you use to close the tab.
>> - In a standard Cocoa search field used in Finder, if you enter
>> something and want to cancel the search it shows up.
>>
>> In my application a user can initiate a long running activity that I'd
>> like to allow them to stop. I could put a STOP icon on the toolbar, or
>> I was thinking of using the X in a circle icon next to a spinning
>> progress indicator. I'm not sure which approach is more typical in Mac
>> OS X.
>
> You can access this via IB; you can set a view's image to
> NSStopProgressFreestandingTemplate (or NSStopProgressTemplate for just the X
> part).  I assume (although haven't tried) that you can access this also
> through NSImage by name.
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Inconsistent HTML text size in TextField

2008-10-09 Thread David
I have a TextField which supports attributed text. I'm using HTML to
populate the field.

The problem is that depending on which userid I run the application
in, the size of the text is different. How can that be? Is there some
Safari setting or preference that can be affecting it?
___

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

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

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

This email sent to [EMAIL PROTECTED]


Is there an icon to represent "select all"?

2009-03-20 Thread David
Is there a standard icon to represent "select all"?
Is there a better website where I should ask this?

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


Explicit release when using garbage collection with circular references

2009-03-21 Thread David
Is there any issue issuing explicit release when using garbage
collection with Leopard and Obj-c 2.0?

I've become aware that I have lots of memory not being freed within my
application. I presume this is because its a tree structure with
parent child pointers between the objects. If I drop the last
reference to the tree, I presume the tree does not get garbage
collected because each object has circular pointers between them, ie
parent has references to children and each child has a reference to
its parent. In this case, it seem that the appropriate course of
action would be to call a specific method to forcibly release each
node in the tree.
Is this the proper approach?
Should garbage collection somehow work anyway?

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


How to create an ISO disc image

2009-04-12 Thread David

How can I create an ISO disc image.
Can the disc recording framework do it?
What about the DiskImages framework?
I can't find an API for it.

Thanks

Sent from my iPhone
___

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

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


Label randomly cut off in NSOutlineView column

2009-05-31 Thread David
I have an outline view where the first column are file names. There is
absolutely no processing of the name going on in my code.

Everything has been working fine for a long time. Suddenly I discover
a filename that causes the value displayed to be truncated. I've
played with it. There are no special characters, they're all regular
ascii single byte characters. For some names it works, some get
truncated with no apparent rhyme or reason.

Has anyone seen anything like this before? Is this some weird bug or
explainable behavior in Cocoa? Could I be doing something wrong? My
application is running on leopard with garbage collection enabled.

I've changed the name to be generic. The following filename
Xxxx....444..66.777

displays in my NSOutlineView as
Xxxx.

If I take out some xx's it works. Many other random changes will make
it work, such as changing the Xs to 0s. Some cases will cause it to
truncate at a later period, but it always truncates at a period.

This is extremely weird. Any suggestions appreciated.
___

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

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


NSOutlineView sometimes truncates label

2009-06-01 Thread David
I have an outline view where the first column are file names. There is
absolutely no processing of the name going on in my code. It uses a
data source delegate. The method
outlineView:objectValueForTableColumn:byItem: is returning an NSString
* with the proper value.

Everything has been working fine for a long time. Suddenly I discover
a filename that causes the value displayed to be truncated. I've
played with it. There are no special characters, they're all regular
ascii single byte characters. For some names it works, some get
truncated with no apparent rhyme or reason.

Has anyone seen anything like this before? Is this some weird bug or
explainable behavior in Cocoa? Could I be doing something wrong? My
application is running on Leopard with garbage collection enabled.

I've changed the name to be generic. The following filename
Xxxx....444..66.777

displays in my NSOutlineView as
Xxxx.

If I take out some xx's it works. Many other random changes will make
it work, such as changing the Xs to 0s. Some cases will cause it to
truncate at a later period, but it always truncates at a period.

This is extremely weird. Any suggestions appreciated.
___

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

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

2008-02-25 Thread David Carlisle
So in the non_GC world, where is the best place to - 
removeObserver:forKeyPath: if not in -dealloc?


On Feb 25, 2008, at 8:02 AM, glenn andreas wrote:

Note that in the non-GC world, you can't do that in -dealloc (since  
the KVO "warning" about deallocating something that is still be  
observed happens before the call to dealloc), so it's unclear if  
there isn't some similar helpful warning before -finalize is called...


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Nicely scaling a CALayer (interpolation?)

2008-02-26 Thread David Duncan

On Feb 26, 2008, at 1:42 AM, Martin wrote:

I think that I need to tell my CALayer to use interpolation rather  
than linear scaling, right?

I've tried to do that but this doesn't work:
imageLayer.minificationFilter = kCAFilterNearest;



The nearest filter is "nearest neighbor" or no interpolation. Try  
using kCAFilterLinear instead.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: QCView

2008-02-26 Thread David Duncan

On Feb 26, 2008, at 7:03 AM, [EMAIL PROTECTED] wrote:


I am building on 10.4 and I would like to get a preview of a Quartz
Composition. The API snapshotImage works only on Leopard. So I have  
tried

unsuccessfully to lockFocus drawRect and unlockFocus then save the
TIFFRepresentation, which results in an empty image.
The line pdfData = [oQCView dataWithPDFInsideRect:[oQCView bounds]];
returns a white image.

Any idea? Should I work with the QCRenderer?


QC renders via OpenGL, so yes you should try using the QCRenderer  
instead.


Also, I have found pauseRendering and resumeRendering working on  
Leopard
only too. So how to perform this actions on Tiger? The API  
stopRendering

erases the QCView.


You will probably have to resort to the QCRenderer for this as well.

My target is (on Tiger): I have a text list of QC files with their  
icons. I
click on a row of the list and I see a static preview of the first  
frame of
the QC in a QCView. I double click and I play the QC. Other double  
click and

I pause the QC (still visible). May I have a pointer? Thanks.



For specific details, you might want to consul the QuartzComposer-Dev  
list, as the QC engineers monitor that list more so than this one.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Charting API? (Chris Schmitt)

2008-02-27 Thread David Hoerl
I send Chris a post I made last year on this subject, and the woeful 
lack of options for us developers (you can search on "Re: Objective C 
Graphing Packages" in the scitech list).


The bottom line:
- nothing from Apple
- no licensable distributable library from anyone
- a few open source good-starts that have not been supported for years
- one freely usable package, SM2DGraph, that does one thing pretty 
well, and has been supported (along with their really cool 
double-thumb slider!)


Apple has the makings of such a framework already - its called GraphKit.

If you want GraphKit to become available as a supported Cocoa 
framework PLEASE enter an enhancement bug - you can reference the 
same bug my request was dupped to: 3320659 [its low number tells you 
its a long standing request!].


Even if you don't care - enter a bug anyway, and help the rest of us! 
1,000 more bugs on this issue and we'll surely see GraphKit in the 
next big-cat release!


David
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Charting API?

2008-02-28 Thread David Hoerl
 > On Wed, Feb 27, 2008 at 2:14 PM, Chris Schmitt <[EMAIL PROTECTED]> 

 wrote:
 I want to add some simple bar graphs and pie charts to my project.  
 Is

 there an apple api for charting or do you need to use a 3rd party
 product?


I've been using Chartdirector:

http://www.advsofteng.com/

Not Cocoa, but easily usable and very powerful.

Cheers,
Dix


Dix, thanks so much for the tip - I had never heard of this package 
before (the company appears to be located in Hong Kong. I just looked 
at their web site, and it would appear they have a nice suite of 
graphs.


What I glean from the web site is as follows:
- for MacOS X, they deliver a universal library and header files
- the library is C++ (I would imagine it would integrate into a cocoa 
app fairly well)

- single user price is $99 (much more than the DataGraph library that is $29)
- redistribution license is $749. This is the only library I have 
found that offers redistribution.)


All in all looks very promising.

David
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Charting API?

2008-03-01 Thread David Adalsteinsson


On Mar 1, 2008, at 6:14 PM, Chris Ryland wrote:


On Mar 1, 2008, at 2:35 AM, Robert Douglas wrote:

When I looked into this last fall I decided I liked the look of  
DataGraph and bought a license, but then I ran into  trouble   
incorporating it into a garbage-collected app and started writing  
my own.  Mind you, that could have been me and my Fortran IV -  
imprinted brain, but now I too am reevaluating the situation.   GC  
is no longer relevant as I'm using core video buffers, but now I'm  
worried about the long-term viability of all the libraries  
mentioned (DataGraph, SM2DGraphView, Vvidget,  Google Chart,  
Narrative etc.).   I'm inclined to go with SM2DGraphView as the  
source code is available and understandable.

-Rob


As the developer of DataGraph, I am definitely planning on continuing  
to support the framework for a long time.  I try to be very responsive  
regarding any problems with the framework, and I have a bulletin board -
http://www.visualdatatools.com/phpBB2/ where issues can be brought to  
my attention.  I'm curious to know if what could be wrong with GC and  
the DataGraph framework.


DataGraph grew out of DataTank. I have worked on DataTank for a long  
time, so should have built up some trust regarding staying power. I  
keep up with current versions/updates to the system.  Sometimes this  
is surprisingly messy, for example because of changes in NSTableView  
and NSTokenField in 10.5.  I don't yet have a 64 bit version as part  
of the release, but I've gone through the code and it is 64 bit  
clean.  I can do a 64 bit version (quad binary) if there is interest.


I strongly urge everyone who's interested to file an Apple bug  
report asking that they make their framework public, as it  
(apparently) produces some of the most beautiful graphs around.  
Beauty is *almost* the most important point here...


My graph style tends to be "Tufte" like, with emphasis on publication  
quality graphs, but allow gradients, etc if you want to do flash.  The  
framework is paired with the application, and one way to think of it  
is that the application works as a "interface builder" and a way to  
test your work during debugging.  I don't know exactly what the  
GraphKit API looks like, or which Apple applications actually use it.   
The graphs don't quite look consistent between KeyNote, Shark, XRay  
and Activity monitor.


David



Cheers!
--Chris Ryland / Em Software, Inc. / www.emsoftware.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/davida%40mac.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


keydown, determining if a keypress was "repeated"

2008-03-03 Thread David Harper
Hello,

When a keyDown event is received, does anyone know how to determine whether the 
event was caused by a key press or a timed repeat?  For example, when the x key 
is pressed and held, I would prefer to ignore the events following the initial 
key press.

Thanks in advance,

-Dave H.
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSOutlineView slow update w Core Data

2008-03-04 Thread David Melgar
I have an NSOutlineView subclass bound to a NSTreeController subclass which
is bound to a simple data model representing a hierarchical tree structure.
I've implemented drag and drop by having the view send a custom message to
my NSTreeController subclass who then updates the model. The problem is that
there is then a delay of about 1 second before the view displays the added
node.

I've noticed that if I move the mouse out of the OutlineView, then it seems
to update immediately. Any idea what I maybe doing wrong? Is it possible
that core data and all the observing patterns are really taking this long to
percolate the change back to the view? Am I supposed to do something to wake
up the view faster?

I'm using Leopard (10.5.2), XCode 3, Objective-C 2.0. I don't have any code
to deal with memory management. If I run with garbage collection
unsupported, the OutlineView never updates UNTIL I move the mouse out of the
OutlineView. If garbage collection is enabled, there is the 1 second delay.
With garbage collection supported, there are no errors or exceptions listed
in the console.

MyOutlineView has the following method

- (BOOL)performDragOperation:(id )sender {

NSPasteboard *pboard;

NSDragOperation sourceDragMask;

 sourceDragMask = [sender draggingSourceOperationMask];

pboard = [sender draggingPasteboard];

 if ( [[pboard types] containsObject:NSFilenamesPboardType] ) {

NSArray *files = [pboard propertyListForType:NSFilenamesPboardType];

if (myTreeController != NULL) {

[myTreeController addFiles:files];

}

}

return YES;

}

MyTreeController method is as follows:

- (void)addFiles:(NSArray *)droppedFilenames {

NSManagedObjectContext *moc = [self managedObjectContext];

for (NSString *name in droppedFilenames) {

NSManagedObject *bfile = [NSEntityDescription
insertNewObjectForEntityForName:@"bFiles" inManagedObjectContext:moc];

[bFile setName: name];

}

}


The model is:

Entity name: bFiles

Attribute: name

relationship: parent, optional, bFiles

relationship: child,  optional, bFiles


I have MyTreeController nib configured with the following attributes

Keypaths: children = children

Options: avoid empty selection, preserve selection, select inserted objects

ObjectController:

Mode=Entity

Entity name = bFiles

Prepares content, editable


I have MyTreeController bound as follows:

Parameters, ManagedObjectContext

bind to File's Owner

Model key path = managedObjectContext

Raises for not applicable keys


I don't have my NSOutlineView bound to anything but I do have the contained
TableColumn bound as follows:

Value: bind to: Tree Controller

Controller Key = arrangedObjects

Model Key Path = name

Allows editing multiple value selection

Creates sort descriptor

Raises for not applicable keys


Thats about everything pertinent that I can think of. Any suggestions
appreciated.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: CATiledLayer too slow to update

2008-03-05 Thread David Duncan

On Mar 4, 2008, at 8:57 PM, Colin Cornaby wrote:

I'm using a CATiledLayer to render a large background in my  
CoreAnimation composition. A CATiledLayer seems to be best suited  
for the job due to the size of the composition. However, one problem  
I am running into is when the tiles become very small, the layer can  
be very slow to update. This doesn't seem like an overhead issue to  
me as I am supplying layer content from a CGLayerRef, which should  
be very fast at drawing an image of the same size. Rather, it seems  
to me like the CAScollLayer is distributing the drawing over a  
period of time.


It would be far more advantageous to me, in addition to the poor  
user who has to sit through the tiny tiles being drawn one by one,  
to draw all layers as soon as they need to be displayed.


Does anyone have any workarounds for this, or workarounds for  
drawing backgrounds in general? It would be nice to draw the  
background by hand without the aid of a tile layer, but I've found  
no way to keep a background synchronized with a parent CAScrollLayer  
properly.



Draw bigger tiles. The smaller the tiles, the greater the overhead.  
From the sounds of it, you might be zooming the layer as well, in  
which case you might want to use the LOD properties (levelsOfDetail  
and levelsOfDetailBias) in order to reduce the amount of work you need  
to do to fill the visible area (and correspondingly reduce the amount  
of time needed to render when your zoomed out).

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Deferring a selector until later, but before painting

2008-03-06 Thread David Duncan

On Mar 6, 2008, at 9:59 AM, John Stiles wrote:

On Leopard, this solution works perfectly. I get a chance to update  
my view right before it draws, which is exactly what the doctor  
ordered.


Any way to get this on Tiger or am I just out of luck?



If nothing else you can use the hammer approach of  
NSDisableScreenUpdates()/NSEnableScreenUpdates(), although this is  
usually used when you want multiple windows to appear without a flash...

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Job Offer: Cocoa iPhone Developer

2008-03-07 Thread Kopec, David
If interested, please contact [EMAIL PROTECTED]

The Associated Press is the backbone of the world's information system
serving thousands of daily newspaper, radio, television and online
customers with coverage in all media and news in all formats. It is the
largest and oldest news organization in the world, serving as a source
of news, photos, graphics, audio and video.

AP's mission is to be the essential global news network, providing
distinctive news services of the highest quality, reliability and
objectivity with reports that are accurate, balanced and informed. AP
operates as a not-for-profit cooperative with more than 4,000 employees
working in more than 240 worldwide bureaus.

Position Description:
The Associated Press is looking for a motivated Macintosh developer to
aid in the development of its own native iPhone applications.  These are
consumer facing applications, where attention to detail and UI
experience are paramount.  The position will run at least through June
in our New York office, although off-site development can be arranged as
well.

Responsibilities
* Be the main developer responsible for programming a native Cocoa
iPhone application
* Work to a detailed design specification
* Cooperate with designers and back-end technology partners

Required Knowledge/Experience:
* BS or MS in Computer Science or equivalent experience 
* Macintosh product development experience (2-5 years) 
* Extensive experience programming in Cocoa/Objective C (2+ years) 
* Familiarity with the iPhone's user interface and technical
features/limitations 
* Ability to keep to strict deadlines a must

Desirable Knowledge/Experience:
* Experience with iPhone development a major plus 
* HTML/CSS/Javascript experience

If interested, please contact [EMAIL PROTECTED]


The information contained in this communication is intended for the use
of the designated recipients named above. If the reader of this 
communication is not the intended recipient, you are hereby notified
that you have received this communication in error, and that any review,
dissemination, distribution or copying of this communication is strictly
prohibited. If you have received this communication in error, please 
notify The Associated Press immediately by telephone at +1-212-621-1898 
and delete this email. Thank you.
[IP_US_DISC]
msk dccc60c6d2c3a6438f0cf467d9a4938

___

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

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

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

This email sent to [EMAIL PROTECTED]


Core Data and indexed attributes question (from a CD noobie)

2008-03-08 Thread David Hoerl
I cannot find nothing in the Xcode user documentation, the Core Data 
documentation, nor on this list that explain what the "Indexed" 
checkbox in Xcode 3's Attribute panel is for.


A link or short explanation would be helpful. Thanks!

David

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: What is the status on the New Cocoa 2.0 Books?

2008-03-13 Thread David Carlisle
Does anyone know the status of the "Cocoa Design Patterns" book by  
Erik Buck, "rough-cuts" version or otherwise?


Amazon says 12 January 2009.

On Mar 12, 2008, at 5:54 PM, colo wrote:


And might there be others ?


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: QCView openGLContext

2008-03-14 Thread David Duncan

On Mar 13, 2008, at 4:53 PM, Lorenzo wrote:


If I comment this line below
   [[qcView openGLContext] flushBuffer];
my app launches and runs well, but of course I can't see the QCView  
contents
properly. I have seen that this API is available in 10.5 and later.  
Anyway
my compiler doesn't protest when I build my app against 10.4 SDK.  
This a

part, how can I make this work on Tiger too? Any workaround?



To answer the original question however, a QCView doesn't respond to  
the -openGLContext message until 10.5, so that is why on 10.4 you get  
that message. You shouldn't need to flush the buffer for your content  
to appear correctly however, so you might want to elaborate more on  
what issue your having specifically.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: QCView openGLContext

2008-03-14 Thread David Duncan

On Mar 14, 2008, at 12:56 PM, Lorenzo wrote:


I will file a bug.
I run XCode 3.0 - Xcode IDE: 921.0 - Xcode Core: 921.0 -  
ToolSupport: 893.0


Please file it, its always good to know what will help our  
developers :).



Actually I have adopted the solution posted by Sam, here in the list.
I render the qc composition into an openGLView using a timer.
It works well. I still get some garbage when resizing this view, but  
I hope

to fix it soon with the reshape and update APIs.



From what it sounds it seems like thats a good solution, although I'd  
also wonder why you have multiple GL contexts in a single window, as  
this is not the best route for performance. You might want to look  
into merging all of your OpenGL content into a single context instead  
of the multiple contexts you have.


As for the garbage, it is likely that your QC Compositions are missing  
a Clear Patch. Adding one should prevent the garbage.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: CGFloat in 10.4

2008-03-18 Thread David Duncan

On Mar 18, 2008, at 5:11 PM, bensyverson wrote:

I have a few CIColor's that I need to query for their color  
components, but I'm running into errors. Here's what I'm trying to do:


CGFloat *color;
color = [ciColor components];

Xcode complains, saying CGFloat is undeclared. I think I'm including  
all the appropriate headers... What gives? How can I get at the  
components of my CIColors?



The Mac OS X 10.4 SDK doesn't have a declaration for CGFloat. If you  
need to target that SDK, then you should use the float data type  
instead (which is what CGFloat is typedef'd to when compiling for 32- 
bit anyway). If you can use the 10.5 SDK, then you will find that  
CGFloat is defined, and you can use it compatibly when running on 10.4  
or 10.5.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: CGFloat in 10.4

2008-03-18 Thread David Duncan

On Mar 18, 2008, at 5:58 PM, bensyverson wrote:

Okay -- but how do I get CIColor components in 10.4?

Both float* and double* throw a warning ("assignment from  
incompatible pointer type," and "assignment discards qualifiers from  
pointer target type," respectively)



If your targeting the 10.4 SDK:

const float * c = [myColor components];

If your targeting the 10.5 SDK:

const CGFLoat * c = [myColor components];

Deployment target doesn't matter here. Just which SDK your targeting.
--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSString may not respond....

2008-03-19 Thread David Duncan

On Mar 19, 2008, at 10:10 AM, J. Todd Slack wrote:

Continuing my quest to get back into Cocoa/Objective-C, I am getting  
the
following error stating that NSString may not respond to certain  
calls.


Here is a screenshot:

http://jasonslack.biz/pic3.png

Can anyone explain what I am doing wrong because as far as I can see  
this

should be valid?



You might want to just copy and paste the code & errors into the  
message rather than a screen shot, especially since your image may go  
away while the message stays in the archives :).


That said, what SDK are you targeting? Both of these messages were  
added in 10.4, so if your targeting the 10.3.9 SDK then that might be  
why your getting these warnings.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Synchronous Ruby calls from Safari?

2008-03-19 Thread David Springer
All,

The attached html/Javascript and Ruby scripts run differently on a PC
with IE than they do no a Mac with Safari.  On IE, the alert panels
pop up in sequence; as if the Ruby call is synchronous.  On the Mac,
the last alert pops up before the third alert, or simultaneously with
it.  I did some debugging in my WebKit objects, and it looks like the
notifications which get the Ruby script to execute are called after a
spin through the event loop, after the end of the Javascript block
that calls Ruby.

My question is, is there a way to make the call through to Ruby
"synchronous" so that it works like it does on IE?  Is there a switch
I can set in my WebKit objects, or some way I can fake this behavior?

Thanks,
- Dave.S

# Create the WebDialog instance
my_dialog = UI::WebDialog.new("Dialog", false, "Dialog", 400, 600, 100, 100, true)
  

# Attach an action callback 
my_dialog.add_action_callback("call_ruby") do |web_dialog,command| 
  UI.messagebox('3) Ruby says: "I\'ve received a callback, and I\'m setting a javascript variable called returnValue to 5"')
  web_dialog.execute_script("top.returnValue=5")
end

html_path = Sketchup.find_support_file("macAsyncScriptBug.html" ,"Plugins")
my_dialog.set_file html_path
my_dialog.show_modal()___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Custom Shaped Buttons

2008-03-20 Thread David Adalsteinsson
I would recommend that you create your own button type, not based on  
NSButton, and handle everything in the mouseDown event.


 while (1) {
  [[NSRunLoop currentRunLoop]  
runMode:NSDefaultRunLoopMode beforeDate:[NSDate date]];
  theEvent = [theWindow  
nextEventMatchingMask:NSAnyEventMask
untilDate 
:[NSDate dateWithTimeIntervalSinceNow:0.02]


  inMode:NSEventTrackingRunLoopMode
   dequeue:YES 
];


  if ([theEvent type]==NSLeftMouseDragged) {
   cursorLocationInView = [self convertPoint: 
[theEvent locationInWindow] fromView:nil];


   // Do your hit testing, for example using  
a NSBezierPath object, and then change the drawing style.
   // Might need to manually call [self  
display] if the state changes (but I don't think you do, haven't  
checked).

  }

  if ([theEvent type]==NSLeftMouseUp) {
   // The drag stopped
   break;
  }
 }


If you implement the same methods as NSButton does, you should be able  
to treat them exactly the same.
The drawRect: method would draw the image that corresponds to the  
shape.  It is very easy to get images from the bundle based on names.


On Mar 20, 2008, at 8:43 AM, ADIL SALEEM wrote:


Hi,

I need guidance for a problem. I want to make custom
shaped buttons (based on images) in my GUI.

By assigning image and alternate image in IB it
displays the image but the shape of the button is not
exactly as the image. I want to make the button of
exact shape as that of the image.

For that i am trying to subclass NSButton. I have
created the subclass and assigned it to my buttons,
but i have no idea what functions to
implement/overwrite in the subclass to change the
shape of the button and assign the image as the button
shape.


Also please tell me that is this the right way
(subclassing NSButton) to do what i am trying to do ?

Thank you



  


Be a better friend, newshound, and
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Convert kernel AbsoluteTime to a NSDate

2008-03-25 Thread David Duncan

On Mar 25, 2008, at 2:32 AM, Matt Burnett wrote:


I really need to get it in to a NSDate.


The big question here is Why? Without understanding what you want to  
do, it is unlikely that anyone will be able to help you.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: machine with null serial number?

2008-03-28 Thread David Rogers
Almost the only time that a machine won't report that it has a serial  
number is after the logic board has been replaced and some technician  
forgot to reset the serial number.


Dave

On Mar 28, 2008, at 7:38 PM, Matt Burnett wrote:
What macs store their serial number on disk instead of on the logic  
board? Where did you find this information?


On Mar 28, 2008, at 7:32 PM, Scott Ribe wrote:

Some Macs don't have a serial number on the logic board, but rather  
just
stored on the disk. In that case, just reformatting or replacing  
the hard

disk will wipe the serial number. You should read this:




--
Scott Ribe
[EMAIL PROTECTED]
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/matt.w.burnett%40gmail.com

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Core Data migration

2008-03-29 Thread David Wilson
I have a reasonably complex core data data model which makes use of
entity inheritance. In an attempt to make use of the new Leopard data
migration tools, I created a new version, made a few minor desired
changes (added a few entities and created the relationships to them-
no changes to existing entities except new relationships to new
entities).

My first attempt to create the mapping model failed because the
automatically created mapping model would not compile. I eventually
tracked it down to the fact that mappings were not being created for
entities from which some other entity derived (that is, no base entity
had a mapping model created for it). As a result, any relationship to
a base entity did not have a valid value expression because no
appropriate mapping was found.

I was able to fix the above by creating the missing mappings, which
seemed to automatically fix the relationship mappings. Once I also got
the mapping and models into my application rather than its framework,
Core Data was successfully finding my source data model and attempting
the migration. However, the migration would fail with "Model already
contains an entity named VCText." The VCText entity is one that
derives from another entity, and it is my guess that this is a result
of a child entity being transformed twice- once because of the parent
entity mapping that I had to create, and then again because of the
child entity mapping.

To sum up:
Relationships to entities from which another entity inherits are not
automatically set up properly. There only appear to be two solutions:
a) Create the missing base entity mappings. This appears to cause
transformation failures, I assume because of double transformations
b) Fix the relationships by, rather than trying to use a base entity
mapping, simply picking one of the child entities (even though the
relationship is supposed to be to the base). This also seems likely to
fail to transform all relationships properly.

Anyone have any experience with this, or know how to handle this
situation? I suppose I could write a whole bunch of custom code to
handle it, but it seems as if the migration system should handle the
inheritance.

-- 
- David T. Wilson
Princeton Satellite Systems
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Simple NSComboBox example?

2008-03-31 Thread David Springer
Folks,

Is there a simple NSComboBox example that uses bindings out there?  I
want to populate an NSComboBox with a list of filenames using an
NSArrayController, etc.

Thanks!
- Dave.S
___

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

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

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

This email sent to [EMAIL PROTECTED]


Bindings for NSComboBox?

2008-03-31 Thread David Springer
All,

I'm having trouble setting up the bindings for my NSComboBox.  I bind
the NSComboBox's content to NSArrayController's arrangedObjects.  This
works fine.

Now, I want to add to the content array when you enter a new string
into the combo box.  Say, for example, I start with an array of @"file
1", @"file 2", @"file 3".  Then, in the combo box, I enter "file foo".
 I want to add this string to the content array, but I am at a loss as
to how to set up the bindings to do this.  Do I bind NSComboBox's
value to something?  My experiments in doing this so far are failing.

Help?
- Dave.S
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Bindings for NSComboBox? [SOLVED]

2008-04-02 Thread David Springer
All,

I figured it out: you need to have a separate controller (or provider
object) that handles the binding to the NSComboBox's value.  In my
case, I bind NSComboBox's value to my object's currentTemplatePath
key, then implement the code to add to my source array in
-setCurrentTemplatePath:(NSString *)newPath.  The -(NSString
*)currentTemplatePath method just returns the NSComboBox's current
selection (for all intents and purposes, it's a noop).  Works great.

Thanks!

On Wed, Apr 2, 2008 at 4:33 AM, Ian Jackson <[EMAIL PROTECTED]> wrote:
> Does this mean that you want to create a new object and add it to the array,
> by typing a new string into the combo box (and pressing enter)? My feeling
> is you'd need to write a bit of code yourself for that.
>
>  Ian.
>
>
>
>  On 1/04/2008, at 9:44 AM, David Springer wrote:
>
>
> >
> >
> >
> > All,
> >
> > I'm having trouble setting up the bindings for my NSComboBox.  I bind
> > the NSComboBox's content to NSArrayController's arrangedObjects.  This
> > works fine.
> >
> > Now, I want to add to the content array when you enter a new string
> > into the combo box.  Say, for example, I start with an array of @"file
> > 1", @"file 2", @"file 3".  Then, in the combo box, I enter "file foo".
> > I want to add this string to the content array, but I am at a loss as
> > to how to set up the bindings to do this.  Do I bind NSComboBox's
> > value to something?  My experiments in doing this so far are failing.
> >
> > Help?
> > - Dave.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/bianface%40gmail.com
> >
> > This email sent to [EMAIL PROTECTED]
> >
>
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: 1 pixel bordered CALayer renders improperly

2008-04-03 Thread David Duncan

On Apr 2, 2008, at 10:26 PM, Martin wrote:

It seems that a CALayer with a borderWidth of 1.0 renders  
improperly: all the border's pixels are good except the very top  
right pixel which has a different colour.


Example: http://img34.picoodle.com/img/img34/4/4/2/f_CALayerm_6e43e20.png

Is this a know bug? Is there a workaround?



Haven't seen it before, please file it with a reproducible case. Best  
idea for a work around would be to draw the border yourself (either  
override -drawInContext or set a delegate and override - 
drawLayer:inContext) but I have no idea if that would work.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread David Duncan

On Apr 3, 2008, at 11:34 AM, Jonathan del Strother wrote:


CALayer says that 'contents' is "typically a CGImageRef, but may be
something else".  I (optimistically) tried assigning the
CVPixelBufferRef directly to the contents, but apparently that's not
included in the mysterious 'something else' list.


Could you point out where it says that? Typically you would set the  
contents property either as a CGImageRef, or as the value of the  
contents of another layer (which would cause them to share contents).



The only way I've found of going from CVPixelBufferRef to CGImageRef
is via CIImage, something like the following :



If you have a CVPixelBufferRef, you can use the various functions  
defined for a CVPixelBuffer to access the base address, row bytes,  
width, height and other attributes to create a CGImageRef directly  
from it via CGImageCreate(). You should be able to find more  
information by consulting the CoreVideo and Quartz references.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread David Duncan

On Apr 3, 2008, at 12:28 PM, Jonathan del Strother wrote:
If you have a CVPixelBufferRef, you can use the various functions  
defined
for a CVPixelBuffer to access the base address, row bytes, width,  
height and

other attributes to create a CGImageRef directly from it via
CGImageCreate().


Even for yuv?  I thought CGImageCreate only handled variations on
rgba, but will give it another go...



Your right, I forgot that detail :). I'm not familiar but Quicktime  
might be able to convert it for you before you get it (which is likely  
the best thing in this case).


But that brings up the question of what are you trying to do? :)
--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread David Duncan

On Apr 3, 2008, at 1:00 PM, Jonathan del Strother wrote:

I'm using the QTCapture api to record from a camera, while displaying
a live preview (ideally with 0 lag) in Core Animation.



The QTCaptureLayer doesn't do what you want?
--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ImageIO key properties

2008-04-07 Thread David Duncan

On Apr 6, 2008, at 11:22 PM, Mirko Viviani wrote:

for an application targeted for 10.4 I need to access the value of  
some key properties defined
for 10.5 in CGImageProperties.h, like  
kCGImagePropertyExifAuxDictionary.


Is there a legal way to do this?



Assuming you have your project set properly, standard weak-linking  
policies should apply. See the Frameworks Programming Guide on  
Frameworks and Weak Linking at <http://developer.apple.com/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/WeakLinking.html 
>

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: ImageIO key properties

2008-04-07 Thread David Duncan

On Apr 7, 2008, at 12:46 PM, Mirko Viviani wrote:

I've tried linking with -framework and -weak_framework with the same  
results.
kCGImagePropertyDNGDictionary and others properties declared in  
CGImageProperties.h are not defined in the framework.

Is it a bug or am I missing something?



You shouldn't need to specify the actual link parameters, just set the  
SDK (to 10.5) and the deployment target (to 10.4) and Xcode should  
figure everything out for you.


That said, this does look suspicious since the framework didn't  
declare kCGImagePropertyDNGDictionary until 10.5 but there is no  
availability macro attached to it. You should file a bug.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


alBufferData, void * data

2008-04-07 Thread David Harper
hello!

I'm trying to figure out how to use openAL without alut (as alut is no longer 
included in the openAL framework).  The roadblock I am facing is that 
alBufferData requires a pointer to a sound's bitmap data.

NSSound doesn't seem to have the appropriate method.  Any suggestions?

Please let me know if this question would be better directed to a different 
mailing list.

Thanks in advance,
- Dave H.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Tips to deploy applications to multiple Mac OS X versions

2008-04-09 Thread David Duncan

On Apr 9, 2008, at 7:43 AM, Lorenzo Bevilacqua wrote:

I'm trying to build a Cocoa application so that it can run on Mac OS  
X from version 10.3.9 to 10.5.
I have 10.5 installed so the application runs fine on my system and  
on other Leopard systems.
I haven't build a project for multiple platforms yet, so I tried to  
duplicate the main Xcode target and set different deployment target  
settings like


Typically you would only use 1 target. Use the SDK to the OS whose API  
your are targeting (such as the 10.5 SDK). Then set the deployment  
target to the minimum version you wish to run on (example, 10.3).  
Finally, you would do runtime checks for API availability.


Till now all Ok, but when I try to compile for example the Tiger  
target I get some errors (mainly about fast enumeration). Thus I  
have some questions:


- Does the Objective-C 2.0 fast enumeration make sense to be used? I  
mean, if I don't use it, will my application perform worse on Leopard?


Fast enumeration relies on selectors that are only implemented on  
10.5, so you can't use it on 10.4 or earlier systems. You cant use  
most Obj-C 2.0 features if you wish to be compatible with 10.4 or below.


- Is there a way to differentiate part of code by platform? I  
remember I saw in some files lines like this


#if MACOSX_DEPLOYMENT_TARGET == MAC_OS_X_VERSION_10_4
#endif

is this correct?



This is a compile time check. Generally it is appropriate if you plan  
to ship a binary with a specific compile-time dependency. It sounds  
like you really want a run time check, which requires you to check for  
the availability of the features you are trying to use. How you check  
for this will depend on what you are doing to some degree.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Replacement for GetApplicationEventTarget?

2008-04-10 Thread David Duncan

On Apr 10, 2008, at 12:21 PM, Michael Vannorsdel wrote:

Is there a replacement function for GetApplicationEventTarget?  I'm  
looking for one since this is the only thing I have left that's not  
64 bit compatible.


You will have to elaborate on what you are using it for, as there are  
many possible replacements.

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Efficient object wrappers and GC

2008-04-11 Thread David Duncan

On Apr 11, 2008, at 10:25 AM, Buddy Kurz wrote:

I'm wondering if it would make sense (or be possible)  to override - 
retain and -release to increment/decrement your own variable in  
addition to using the inherited behavior.  In the GC environment,  
the inherited retain does nothing but in either environment your  
enumerator can detect the retain by checking your variable.



It isn't that the inherited retain(release/retainCount/autorelease) do  
nothing, its that they are no-op'd. They are neutered at the the level  
of message dispatcher which means that under GC your class will  
*never* see these messages.


See <http://developer.apple.com/documentation/Cocoa/Conceptual/GarbageCollection/Articles/gcDesignPatterns.html 
>

--
David Duncan
Apple DTS Animation and Printing
[EMAIL PROTECTED]



___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Efficient object wrappers and GC

2008-04-11 Thread David Wilson
On Fri, Apr 11, 2008 at 4:15 PM, Michael Ash <[EMAIL PROTECTED]> wrote:

>  I think it's inherently not possible to do without destroying the
>  speed you're trying to gain. Due to how Apple's collector is
>  implemented, not generating write barriers for stack values, seeing if
>  an object has been stored requires re-scanning all dirty parts of the
>  stack.

If you're not opposed to trading memory for the speed, you can link
the wrapper to the underlying structure to ensure that you create one
and only one wrapper for each underlying data node. The enumerator can
then return the unique wrapper for the appropriate next node. You'll
have to make sure that the GC doesn't think the wrappers are trashable
(toss them all in some storage structure?).

This way you'll pay the speed penalty the first time through, but on
subsequent passes you'll only pay the penalty for nodes that haven't
been seen yet. The actual benefit you get from this depends heavily on
how often you modify the underlying structure, which would require you
to toss out old wrappers for deleted nodes and create new ones for the
not-yet-visited nodes.

-- 
- David T. Wilson
Princeton Satellite Systems
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSURLConnection doesn't post

2008-04-11 Thread David Wilson
On Fri, Apr 11, 2008 at 1:32 PM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:

>  NSRunloop documentation disagree:
>  In general, your application does not need to either create or explicitly
> manage NSRunLoop objects. Each NSThread object, including the application's
> main thread, has an NSRunLoop object automatically created for it as needed.
> If you need to access the current thread's run loop, you do so with the
> class method currentRunLoop.

currentRunLoop creates the run loop if necessary; the run loop is not
automatically created at thread start. Also, the run loop must
actually be run, which passes thread control into [NSRunLoop run]- you
can't have a run loop magically running in your thread while you're
doing other things in the thread unless those other things are managed
by the run loop.

-- 
- David T. Wilson
Princeton Satellite Systems
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Override AppleScrollBarVariant on NSScroller?

2008-04-11 Thread David Wilson
On Thu, Apr 10, 2008 at 8:00 AM,  <[EMAIL PROTECTED]> wrote:
> Thanks Mike, adding a default to NSArgumentDomain (i.e. by passing
>  {"-AppleScrollBarVariant", "Single"} to the executable on launch) did
>  the trick.

As others have mentioned... please don't actually do this. The setting
is a system-wide preference for a reason; you should respect the
user's preference rather than forcing something else down their
throat. If there's some reason you think you need to ignore that
preference, you should let the list know, and we might be able to
provide a better way of doing things.

-- 
- David T. Wilson
Princeton Satellite Systems
[EMAIL PROTECTED]
___

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

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

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

This email sent to [EMAIL PROTECTED]


  1   2   3   4   5   6   7   8   9   10   >