Re: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Scott Ribe
> If  
> you fork and execv a process, then when the parent terminates, the
> created process is automatically made a child of launchd.

Normally when a parent process terminates, all its children are
automatically terminated. The original question was how to launch a process
from an app such that the process is not a child of the app, but rather a
child of a higher-up process, whether a child of launchd or something
further down the chain like WindowServer was not really part of the
discussion. A corollary of course would be how to launch a child such that
what you describe happens--termination of parent results in child becoming
child of an ancestor further up the chain.

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

This email sent to [EMAIL PROTECTED]


Re: How to use bindings with IKImageBrowserView?

2008-04-04 Thread Adam Gerson
I know its a hybrid approach, but the upside is I did not have to call
reloadData. As soon as I added an object to the arraycontroller it
became available in the view.

Adam


On Sat, Apr 5, 2008 at 12:28 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
>
>  On Apr 4, 2008, at 2:18 PM, Adam Gerson wrote:
>
> > It does work. I have defined a core data entity that conforms to
> > IKBrowerItem protocol and my IKImageBrowserView is working with
> > bindings. I think you still need to point the delegate and data source
> > outlets to an object that implements the datasource methods:
> >
>
>  Are you doing the below plus bindings? That makes no sense to me.
>
>  The code below is using the array controller as its data source. That means
> you have to manually use reloadData I assume. My goal is to update a store
> of images that is KVO/KVC compliant and have the view update automatically
> as images are added and removed.
>
>
>
> >
> >
> >
> > //
> -
> > //  numberOfItemsInImageBrowser:view
> >
> >
> >
> > //
> -
> > - (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
> > {
> >// The item count to display is the datadsource item count.
> >   return [[imageBrowserArrayController arrangedObjects] count];
> > }
> >
> > //
> -
> > //  imageBrowser:view:index:
> > //
> -
> > - (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
> > {
> >   return [[imageBrowserArrayController arrangedObjects]
> objectAtIndex:index];
> > }
> >
> >
> > // Implement some optional methods of the image browser  datasource
> > protocol to allow for removing and reodering items.
> >
> > //
> -
> > //  removeItemsAtIndexes:
> > //
> > //  The user wants to delete images, so remove these entries from the
> > data source.
> > //
> -
> > - (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
> > (NSIndexSet*)indexes
> > {
> >[imageBrowserArrayController
> removeObjectsAtArrangedObjectIndexes:indexes];
> > }
> >
> >
> > On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
> >
> > >
> > > I am attempting to use bindings to supply an IKImageBrowserView with
> data.
> > > I have successfully used IKImageBrowserView with a data source, but
> cannot
> > > get bindings to work. Should it work with bindings?
> > >
> > > The array controller's contentArray is hooked up to an NSMutableArray
> > > called storedImages. That contains instances of storedImage. And those
> have
> > > a method browserObject that returns instances of an object that
> implements
> > > the IKBrowerItem protocol to fetch and display an image (uid, path,
> etc).
> > >
> > > The Image Kit browser is bound to the array controller's arranged
> objects
> > > with the model key path browserObject. It is set to automatically
> prepare
> > > content.
> > >
> > > I get no images displayed even though there are plenty in the
> storedImages
> > > array. I am telling the browser view to reload its data.
> > >
> > > If I set a breakpoint at browserObject, it is never hit. So it looks
> like
> > > the array controller is never attempting to read my model. I get no
> errors
> > > when loading my nib.
> > >
> > >
> > > --
> > > Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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/agersonl%40gmail.com
> > >
> > > This email sent to [EMAIL PROTECTED]
> > >
> > >
> >
>
>
>  --
>  Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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 [EMAIL PROTECTED]


Re: How to use bindings with IKImageBrowserView?

2008-04-04 Thread Steve Weller


On Apr 4, 2008, at 2:18 PM, Adam Gerson wrote:

It does work. I have defined a core data entity that conforms to
IKBrowerItem protocol and my IKImageBrowserView is working with
bindings. I think you still need to point the delegate and data source
outlets to an object that implements the datasource methods:


Are you doing the below plus bindings? That makes no sense to me.

The code below is using the array controller as its data source. That  
means you have to manually use reloadData I assume. My goal is to  
update a store of images that is KVO/KVC compliant and have the view  
update automatically as images are added and removed.







//  
-

//  numberOfItemsInImageBrowser:view
//  
-

- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
// The item count to display is the datadsource item count.
   return [[imageBrowserArrayController arrangedObjects] count];
}

//  
-

//  imageBrowser:view:index:
//  
-

- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
   return [[imageBrowserArrayController arrangedObjects]  
objectAtIndex:index];

}


// Implement some optional methods of the image browser  datasource
protocol to allow for removing and reodering items.

//  
-

//  removeItemsAtIndexes:
//
//  The user wants to delete images, so remove these entries from the
data source.
//  
-

- (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
(NSIndexSet*)indexes
{
	[imageBrowserArrayController  
removeObjectsAtArrangedObjectIndexes:indexes];

}


On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]>  
wrote:


I am attempting to use bindings to supply an IKImageBrowserView  
with data.
I have successfully used IKImageBrowserView with a data source, but  
cannot

get bindings to work. Should it work with bindings?

The array controller's contentArray is hooked up to an NSMutableArray
called storedImages. That contains instances of storedImage. And  
those have
a method browserObject that returns instances of an object that  
implements
the IKBrowerItem protocol to fetch and display an image (uid, path,  
etc).


The Image Kit browser is bound to the array controller's arranged  
objects
with the model key path browserObject. It is set to automatically  
prepare

content.

I get no images displayed even though there are plenty in the  
storedImages

array. I am telling the browser view to reload its data.

If I set a breakpoint at browserObject, it is never hit. So it  
looks like
the array controller is never attempting to read my model. I get no  
errors

when loading my nib.


--
Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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/agersonl%40gmail.com

This email sent to [EMAIL PROTECTED]



--
Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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 [EMAIL PROTECTED]


Re: core data - beyond the simple example

2008-04-04 Thread Ben Trumbull

At 5:19 PM -0700 4/4/08, [EMAIL PROTECTED] wrote:

It's a bummer the headstart videos are only available with a non-free
ADC membership.


really ? Did you try:


--

-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: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Jonathan Prescott
All processes on MacOSX, and any Unix/Linux operating system are  
child processes except for launchd (MacOSX) or init (Unix/Linux).  If  
you fork and execv a process, then when the parent terminates, the  
created process is automatically made a child of launchd.


Jonathan

On Apr 4, 2008, at 12:35 PM, Scott Ribe wrote:

Even if NSTask doesn't have options for this, you can always call  
fork

and execv, which is what NSTask uses under the hood.


But that gives you a child process, and there's no way that I found  
around

it without ugly hacks involving exec'ing a launchctl script...

--
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/jprescott12% 
40comcast.net


This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Non-retained NSImages still available?

2008-04-04 Thread stephen joseph butler
On Fri, Apr 4, 2008 at 9:18 PM, Adam R. Maxwell <[EMAIL PROTECTED]> wrote:

> Can you do that by creating too many images?  The docs for +imageNamed:
> say "...you do not need to retain the returned image object unless its name
> could be cleared. You can clear an image object from the table by passing
> nil to the setName: method of the corresponding NSImage object."


Opps... good catch, I missed that one!
___

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

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

2008-04-04 Thread Adam R. Maxwell


On Apr 4, 2008, at 6:43 PM, stephen joseph butler wrote:

On Fri, Apr 4, 2008 at 8:29 PM, Matt R <[EMAIL PROTECTED]> wrote:


   imgArray[x] = [NSImage imageNamed:@"foo.jpg"];

Throughout the scope of my app, when the drawRect fires, these images
always
appear properly. But today I suddenly released that I never  
retained them,
which has me kind of baffled. My understanding was that once the  
method

that
creates the auto-released object exits, eventually that object will  
be
released. Other objects, like NSStrings, which are created within  
this
view's methods, seem to need to be retained as the view's methods  
use the
object, but the NSImage array shows up without being retained. Can  
someone

please help me understand why this is?



NSImage is caching them, and your app doesn't create enough images  
to force
an eviction. But if you ever do end up evicting one of them, you'll  
run into

problems (obviously).


Can you do that by creating too many images?  The docs for  
+imageNamed: say "...you do not need to retain the returned image  
object unless its name could be cleared. You can clear an image object  
from the table by passing nil to the setName: method of the  
corresponding NSImage object."


So even though this should work correctly, I'd use an NSArray or  
manually retain the images, though, just for consistency.  Using C  
arrays to hold objects is certainly useful at times, but can be a  
dangerous practice IMO.


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


Re: Non-retained NSImages still available?

2008-04-04 Thread stephen joseph butler
On Fri, Apr 4, 2008 at 8:29 PM, Matt R <[EMAIL PROTECTED]> wrote:

> imgArray[x] = [NSImage imageNamed:@"foo.jpg"];
>
> Throughout the scope of my app, when the drawRect fires, these images
> always
> appear properly. But today I suddenly released that I never retained them,
> which has me kind of baffled. My understanding was that once the method
> that
> creates the auto-released object exits, eventually that object will be
> released. Other objects, like NSStrings, which are created within this
> view's methods, seem to need to be retained as the view's methods use the
> object, but the NSImage array shows up without being retained. Can someone
> please help me understand why this is?


NSImage is caching them, and your app doesn't create enough images to force
an eviction. But if you ever do end up evicting one of them, you'll run into
problems (obviously).
___

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

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


Non-retained NSImages still available?

2008-04-04 Thread Matt R
I'm sorry for asking a memory management question but I was hoping someone
could help me understand this situation.

I have a series of NSImages I place in an array (subclass instance variable)
when a custom NSView is init'd:

initWithFrame:

 imgArray[x] = [NSImage imageNamed:@"foo.jpg"];

Throughout the scope of my app, when the drawRect fires, these images always
appear properly. But today I suddenly released that I never retained them,
which has me kind of baffled. My understanding was that once the method that
creates the auto-released object exits, eventually that object will be
released. Other objects, like NSStrings, which are created within this
view's methods, seem to need to be retained as the view's methods use the
object, but the NSImage array shows up without being retained. Can someone
please help me understand why this is?

Thank you for your help,
-Matt
___

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

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

2008-04-04 Thread Jens Alfke


On 4 Apr '08, at 1:08 PM, Kevin Wojniak wrote:

Generally, when there are specifics like this I can fix the crash  
pretty easily. However, with this I'm stumped.


Try setting the environment variable NSZombieEnabled to YES and  
running again. You should get an informative message about what  
already-dealloced object got messaged.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: core data - beyond the simple example

2008-04-04 Thread Torsten Curdt


On Apr 5, 2008, at 01:42, Quincey Morris wrote:


On Apr 4, 2008, at 16:31, Torsten Curdt wrote:


Got that working now ...except the predicate bug reported before.
It seems that when I add another object a new predicate is set.


And could that possibly be because [NSArrayController  
clearsFilterPredicateOnInsertion] defaults to YES like the  
documentation says?? :)


Thanks you so much! That was it! :)

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How do I embed a font in an app?

2008-04-04 Thread Jens Alfke


On 4 Apr '08, at 4:06 PM, Buddy Kurz wrote:


I had some success with this -


Works like a charm, thanks!

ATSFontActivateFromFileSpecification is deprecated in Leopard, but the  
new replacement function, ATSFontActivateFromFileReference, is  
identical except for taking an FSRef instead of an FSSpec. So it makes  
the code even simpler.

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Objective-C Instance Variable Names

2008-04-04 Thread Mario Gajardo Tassara


El 03-04-2008, a las 16:19, [EMAIL PROTECTED] escribió:


On 3 Apr '08, at 10:58 AM, Rob Napier wrote:


Apple reserves the use of leading underscores for it's own use:
While they append the phrase "especially in methods," they do mean
for everything, and you can collide with them if you name your own
identifiers (including instance variables) with leading underscores.


This issue came up several times while I was at Apple. The most recent
consensus (involving members of the Cocoa and compiler groups) was
that "_" prefixes for ivar names are mostly harmless, though they
should be avoided in method names. The reason is that ivar names are
less dynamic. If in the next OS release a system superclass of your
class adds an ivar with the same name, it's not a binary compatibility
problem (your class will continue to work, because its machine code
references the ivar as a numeric offset into the instance data, not by
name.) Whereas if a superclass adds a _method_ with the same name as
yours, all hell may break loose because your method will get called
instead.

Now, your code will break when you try to recompile it using the new
headers, because the compiler will complain about the ivar name
conflict. But then you just rename your ivar. It's a less serious
problem because it doesn't break any copies of the app that are out in
the field.


1. Leading underscores really will cause you to collide with Apple
and it really did blow up in my face.


Was it with a method or an ivar name?


3. XCode 3 now provides good color coding to distinguish ivars from
local vars.


I should try turning that specific color code on. I turned off all the
new Xcode 3 color coding because there were too many different colors
and it made the code look garish.


4. And besides, if you would use accessors properly, ivars should
very seldom show up in your code so you shouldn't have confusion
(this being the cause of #2 above).


I don't use accessors properly, then. ;) Method calls are so expensive
compared to ivar accesses that I don't use them for accessing instance
data, unless the accessor is nontrivial or the setter call is needed
to trigger KV notifications. (Also, I generally don't declare
properties for internal state that isn't part of the class's public
API.)

—Jens
-- next part --
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1875 bytes
Desc: not available
Url : 
http://lists.apple.com/pipermail/cocoa-dev/attachments/20080403/a3d0ef05/smime.bin



I just name the all my instance variables  "the_instance_var_" , and  
the local ones "theLocalVar", this keep me well informed about if X  
var is instance or local :).



Mario Gajardo Tassara
[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: core data - beyond the simple example

2008-04-04 Thread Quincey Morris


On Apr 4, 2008, at 16:31, Torsten Curdt wrote:


Got that working now ...except the predicate bug reported before.
It seems that when I add another object a new predicate is set.


And could that possibly be because [NSArrayController  
clearsFilterPredicateOnInsertion] defaults to YES like the  
documentation says?? :)



___

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

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

2008-04-04 Thread Torsten Curdt
I've followed some tutorials to get started but somehow I am a bit  
lost when I want to do some more complex things. This might  
actually be more because of bindings than because of core data. Or  
maybe I just did not look at the right place. Maybe you guys can  
give me some hints links and so on.


Most of your questions are about Cocoa Bindings or NSTableView  
(AppKit).  So those would be good technologies to look at,  
especially in developer.apple.com documentation.


The Core Data Programming Guide should give you a good idea about  
which technologies and classes lie within the Core Data framework,  
and which you should search out elsewhere.





I will definitely dig into that a bit more now that I got the little  
demo app working.
It's a bummer the headstart videos are only available with a non-free  
ADC membership.


Other links include  and  and   
and pretty much all their external links.


Uh ...didn't know hyperjeff. Nice collection of links!


I was also wondering ...what if we are talking about 1M objects (or
rows thinking of it in terms of a database). How does this scale?


If you're on 10.5, the framework can handle millions of rows.


Great.

Also I am wondering about migrations. When you change the data  
model and users upgrade the application. How can one define the  
migrations?


On 10.5, Core Data has both tools in Xcode, and classes in the  
framework for this.  They're called mapping models and  
NSMappingModel respectively.


Thanks, Ben!!

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: core data - beyond the simple example

2008-04-04 Thread Torsten Curdt


On Apr 4, 2008, at 18:38, I. Savant wrote:

Just think of something along the lines of

@interface MyObject : NSObject
{
   NSString *name;
   NSString *color;

}


 In this case, as I said, just do it the easier way first so you
understand what's involved. Then if you want a 'subview as a cell  
in a

table', you'll have a much easier time. To do it the simple way,
you'll need to make the necessary adjustments for your color column  
in

code.


 Come to think of it, if you're targeting Leopard and above, consider
using NSCollectionView. This is FAR better suited to the type of UI
you're describing. Sorry for missing that obvious bit.


Got that working now ...except the predicate bug reported before.
It seems that when I add another object a new predicate is set.

 ...for some reason.

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: core data - beyond the simple example

2008-04-04 Thread Torsten Curdt


On Apr 4, 2008, at 23:53, Jim Correia wrote:

On Apr 4, 2008, at 5:44 PM, Torsten Curdt wrote:


- (void)setFilter:(NSPredicate*)newFilter
{
if (filter != newFilter) {
[filter release];
filter = newFilter;
}
}

- (NSPredicate*)filter
{
return filter;
}


Is this the exact code you are using in your application? Your - 
setFilter: has a memory management bug... review the object  
ownership rules.


Thanks for pointing out. I was changing the method and a retain got  
lost in translation.


http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Articles/mmAccessorMethods.html

...but that's not the problem.

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: [MEET] April CocoaHeads Mac Developer Meetings

2008-04-04 Thread Scott Ellsworth
On Fri, Apr 4, 2008 at 1:41 PM, Stephen Zyszkiewicz
<[EMAIL PROTECTED]> wrote:

>  * Lake Forest, CA - Wednesday April 09, 2008 04:00 PM PST.

Database bug: we are meeting at 7pm.

Scott
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Can't add new file extension to app's document types

2008-04-04 Thread Rick Mann


On Apr 4, 2008, at 4:04 PM, Jerry Krinock wrote:
Rick, first of all let me admit that it really brightened up my day  
here to visualize the confidence with which you and this Apple  
engineer go "click" and expect the tools to "just work".  Thank you  
for that.


Seriously, though, although Xcode is pretty good, there are quite a  
few things that have to go on under the hood before an entry in that  
target properties inspector results in your app being able to open  
the corresponding file extension type.  Most notably, and this is a  
bug that I myself have filed previously, Xcode needs to preprocess  
and then rewrite your app's Info.plist file.  And although this  
operation probably takes about 5 milliseconds on a slow Mac, for  
some reason Apple chose to not make it a part of the Build process.   
It seems to only happen after you "clean" your target, and this  
might be your problem.


Look inside your product package's Contents/Info.plist at the  
CFBundleDocumentTypes key and see if you find your .gpx type  
listed.  If not, quit your app, "Clean" your project by clicking in  
menu ► Build ► Clean and wait a few seconds for it to "succeed".   
Then Build again (this will take some time) and it might work.


All that being said, if .gpx is still not in Info.plist, this is  
more of an Xcode than a Cocoa issue and you address any further  
comments to [EMAIL PROTECTED]



Thanks for responding, Jerry. I'm really quite stuck and getting  
nowhere.


Actually, I don't think it's Xcode's problem. It seems to build the  
Info.plist just fine. Also, using lsregister, I can see that something  
is registered for the .gpx extension (see below). It's clearly a Mac  
OS X issue, not an Xcode-specific issue, and I'm at a loss as to  
what's wrong.



bundle  id:156464
	path:  /Users/rmann/LZRepo/trackedit/trunk/xcode/build/Debug/ 
TrackEdit.app

name:  TrackEdit
identifier:com.latencyzero.TrackEdit (0x8001e2e8)
canonical id:  com.latencyzero.trackedit (0x8002d809)
version:   1
mod date:  4/2/2008 11:50:41
reg date:  4/2/2008 11:50:41
type code: 'APPL'
creator code:  ''
sys version:   10.5
flags:
	item flags:container  package  application  extension-hidden   
native-app  i386

icon:
executable:Contents/MacOS/TrackEdit
inode: 3191623
exec inode:3191640
container id:  32
library:
library items:

typeid:31060
uti:   com.latencyzero.trackedit.gpx
description:   GPX file format
flags: exported  inactive
icon:
conforms to:   public.data
tags:  .gpx, text/xml

claim   id:128492
name:
rank:  Default
roles: Editor
flags:
icon:
bindings:  com.latencyzero.trackedit.gpx





--
Rick

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How do I embed a font in an app?

2008-04-04 Thread Robert Claeson


On 5 Apr 2008, at 00:37, Jens Alfke wrote:
In my application's user interface I want to use some TrueType fonts  
which are not built into the OS. (Yes, they're free and their  
licenses allow this sort of use.) I thought I remembered a way to  
embed fonts in an application bundle, or to programmatically load a  
font from a file; but I'm drawing a blank now when I try to look it  
up.


It surely can be done. Apple's own iDVD application bundles a number  
of fonts under Resources/Fonts in the application bundle.


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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 do I embed a font in an app?

2008-04-04 Thread Buddy Kurz

I had some success with this -


-(void) loadFonts {
// Get the main bundle object
NSBundle * appBundle = [NSBundle mainBundle];
	NSString *fontsPath = [[appBundle resourcePath]  
stringByAppendingPathComponent:@"Fonts"];

if (fontsPath) {
NSURL *fontsURL = [NSURL fileURLWithPath:fontsPath];
if (fontsURL) {
// Using the Carbon APIs:  get a file reference and 
spec for the path

FSRef fsRef;
FSSpec fsSpec;
(void)CFURLGetFSRef((CFURLRef)fontsURL, &fsRef);
			OSStatus status = FSGetCatalogInfo(&fsRef, kFSCatInfoNone, NULL,  
NULL, &fsSpec, NULL);

if (status==noErr) {
//activate the font file using the file spec
status = ATSFontActivateFromFileSpecification (  
&fsSpec,
 
kATSFontContextLocal,

kATSFontFormatUnspecified,
NULL,

kATSOptionFlagsDefault,
 NULL
);
if (status != noErr) {
NSLog(@"Error %d loading fonts from 
%@",status,fontsURL);
}
} else {
NSLog(@"Error loading catalog info");
}
} else {
NSLog(@"Error creating fonts URL");
}
} else {
NSLog(@"Error creating fonts path");
}
}

On Apr 4, 2008, at 3:37 PM, Jens Alfke wrote:
In my application's user interface I want to use some TrueType fonts  
which are not built into the OS. (Yes, they're free and their  
licenses allow this sort of use.) I thought I remembered a way to  
embed fonts in an application bundle, or to programmatically load a  
font from a file; but I'm drawing a blank now when I try to look it  
up.


Surely I don't have to copy the fonts into the system (~/Library/ 
Fonts) like in the bad old days? :-P


—Jens___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


How do I embed a font in an app?

2008-04-04 Thread Jens Alfke
In my application's user interface I want to use some TrueType fonts  
which are not built into the OS. (Yes, they're free and their licenses  
allow this sort of use.) I thought I remembered a way to embed fonts  
in an application bundle, or to programmatically load a font from a  
file; but I'm drawing a blank now when I try to look it up.


Surely I don't have to copy the fonts into the system (~/Library/ 
Fonts) like in the bad old days? :-P


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: NSTask failing

2008-04-04 Thread Nir Soffer


On Apr 4, 2008, at 23:20, Randall Meadows wrote:


NSArray *args = [NSArray arrayWithObjects:
   @"-cf",
   [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
   [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
   nil];




Try:
	NSArray *args = [NSArray arrayWithObjects:@"-cf", tarFilePath,  
plistPath, nil];


You don't need to quote anything you feed to NSTask. Your code is  
equivalent to this wrong shell script:


tar -cf "\"tarFilePath\"" "\"plistPath\""


Best Regards,

Nir Soffer

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: activate my application while dragging on other application window

2008-04-04 Thread Andrew Farmer

On 04 Apr 08, at 10:12, Hamish Allan wrote:

On Thu, Apr 3, 2008 at 3:47 PM, Jens Alfke <[EMAIL PROTECTED]> wrote:
By "any other application window", do you mean a window belonging  
to a
_different_ application other than your own? There's no way to do  
that. As I

said, applications aren't allowed to mess with each other's windows.


Is this really true? I was under the impression that Exposé was
handled by Dock.app.


It's true in the general case. Dock.app just has special privileges  
with WindowServer which allow it to modify other applications' windows.___


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

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

2008-04-04 Thread Randall Meadows

On Apr 4, 2008, at 3:52 PM, Hamish Allan wrote:
On Fri, Apr 4, 2008 at 10:43 PM, Randall Meadows <[EMAIL PROTECTED] 
pc.com> wrote:



I assume there was supposed to be a [tarTask launch] in there  
somewhere,

eh?  :)


If you like :)

Now, I have no idea how I'm goint to detect an ACTUAL error  
condition;


You could just connect the resultsPipe to stderr, and scan for "error"
or similar.


I was able to use -setCurrentDirectoryPath: to something that doesn't  
require me to pass full paths of files, and now the result code is 0.   
So, problem solved, except for that whole "I finished successfully,  
but I'm going to tell you I died anyway" drama...


Thanks for everyone's help!
randy
___

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

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

2008-04-04 Thread Jim Correia

On Apr 4, 2008, at 5:44 PM, Torsten Curdt wrote:


- (void)setFilter:(NSPredicate*)newFilter
{
if (filter != newFilter) {
[filter release];
filter = newFilter;
}
}

- (NSPredicate*)filter
{
return filter;
}


Is this the exact code you are using in your application? Your - 
setFilter: has a memory management bug... review the object ownership  
rules.


Jim

___

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

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

2008-04-04 Thread Hamish Allan
On Fri, Apr 4, 2008 at 10:43 PM, Randall Meadows <[EMAIL PROTECTED]> wrote:


>  I assume there was supposed to be a [tarTask launch] in there somewhere,
> eh?  :)

If you like :)

>  Now, I have no idea how I'm goint to detect an ACTUAL error condition;

You could just connect the resultsPipe to stderr, and scan for "error"
or similar.

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSTask failing

2008-04-04 Thread Randall Meadows

On Apr 4, 2008, at 3:40 PM, Peter Maurer wrote:
I've tried making the arguments only 1 entry in the array, and the  
same thing; I've both quoting and not quoting the arguments, and  
the same thing; I've tried using a dash with the options and  
without, and the same thing--always status=2 (fatal error).


You should unquote those paths, because ...


Done.

As far as getting that error 2 for unquoted paths is concerned, it  
would definitely be interesting to see whether logging your  
arguments to the console yields the exact same paths you've used  
when doing this successfully in Terminal.


I'm actually *copying* the 'po args' output in my Xcode console to the  
Terminal window where I'm entering the command, so I'm pretty sure  
they're the same! :)


See my other message for the "resolution" to this problem.

___

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

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

2008-04-04 Thread Torsten Curdt


On Apr 4, 2008, at 22:49, I. Savant wrote:

I already have implemented KVC according to


 ... you didn't include the actual implementation in your code
listing, so we're forced to take your word for it. Therefore, I
conclude that your assertion is false. ;-)


- (void)setFilter:(NSPredicate*)newFilter
{
if (filter != newFilter) {
[filter release];
filter = newFilter;
}
}

- (NSPredicate*)filter
{
return filter;
}


 Post your code so list members can verify. The day's over for me and
I face a long commute to my home in the middle of nowhere, so
hopefully someone else can answer the call ...


Thanks for you help.

cheers
--
Torsten

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSTask failing

2008-04-04 Thread Randall Meadows

On Apr 4, 2008, at 3:14 PM, Hamish Allan wrote:
NSArray *args = [NSArray arrayWithObjects: @"cfv", tarFilePath,  
plistPath, nil];

tarTask = [[[NSTask alloc] init] autorelease];
[tarTask setLaunchPath:@"/usr/bin/tar"];
[tarTask setArguments:args];
NSPipe *resultsPipe = [NSPipe pipe];
NSFileHandle *resultsHandle = [resultsPipe fileHandleForReading];
[tarTask setStandardOutput:resultsPipe];
[tarTask setStandardError:resultsPipe];
NSData *data;
while ([((data = [resultsHandle availableData])) length] > 0)
{
   NSString *s = [[NSString alloc] initWithData:data
encoding:NSASCIIStringEncoding];
   NSLog(s);
}
[tarTask waitUntilExit];


I assume there was supposed to be a [tarTask launch] in there  
somewhere, eh?  :)


I am getting back a message: "/usr/bin/tar: Removing leading `/' from  
member names"


I get that on the command line, too, but at least there, the result  
code is 0.


And, as it turns out, without the quoted arguments, the task IS  
SUCCESSFUL!  WTH it is returning a FATAL ERROR as a result code is  
beyond me.  I had stopped looking in the Finder for the file when the  
result code was consistently returning 2 (DOH!).


Now, I have no idea how I'm goint to detect an ACTUAL error condition;  
I'm going to be subsequently adding to this tar archive, and if every  
frickin' successful operation on it returns a fatal error, how do I  
detect the unsuccessful fatal errors? :)

___

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

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

2008-04-04 Thread Peter Maurer
I've tried making the arguments only 1 entry in the array, and the  
same thing; I've both quoting and not quoting the arguments, and the  
same thing; I've tried using a dash with the options and without,  
and the same thing--always status=2 (fatal error).


You should unquote those paths, because ...


I do something very similar.  The only difference is I'm not
constructing a path via stringWithFormat.  I'm using either NSString's
"fileSystemRepresentation" [...]


... NSTask does that for you automatically -- see the documentation on  
-setArguments: and +launchedTaskWithLaunchPath:arguments:. So the  
additional quotes might actually make NSTask -- or, more precisely:  
[NSString fileSystemRepresentation] -- choke on your paths. (I haven't  
ever tested this, though. Maybe NSTask is smart enough to strip those  
superfluous quotes if necessary.)


As far as getting that error 2 for unquoted paths is concerned, it  
would definitely be interesting to see whether logging your arguments  
to the console yields the exact same paths you've used when doing this  
successfully in Terminal.


Peter.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enterFullScreenMode trouble

2008-04-04 Thread slasktrattenator
Thanks for the reply. Actually I read those posts already, that's why
I threw out the question here to see if someone could confirm it's a
bug. Guess I'll have to revert to setting up the full screen
environment manually.

On Fri, Apr 4, 2008 at 11:24 PM, Sean McBride <[EMAIL PROTECTED]> wrote:
>
> On 4/4/08 5:28 PM, [EMAIL PROTECTED] said:
>
>  >I'm having a small problem with NSView's
>  >enterFullScreenMode:withOptions: method. The windowed view handles
>  >keyboard events by overriding keyDown:, but once I enter fullscreen
>  >mode it stops receiving these events, all I get is a NSBeep. I have
>  >correctly set the new fullscreen window's delegate and made sure the
>  >fullscreen view is the first responder, but to no avail. What am I
>  >missing?
>
>  Probably nothing.  :(  NSView's fullscreen API is quite broken, you've
>  probably just found another example.  You might search the archives for
>  other reasons to avoid that API.
>
>  --
>  
>  Sean McBride, B. Eng [EMAIL PROTECTED]
>  Rogue Researchwww.rogue-research.com
>  Mac Software Developer  Montréal, Québec, Canada
>
>
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: enterFullScreenMode trouble

2008-04-04 Thread Sean McBride
On 4/4/08 5:28 PM, [EMAIL PROTECTED] said:

>I'm having a small problem with NSView's
>enterFullScreenMode:withOptions: method. The windowed view handles
>keyboard events by overriding keyDown:, but once I enter fullscreen
>mode it stops receiving these events, all I get is a NSBeep. I have
>correctly set the new fullscreen window's delegate and made sure the
>fullscreen view is the first responder, but to no avail. What am I
>missing?

Probably nothing.  :(  NSView's fullscreen API is quite broken, you've
probably just found another example.  You might search the archives for
other reasons to avoid that API.

--

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

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableArray removeObject: crash

2008-04-04 Thread Peter Maurer

0   libobjc.A.dylib 0x92d066f9 objc_msgSend 
+ 41
1   com.apple.CoreFoundation  	0x96d4b720 -[NSMutableArray  
removeObject:] + 96


This could also be due to another over-released object in the array  
(which is accessed via -isEqual: or something similar during - 
removeObject:) -- as opposed to your notification's object, i.e. the  
object you're removing from the array.


At least that's what had happened to me in a similar case, and it took  
me a while to realize that the object I was trying to remove wasn't to  
blame.


Peter.
___

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

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

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

This email sent to [EMAIL PROTECTED]


re: core data - beyond the simple example

2008-04-04 Thread Ben Trumbull

Torsten,

I've followed some tutorials to get started but somehow I am a bit 
lost when I want to do some more complex things. This might actually 
be more because of bindings than because of core data. Or maybe I just 
did not look at the right place. Maybe you guys can give me some hints 
links and so on.


Most of your questions are about Cocoa Bindings or NSTableView 
(AppKit).  So those would be good technologies to look at, especially 
in developer.apple.com documentation.


The Core Data Programming Guide should give you a good idea about 
which technologies and classes lie within the Core Data framework, 
and which you should search out elsewhere.




Other links include  and 
 and 
 and 
pretty much all their external links.



I was also wondering ...what if we are talking about 1M objects (or
rows thinking of it in terms of a database). How does this scale?


If you're on 10.5, the framework can handle millions of rows.  It is 
of course necessary to restrict your UI classes to only showing the 
user as much data as a human being can process (not much) and to be 
careful about controlling the high watermark of your memory usage.


On 10.5, the NSArrayController has a "Use Lazy Fetching" option which 
can assist you with this.


Also I am wondering about migrations. When you change the data model 
and users upgrade the application. How can one define the migrations?


On 10.5, Core Data has both tools in Xcode, and classes in the 
framework for this.  They're called mapping models and NSMappingModel 
respectively.

--

-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: NSTask failing

2008-04-04 Thread Michael Vannorsdel
The error 2 means tar is not happy with one of both provided paths.   
Try printing out both paths and make sure they're proper.  Paths  
passed to NSTask should not have escapes such as "/Some\ Folder/ 
file.tar", it should be "/Some Folder/files.tar".



On Apr 4, 2008, at 3:00 PM, Randall Meadows wrote:


On 04/04/2008, Randall Meadows <[EMAIL PROTECTED]> wrote:

NSArray *args = [NSArray arrayWithObjects:
 @"-cf",
 [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
 [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
 nil];
tarTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/tar"
arguments:args];
[tarTask waitUntilExit];
int status = [tarTask terminationStatus];


I do something very similar.  The only difference is I'm not
constructing a path via stringWithFormat.  I'm using either  
NSString's

"fileSystemRepresentation" or NSURL's "path" method to get a well
formed path to pass in as a parameter...

So I wonder what your stringWithFormat results actually look like.


___

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

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

2008-04-04 Thread Adam Gerson
It does work. I have defined a core data entity that conforms to
IKBrowerItem protocol and my IKImageBrowserView is working with
bindings. I think you still need to point the delegate and data source
outlets to an object that implements the datasource methods:



// -
//  numberOfItemsInImageBrowser:view
// -
- (int)numberOfItemsInImageBrowser:(IKImageBrowserView*)view
{
// The item count to display is the datadsource item count.
return [[imageBrowserArrayController arrangedObjects] count];
}

// -
//  imageBrowser:view:index:
// -
- (id)imageBrowser:(IKImageBrowserView *) view itemAtIndex:(int) index
{
return [[imageBrowserArrayController arrangedObjects] objectAtIndex:index];
}


// Implement some optional methods of the image browser  datasource
protocol to allow for removing and reodering items.

// -
//  removeItemsAtIndexes:
//
//  The user wants to delete images, so remove these entries from the
data source.
// -
- (void)imageBrowser:(IKImageBrowserView*)view removeItemsAtIndexes:
(NSIndexSet*)indexes
{
[imageBrowserArrayController 
removeObjectsAtArrangedObjectIndexes:indexes];
}


On Fri, Apr 4, 2008 at 1:01 AM, Steve Weller <[EMAIL PROTECTED]> wrote:
>
>  I am attempting to use bindings to supply an IKImageBrowserView with data.
> I have successfully used IKImageBrowserView with a data source, but cannot
> get bindings to work. Should it work with bindings?
>
>  The array controller's contentArray is hooked up to an NSMutableArray
> called storedImages. That contains instances of storedImage. And those have
> a method browserObject that returns instances of an object that implements
> the IKBrowerItem protocol to fetch and display an image (uid, path, etc).
>
>  The Image Kit browser is bound to the array controller's arranged objects
> with the model key path browserObject. It is set to automatically prepare
> content.
>
>  I get no images displayed even though there are plenty in the storedImages
> array. I am telling the browser view to reload its data.
>
>  If I set a breakpoint at browserObject, it is never hit. So it looks like
> the array controller is never attempting to read my model. I get no errors
> when loading my nib.
>
>
>  --
>  Blog:  http://www.bagelturf.com/   Photos: http://bagelturf.smugmug.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/agersonl%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: NSTask failing

2008-04-04 Thread Hamish Allan
On Fri, Apr 4, 2008 at 9:20 PM, Randall Meadows <[EMAIL PROTECTED]> wrote:

>  NSArray *args = [NSArray arrayWithObjects:
>@"-cf",
>[NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
>[NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
>nil];
>  tarTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/tar"
> arguments:args];
>  [tarTask waitUntilExit];
>  int status = [tarTask terminationStatus];

Try:

NSArray *args = [NSArray arrayWithObjects: @"cfv", tarFilePath, plistPath, nil];
tarTask = [[[NSTask alloc] init] autorelease];
[tarTask setLaunchPath:@"/usr/bin/tar"];
[tarTask setArguments:args];
NSPipe *resultsPipe = [NSPipe pipe];
NSFileHandle *resultsHandle = [resultsPipe fileHandleForReading];
[tarTask setStandardOutput:resultsPipe];
[tarTask setStandardError:resultsPipe];
NSData *data;
while ([((data = [resultsHandle availableData])) length] > 0)
{
NSString *s = [[NSString alloc] initWithData:data
encoding:NSASCIIStringEncoding];
NSLog(s);
}
[tarTask waitUntilExit];
___

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

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

2008-04-04 Thread Herb Petschauer
On 04/04/2008, Randall Meadows <[EMAIL PROTECTED]> wrote:
> > So I wonder what your stringWithFormat results actually look like.
> >
>
>  Just as you'd expect; something like
>
>  "/Users/randy/Desktop/file.tar"
>
>  I did the stringWithFormat: merely to quote the path, but upon reading the
> docs further, it appears this quoting is unnecessary, so I removed it and
> just add the variables to the args array directly.  I still get the
> status=2.
>
>
> > Hey wait... why does your tarFilePath end with a "/",
> >
>
>  I don't know what you mean...it doesn't.  There are \ characters in the
> code, they are merely to quote the double-quotes within the format string
> for the compiler, but there are no trailing slashes.
>
>
> > Do try the fileSystemRepresentation method :-)
> >
>
>  tarFilePath and plistPath are used extensively elsewhere as naked NSStrings
> with no problem.  But I tried, anyway.
>
>  Since fSR returns a const char *, I had to wrap that in an NSString anway,
> and the result looks *exactly* like the bare NSString to begin with.  And
> yes, the result of using fSR is:
>
>  status=2
>
>  Still.  :(
>

Damn, missed the double quotes.  :-)

- Log your params and reproduce the full command in a Terminal window.
- I don't think you have to worry about quoting your paths because
NSTask takes care of that for you (i.e. it's NOT calling system()
under the hood).
- install an output pipe:

NSPipe  *pOutputPipe = nil;
...
pOutputPipe = [NSPipe pipe];
[pNSTask setStandardOutput:pOutputPipe];

pOutputFileHandle = [pOutputPipe fileHandleForReading];
pResultsString = [[NSString alloc] initWithData:[pOutputFileHandle
readDataToEndOfFile]
encoding: NSUTF8StringEncoding];

NSLog( pResultsString );
[pResultsString release];


[Forgive the Hungarian notation, I kind of like it :-) Copied/pasted
and unverified]

Good luck.  Cheers,
-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: NSTask failing

2008-04-04 Thread Randall Meadows

On Apr 4, 2008, at 2:56 PM, Nir Soffer wrote:


On Apr 4, 2008, at 23:20, Randall Meadows wrote:

NSArray *args = [NSArray arrayWithObjects:
   @"-cf",
   [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
   [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
   nil];



Try:
	NSArray *args = [NSArray arrayWithObjects:@"-cf", tarFilePath,  
plistPath, nil];


You don't need to quote anything you feed to NSTask. Your code is  
equivalent to this wrong shell script:


tar -cf "\"tarFilePath\"" "\"plistPath\""


As I stated in my OP, I did try them unquoted, with the same result.
___

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

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

2008-04-04 Thread Randall Meadows

On Apr 4, 2008, at 2:36 PM, Herb Petschauer wrote:

On 04/04/2008, Randall Meadows <[EMAIL PROTECTED]> wrote:

NSArray *args = [NSArray arrayWithObjects:
  @"-cf",
  [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
  [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
  nil];
tarTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/tar"
arguments:args];
[tarTask waitUntilExit];
int status = [tarTask terminationStatus];


I do something very similar.  The only difference is I'm not
constructing a path via stringWithFormat.  I'm using either NSString's
"fileSystemRepresentation" or NSURL's "path" method to get a well
formed path to pass in as a parameter...

So I wonder what your stringWithFormat results actually look like.


Just as you'd expect; something like

"/Users/randy/Desktop/file.tar"

I did the stringWithFormat: merely to quote the path, but upon reading  
the docs further, it appears this quoting is unnecessary, so I removed  
it and just add the variables to the args array directly.  I still get  
the status=2.



Hey wait... why does your tarFilePath end with a "/",


I don't know what you mean...it doesn't.  There are \ characters in  
the code, they are merely to quote the double-quotes within the format  
string for the compiler, but there are no trailing slashes.



Do try the fileSystemRepresentation method :-)


tarFilePath and plistPath are used extensively elsewhere as naked  
NSStrings with no problem.  But I tried, anyway.


Since fSR returns a const char *, I had to wrap that in an NSString  
anway, and the result looks *exactly* like the bare NSString to begin  
with.  And yes, the result of using fSR is:


status=2

Still.  :(
___

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

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

2008-04-04 Thread I. Savant
>  I already have implemented KVC according to

  ... you didn't include the actual implementation in your code
listing, so we're forced to take your word for it. Therefore, I
conclude that your assertion is false. ;-)

  Post your code so list members can verify. The day's over for me and
I face a long commute to my home in the middle of nowhere, so
hopefully someone else can answer the call ...

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


[MEET] April CocoaHeads Mac Developer Meetings

2008-04-04 Thread Stephen Zyszkiewicz

Greetings,

CocoaHeads is an international Mac programmer's group.  We specialize
in Cocoa, but everything Mac programming related is welcome.

Why Should I Attend?
Meeting other Mac OS X developers in person is both fun and immensely
useful. There's no better way to learn Cocoa or get help with problems
than being around other people who are writing Mac software.

We usually have several Cocoa experts hanging around that are happy to
answer whatever questions they can. Bring your laptop and any code
you're working on.

Everyone is Welcome
Meetings are free and open to the public. Feel free to drop in even if
you've never attended or aren't currently using Cocoa. We usually have
a few new faces, so don't worry about being the odd one out.

Upcoming meetings:
* Boulder, CO - Tuesday April 08, 2008 07:00 PM MDT.
* Colorado Springs, CO - Thursday April 10, 2008 07:00 PM MST.
* Des Moines, IA - Thursday April 10, 2008 07:00 PM CST.
* Glasgow, Scotland - Thursday April 24, 2008 08:00 PM BST.
* Lake Forest, CA - Wednesday April 09, 2008 04:00 PM PST.
* Melbourne, Australia - Thursday April 10, 2008 06:00 PM AEST.
* New York, NY - Thursday April 10, 2008 06:00 PM EST.
* Portland, OR - Wednesday April 09, 2008 06:00 PM PST.
* Silicon Valley, CA - Thursday April 10, 2008 07:30 PM PST.
* Singapore - Friday April 11 7:00 PM. 
* Tokyo, Japan - Saturday April 12, 2008 01:00 PM JST.
* Toronto, ON - Tuesday April 08, 2008 06:30 PM EST.

Please check the web site at  for more
information including last-minute changes.


Steve
Silicon Valley CocoaHeads

___

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

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

2008-04-04 Thread Herb Petschauer
On 04/04/2008, Randall Meadows <[EMAIL PROTECTED]> wrote:
> I'm having problems with what should be a simple NSTask invocation:
>
>  NSArray *args = [NSArray arrayWithObjects:
>@"-cf",
>[NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
>[NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
>nil];
>  tarTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/tar"
> arguments:args];
>  [tarTask waitUntilExit];
>  int status = [tarTask terminationStatus];
>
>  After all that, status = 2.
>
>  I've tried making the arguments only 1 entry in the array, and the same
> thing; I've both quoting and not quoting the arguments, and the same thing;
> I've tried using a dash with the options and without, and the same
> thing--always status=2 (fatal error).
>
>  tarFilePath and plistPath are full paths, and valid ones at that.
>
>  I can take the contents of all that and do it on the command line and that
> works.  What in the world am I missing here that is causing it to fail?

I do something very similar.  The only difference is I'm not
constructing a path via stringWithFormat.  I'm using either NSString's
"fileSystemRepresentation" or NSURL's "path" method to get a well
formed path to pass in as a parameter...

So I wonder what your stringWithFormat results actually look like.

Hey wait... why does your tarFilePath end with a "/", isn't that the
equivalent of doing a

tar cf ~/tmp/archive.tar/ /{blah}/SourceFolder/

???

That will bork for sure...  Also are you sure that plistPath  is a
directory?  It will sure look that way to "tar".

Do try the fileSystemRepresentation method :-)

Cheers,
-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: core data - beyond the simple example

2008-04-04 Thread Hamish Allan
On Fri, Apr 4, 2008 at 5:21 PM, Torsten Curdt <[EMAIL PROTECTED]> wrote:

>  Just think of something along the lines of
>
>  @interface MyObject : NSObject
>  {
> NSString *name;
> NSString *color;
>
>  }

Take a look at 
/Developer/Examples/AppKit/DragNDropOutlineView/ImageAndTextCell.[hm]

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableArray removeObject: crash

2008-04-04 Thread Kevin Wojniak

On Apr 4, 2008, at 4:18 PM, Shawn Erickson wrote:

What are the exception codes for this "crash". Are you sure it is a
crash and not a report of runtime exception? (aka the notifications
object is nil)

Are you somehow over releasing the object that posts the notification
(aka the self used at time of posting the notification)?

-Shawn


It is showing up as KERN_INVALID_ADDRESS. I don't release "self" until  
after (not immediately) the notification is sent.




On Apr 4, 2008, at 4:21 PM, Hamish Allan wrote:
On Fri, Apr 4, 2008 at 9:08 PM, Kevin Wojniak <[EMAIL PROTECTED]>  
wrote:



  [_array removeObject:obj];


Are you sure _array is valid and properly retained?

Hamish


I was thinking about this. However, I have looked through the code and  
_array doesn't get released until the class deallocs, and that doesn't  
happen until the app quits, and the crash isn't occurring when the app  
quits. But I might switch it over to using an accessor that retains/ 
autoreleases the object instead of accessing it directly. Would  
probably be safer altogether.




On Apr 4, 2008, at 4:23 PM, A.M. wrote:
You should verify that the object is valid. You could do this simply  
by setting a breakpoint before removeObject and printing the object  
description to the console. If that crashes, then the object is  
invalid. Then print out the _array-if that crashes, your array is  
invalid. In any case, try NSZombieEnabled.


Cheers,
M


Unfortunately I can't duplicate the crash myself (although with the  
previous replies I have a few ideas on how I could).



Kevin
___

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

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

2008-04-04 Thread Shawn Erickson
On Fri, Apr 4, 2008 at 12:08 AM, Mike <[EMAIL PROTECTED]> wrote:

>  If that is the case then why does the progress bar get updated with the
> correct value every time when I insert the sleep( 1 ) call? Obviously it
> wouldn't be displaying the correct value if garbage was being sent to the
> selector.

Please post a complete example that shows this issue and/or more of
your code that has this problem... otherwise we will just keep talking
past each other.

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: core data - beyond the simple example

2008-04-04 Thread Torsten Curdt

Any thoughts on that?


 Yes. Remember the prerequisites I mentioned?


4 - Bindings (and probably the required KVC/KVO concepts).




 This means "Key Value Coding" / "Key Value Observing". Lack of
proper KVO encapsulation is most likely the cause.


I already have implemented KVC according to

http://developer.apple.com/documentation/Cocoa/Conceptual/KeyValueCoding/Concepts/Compliant.html#/ 
/apple_ref/doc/uid/20002172


@interface AppDelegate : NSObject
{
...
NSPredicate *filter;
}

- (void)setFilter:(NSPredicate*)filter;
- (NSPredicate*)filter;
...

IIUC this should also bring Automatic Key-Value Observing. So...

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSMutableArray removeObject: crash

2008-04-04 Thread Hamish Allan
On Fri, Apr 4, 2008 at 9:08 PM, Kevin Wojniak <[EMAIL PROTECTED]> wrote:

> >[_array removeObject:obj];

Are you sure _array is valid and properly retained?

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSTask failing

2008-04-04 Thread Randall Meadows

I'm having problems with what should be a simple NSTask invocation:

NSArray *args = [NSArray arrayWithObjects:
   @"-cf",
   [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", tarFilePath],
   [NSString stringWithFormat:@"\"[EMAIL PROTECTED]"", plistPath],
   nil];
tarTask = [NSTask launchedTaskWithLaunchPath:@"/usr/bin/tar"  
arguments:args];

[tarTask waitUntilExit];
int status = [tarTask terminationStatus];

After all that, status = 2.

I've tried making the arguments only 1 entry in the array, and the  
same thing; I've both quoting and not quoting the arguments, and the  
same thing; I've tried using a dash with the options and without, and  
the same thing--always status=2 (fatal error).


tarFilePath and plistPath are full paths, and valid ones at that.

I can take the contents of all that and do it on the command line and  
that works.  What in the world am I missing here that is causing it to  
fail?

___

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

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

2008-04-04 Thread Shawn Erickson
On Fri, Apr 4, 2008 at 1:08 PM, Kevin Wojniak <[EMAIL PROTECTED]> wrote:
> I am getting a report of a crash with a stack trace ending like this:
>
>
> > 0   libobjc.A.dylib 0x92d066f9
> objc_msgSend + 41
> > 1   com.apple.CoreFoundation0x96d4b720 -[NSMutableArray
> removeObject:] + 96
> >
>
>
>  Generally, when there are specifics like this I can fix the crash pretty
> easily. However, with this I'm stumped.

What are the exception codes for this "crash". Are you sure it is a
crash and not a report of runtime exception? (aka the notifications
object is nil)

Are you somehow over releasing the object that posts the notification
(aka the self used at time of posting the notification)?

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Apple support incidents

2008-04-04 Thread Shawn Erickson
On Fri, Apr 4, 2008 at 12:48 PM, Stebel Wolfram <[EMAIL PROTECTED]> wrote:
> Hi all,
>
>  i wondered if somebody sells it's unused apple support incidents of adc
> membership and just tried it on ebay.
>  Look there if you need cheap support incidents.

Selling / trading incidents like that is breach of the ADC account agreement.

"3. Transfer Of Membership Benefits And Materials.  Except as
otherwise prohibited herein, the
benefits and materials, including but not limited to seed keys, seed
DVDs, technical support incidents,
hardware discounts, and pre-release software (collectively "ADC
Materials"), provided to you as an ADC
program member may be transferred only to employees and contractors
working for the same entity as
you who have an existing ADC membership. You agree that you will not
otherwise transfer, publish,
copy, or disseminate such ADC Materials. Please refer to our "How To
Transfer Assets" FAQ at
developer.apple.com/faq/transfer.html for more information on the
authorized methods of transferring
ADC Materials.  "

-Shawn
___

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

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

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

This email sent to [EMAIL PROTECTED]


[moderator] Re: Apple support incidents

2008-04-04 Thread Scott Anguish

All

Using cocoa-dev to sell items on ebay (or elsewhere) is inappropriate  
and will not be tolerated.



Thanks

Scott (moderator)

On Apr 4, 2008, at 3:48 PM, Stebel Wolfram wrote:

Hi all,

i wondered if somebody sells it's unused apple support incidents of  
adc membership and just tried it on ebay.

Look there if you need cheap support incidents.


___

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

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


NSMutableArray removeObject: crash

2008-04-04 Thread Kevin Wojniak

I am getting a report of a crash with a stack trace ending like this:


0   libobjc.A.dylib 0x92d066f9 objc_msgSend 
+ 41
1   com.apple.CoreFoundation  	0x96d4b720 -[NSMutableArray  
removeObject:] + 96



Generally, when there are specifics like this I can fix the crash  
pretty easily. However, with this I'm stumped.


The code where it's crashing is very simple and looks like this:


- (void)handleNotification:(NSNotification *)notification
{
id obj = [notification object];
[_array removeObject:obj];
}


And it's being sent via a simple:

[[NSNotificationCenter defaultCenter] postNotificationName:someName  
object:self];


My guess is the notification object is corrupted (possibly  
deallocated?).


This is all happening on the main thread by the way.

Any advice would be appreciated.

Thanks,
Kevin
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Apple support incidents

2008-04-04 Thread Dave Hersey
I didn't see those, but there are some great deals on ProDOS and  
Beagle Bros. software!  Even a CP/M card for a steal!


   ; )

On Apr 4, 2008, at 3:48 PM, Stebel Wolfram wrote:

Hi all,

i wondered if somebody sells it's unused apple support incidents of  
adc membership and just tried it on ebay.

Look there if you need cheap support incidents.

Wolfram


___

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

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


Apple support incidents

2008-04-04 Thread Stebel Wolfram

Hi all,

i wondered if somebody sells it's unused apple support incidents of  
adc membership and just tried it on ebay.

Look there if you need cheap support incidents.

Wolfram

___

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

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

2008-04-04 Thread I. Savant
On Fri, Apr 4, 2008 at 3:39 PM, Torsten Curdt <[EMAIL PROTECTED]> wrote:
> OK ...so predicate filter I got working - sort of. I've bound the predicate
> in the AppDelegate to the NSArrayController. When I start up the application
> it filters just fine.
>  I've also got the "add" and "remove" actions bound to buttons. But as soon
> as I call "add" the filtered objects re-appear and the predicate seems to
> get not applied anymore.
>
>  Any thoughts on that?

  Yes. Remember the prerequisites I mentioned?

> 4 - Bindings (and probably the required KVC/KVO concepts).


  This means "Key Value Coding" / "Key Value Observing". Lack of
proper KVO encapsulation is most likely the cause.

>  As for the table cell Creating a custom table cell doesn't seem to be a
> big deal. But if I want to layout the controls through IB it seems I either
> need to get the SubviewTable thing working with bindings or just go Leopard
> and use NSCollectionView. There seems to be quite a good example available.

  Yes.

--
I.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: core data - beyond the simple example

2008-04-04 Thread Torsten Curdt
OK ...so predicate filter I got working - sort of. I've bound the  
predicate in the AppDelegate to the NSArrayController. When I start up  
the application it filters just fine.
I've also got the "add" and "remove" actions bound to buttons. But as  
soon as I call "add" the filtered objects re-appear and the predicate  
seems to get not applied anymore.


Any thoughts on that?

@implementation AppDelegate

- (id) init {
self = [super init];
if (self) {
NSExpression *lhs = [NSExpression expressionForKeyPath:@"Name"];
		NSExpression *rhs = [NSExpression  
expressionForConstantValue:@"test2"];


		NSPredicate *predicate = [NSComparisonPredicate  
predicateWithLeftExpression:lhs

rightExpression:rhs

modifier:NSDirectPredicateModifier

type:NSNotEqualToPredicateOperatorType


options:0];
[self setFilter:predicate];
}


As for the table cell Creating a custom table cell doesn't seem to  
be a big deal. But if I want to layout the controls through IB it  
seems I either need to get the SubviewTable thing working with  
bindings or just go Leopard and use NSCollectionView. There seems to  
be quite a good example available.


 http://developer.apple.com/samplecode/SourceView/index.html

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSRect for intertion point in NSTokenField (or NSTextField)

2008-04-04 Thread Justin Hawkwood
I'm working on making a NSTokenField inside of a NSScrollView work  
properly so that keying through the tokens adjusts the scroll view to  
keep the insertion point visible.  I've subclassed NSTokenField and am  
catching the textViewDidChangeSelection: notification, but I don't  
know how to find the rect for the insertion point (or selectedRange).   
With that, I could then call


[self scrollRectToVisible:insertionRect];

and the scrollView would do the rest.

So, is there something obvious I'm missing that does this?  If not,  
since the tokenfield wraps, is there a way to find out what line the  
insertion point is on so that I can calculate the rect?


Thanks.

~ Justin Hawkwood
___

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

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

2008-04-04 Thread Matt Neuburg
On Thu, 03 Apr 2008 17:08:56 -0600, Scott Ribe <[EMAIL PROTECTED]>
said:
>> But having an app explicitly
>> and automatically mark documents it saves as opening in itself can get
>> frustrating for the user.
>
>How so? It seems the most reasonable default. I really don't see end users
>saving a file from one app, and expecting it to automatically open with a
>different app. In fact, that seems like it would be rather surprising
>behavior.

Indeed, the problem is that that is exactly what *does* happen, e.g. a .rb
file saved with TextMate opens when double-clicked with Xcode or Coda,
behavior that drives me insane. I wish TextMate *would* mark files it
creates as belonging to itself. Some apps (e.g. Script Debugger, which deals
in .scpt files that might also be opened by Script Editor) make this a pref;
that seems reasonable behavior. m.

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




___

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

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

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

This email sent to [EMAIL PROTECTED]


[Moderator] Re: Need for a creator code?

2008-04-04 Thread Scott Anguish

OK, time to shut this one down folks.

We've been down this road far too many times in the past.



On Apr 4, 2008, at 2:06 PM, Scott Ribe wrote:

When I save a JPEG file in an image editing app, and later open it, I
expect it to open in Preview (or whatever my default image viewer  
is),

not the image editing app.


When I *create* an image in an image editing app and later open it,  
I expect
it to open in the app with which I created it, and I think most  
users really
do expect the same behavior as well. I won't participate in a long  
contest
on this subject, but I do work directly and extensively with end  
users, and
think you are just simply wrong on this point--it surprises users to  
create

a document, later double-click it, and have it open in a different
application.


___

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

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

2008-04-04 Thread Scott Ribe
> When I save a JPEG file in an image editing app, and later open it, I
> expect it to open in Preview (or whatever my default image viewer is),
> not the image editing app.

When I *create* an image in an image editing app and later open it, I expect
it to open in the app with which I created it, and I think most users really
do expect the same behavior as well. I won't participate in a long contest
on this subject, but I do work directly and extensively with end users, and
think you are just simply wrong on this point--it surprises users to create
a document, later double-click it, and have it open in a different
application.

Rephrase your argument just a bit, 2 ways: "When I save a DOC file in
Microsoft Word and later open it, I expect it to open in TextEdit (or
whatever my default text viewer is)..." *OR* "When I save an RTF file in
TextEdit and later open it, I expect it to open in Microsoft Word (or
whatever my default RTF viewer is)... Uhhhm, no, or if you do expect that
then you think somewhat differently than the majority of your end users ;-)

> This is especially true if someone else
> opens the image...
> ...but since most uses of documents
> over time tend to be to view, using the user's default viewing app is
> a more reasonable default.

Yes, if I'm creating an image for distribution to people who will mostly
only view the media, then I *might* need to strip (or modify) the creator
code before distributing the file.

> ...but since most uses of documents
> over time tend to be to view...

That really, really sticks out for 2 reasons: 1) for the person creating the
documents, that's not so true and 2) it really hints at the MS/media cartel
attitude that users are, or ideally should be, mere passive consumers...

> As I mentioned, users can override this if they wish for individual
> documents, through Finder.

Which is a pain in the ass. How often do you really think users create a
document in one go and never edit it again??? For the documents that users
actually create, rather than consume, they edit them quite often--usually
far more often than just viewing them.

> In general most apps these days do not set the creator code on
> documents.

Those that have unique extensions don't, but for those that use common
extensions there are an awful lot that do--I know, I use them every day.

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

This email sent to [EMAIL PROTECTED]


Re: core data - beyond the simple example

2008-04-04 Thread I. Savant
>  I'll give that a go, thanks. May I ask why NSImageCell?

  Actually, that was an incomplete thought. Using an NSImageCell would
negate the need to subclass anything. You could just drag one into the
appropriate column in Interface Builder, then bind the column to your
color property. You can then (in the bindings settings) specify a
(custom made) value transformer to turn the color into a "swatch"
image (fancy term for "solid rectangle of a given color). The image
cell will display the image of the color of the given instance of your
entity.

  Of course this doesn't allow editing. The second e-mail I sent that
mentioned NSCollectionView is probably the better way to go, since you
can use the standard NSColorWell control and ignore basically
everything I said ... ;-)

>  Well, you have to have goals :-)

  Agreed, but airline captains don't learn to fly with passenger jets
for very good reasons ... Best to start with crop dusters until you
master the basics of flight and airplane operations.

--
I.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: Need for a creator code?

2008-04-04 Thread John Siracusa
On Wed, Apr 2, 2008 at 3:46 PM, Jean-Daniel Dupas
<[EMAIL PROTECTED]> wrote:
> Anyway, even if it was possible to attach an UTI to a file, you would be
> force to continue to use (nasty old fashioned) extensions for compatibility
> with other OS.

That's an argument for creating files with appropriate file name
extensions by default, but it's not an argument for making the file
name extension the canonical source for file type information in Mac
OS X, especially when a great system like UTIs already exists.

UTIs are much more flexible and powerful than extensions.  They should
be the "source of truth" for file typing in Mac OS X (attached using
xattrs or a similar mechanism), and all other manifestations of file
type information (extensions, type codes) should be derived from (and
synced to) UTIs as needed, their existence only necessary as a means
of compatibility with legacy code and systems.

IOW, it's an inversion of the current policy, going from extensions as
canonical and UTIs as derived to UTIs as canonical (and actually
stored, if possible) and extensions as derived.  Now, this policy
change doesn't *necessarily* imply a change in behavior from the
user's perspective.  What it does do is clean up the developer's view
of file typing, as well as opening the door for much more robust and
sophisticated user-facing policies based on file type information down
the road.

-John
___

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

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

2008-04-04 Thread Torsten Curdt

Again me not being precise enough. So IIUC the NSTableView has
NSTableColumns which have NSTableCells. I would have assumed that
NSTableCells is also a view - which is why I talked about views.  
Right now
the cell is a NSTextFieldCell. I somehow need to replace that with  
something
bigger. Something that can have multiple controls that I then can  
bind to

the other attributes.


 Incorrect. A cell is a cell. A view is a view.
 
http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/Concepts/AboutControlsCells.html


Ups


 Replacing a data cell for a column (for the basic cells) is easy.
Building a table view whose cells actually use views is not.


I see ...well, I just want more attributes in one cell then :)


To get
you started:

http://www.stepwise.com/Articles/Technical/2003-12-20.01.html


Thanks!


 ... this is nontrivial. Doubly-so when Bindings is thrown into the
mix. You're in for a world of hurt with your current level of
understanding, but good luck. :-)


:-)


Just think of something along the lines of

@interface MyObject : NSObject
{
   NSString *name;
   NSString *color;

}


 In this case, as I said, just do it the easier way first so you
understand what's involved. Then if you want a 'subview as a cell in a
table', you'll have a much easier time. To do it the simple way,
you'll need to make the necessary adjustments for your color column in
code.

1 - Subclass NSCell (probably NSImageCell would be easiest, YMMV) and
get it to draw whatever color is given as its value.
2 - Obtain a reference to your "color" column and set its data cell to
your NSCell subclass (like "MyColorCell".

 More may be needed, but I'm busy and this is as much thought as I've
put into it.


I'll give that a go, thanks. May I ask why NSImageCell?


It's really more about getting more values into the one NSTableCell.


 Simple, huh? Except that with the approach you're taking, not so  
much. ;-)


:-)


 With respect, you're biting off way more than you have the teeth to
chew at the moment. It's not just a Core Data thing as your subject
line suggests. You're actually missing a few very critical
prerequisite topics:


Well, you have to have goals :-)


1 - How views(controls) and cells work.
2 - How to configure a table view (to use custom cells).
3 - POTENTIALLY how to intermix bindings and table data source methods
(for custom cells).
4 - Bindings (and probably the required KVC/KVO concepts).
5 - NSController/NSArrayController specifics (such as how to filter
here, as well as the fact that 'here' is 'where' you filter).


...working on it! :)

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Erik Buck
open a terminal or your favorite internet search and type "man nohup".
___

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

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

2008-04-04 Thread Ali Ozer
When I save a JPEG file in an image editing app, and later open it, I  
expect it to open in Preview (or whatever my default image viewer is),  
not the image editing app.  This is especially true if someone else  
opens the image.


Of course the expected behavior may depend on whether I am opening the  
document with intent to view or edit; but since most uses of documents  
over time tend to be to view, using the user's default viewing app is  
a more reasonable default.


As I mentioned, users can override this if they wish for individual  
documents, through Finder.


In general most apps these days do not set the creator code on  
documents.


Ali


On Apr 3, 2008, at 4:08 PM, Scott Ribe wrote:

But having an app explicitly
and automatically mark documents it saves as opening in itself can  
get

frustrating for the user.


How so? It seems the most reasonable default. I really don't see end  
users
saving a file from one app, and expecting it to automatically open  
with a

different app. In fact, that seems like it would be rather surprising
behavior.

Unless you are referring to the case where an app opens an existing  
file,

then on save changes the existing creator code--IMO that would be
ill-behaved.

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

This email sent to [EMAIL PROTECTED]


Re: activate my application while dragging on other application window

2008-04-04 Thread Hamish Allan
On Thu, Apr 3, 2008 at 3:47 PM, Jens Alfke <[EMAIL PROTECTED]> wrote:

>  By "any other application window", do you mean a window belonging to a
> _different_ application other than your own? There's no way to do that. As I
> said, applications aren't allowed to mess with each other's windows.

Is this really true? I was under the impression that Exposé was
handled by Dock.app.

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Scott Ribe
> You want a process that is re-parented to be a child of process 1,
> like when you put parentheses round a process to be backgrounded in
> bash?

Not mean, but the OP asked to launch a process that would outlive his app.
(Or rather not me anymore, I figured out a horrible way of doing it, before
being pointed to LS stuff on the Carbon list.)

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

This email sent to [EMAIL PROTECTED]


Re: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Hamish Allan
On Fri, Apr 4, 2008 at 5:35 PM, Scott Ribe <[EMAIL PROTECTED]> wrote:

>  But that gives you a child process, and there's no way that I found around
>  it without ugly hacks involving exec'ing a launchctl script...

You want a process that is re-parented to be a child of process 1,
like when you put parentheses round a process to be backgrounded in
bash?

I don't know how this is done, but bash is open source. I very much
doubt that Cocoa provides any mechanism for this, though (NSTask only
really caters for the common case).

Hamish
___

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

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

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

This email sent to [EMAIL PROTECTED]


Feedback-Directed Optimization problem

2008-04-04 Thread Michael Vannorsdel
I'm trying to generate a profile using the Feedback-Directed  
Optimization (-fprofile-generate) but when it gets to the linking  
stage it aborts with missing symbols _close$UNIX2003, _open$UNIX2003,  
_fcntl$UNIX2003.  Any ideas what's causing this?  I've used this  
option in the past many times and never had this come up.

___

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

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

2008-04-04 Thread Torsten Curdt

What's wrong?


Nothing's "wrong"; you're just feeding mismatched data.   
"ReferenceDate" != "1970".


Bah ...seems like I need some fresh air. Thanks!

Sorry for the noise.

cheers
--
Torsten
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSDate and millis

2008-04-04 Thread Jens Alfke


On 4 Apr '08, at 8:41 AM, Torsten Curdt wrote:

	NSDate *date1 = [[NSDate alloc] initWithString:@"2008-05-01  
00:00:00 +0200"];

NSLog(@"date1=%@, %lf", date1, [date1 timeIntervalSince1970]);


Whatever default date formatter is being used doesn't support parsing  
milliseconds. You're lucky it even matches the same syntax you're  
using (there are zillions of incompatible date formats.)


Moral of the story: Never rely on a default date formatter. Never call  
-[NSDate initWithString:]. Create your own NSDateFormatter instance  
and set its format string exactly the way you want it.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: core data - beyond the simple example

2008-04-04 Thread I. Savant
>  >  Just think of something along the lines of
>  >
>  >  @interface MyObject : NSObject
>  >  {
>  > NSString *name;
>  > NSString *color;
>  >
>  >  }
>
>   In this case, as I said, just do it the easier way first so you
>  understand what's involved. Then if you want a 'subview as a cell in a
>  table', you'll have a much easier time. To do it the simple way,
>  you'll need to make the necessary adjustments for your color column in
>  code.

  Come to think of it, if you're targeting Leopard and above, consider
using NSCollectionView. This is FAR better suited to the type of UI
you're describing. Sorry for missing that obvious bit.

--
I.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: Can we write Mac Servies like We write for Windows services

2008-04-04 Thread Jens Alfke


On 3 Apr '08, at 11:33 PM, Andrew Farmer wrote:


The equivalents of Windows services are login items and startup items


StartupItems are deprecated. Instead, you register daemons with  
launchd by putting a plist in /Library/LaunchDaemons/.


A "login item" is a user-visible application that gets launched when  
the user logs in. Generally the users' in charge of configuring those.  
A background process should register with launchd, by putting a plist  
in ~/Library/LaunchAgents/.


Management by launchd has a lot of advantages over StartupItems and  
login items, in that the processes can be configured to launch only on  
demand (i.e. if there's an incoming TCP connection, or if a folder is  
modified) and to be quit when they're idle.


The Apple technote referred to by one of the previous people in this  
thread is the best place to start reading.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: core data - beyond the simple example

2008-04-04 Thread I. Savant
>  Hm ...OK ...I just know there is a collection of data objects stored
> through core data that I can make accessible through the bindings.

  But the "devil is in the details" as they say. Ignoring (or "not
caring") about this *will* get you into trouble.

>  Again me not being precise enough. So IIUC the NSTableView has
> NSTableColumns which have NSTableCells. I would have assumed that
> NSTableCells is also a view - which is why I talked about views. Right now
> the cell is a NSTextFieldCell. I somehow need to replace that with something
> bigger. Something that can have multiple controls that I then can bind to
> the other attributes.

  Incorrect. A cell is a cell. A view is a view.
  
http://developer.apple.com/documentation/Cocoa/Conceptual/ControlCell/Concepts/AboutControlsCells.html

  Replacing a data cell for a column (for the basic cells) is easy.
Building a table view whose cells actually use views is not. To get
you started:

http://www.stepwise.com/Articles/Technical/2003-12-20.01.html

  ... this is nontrivial. Doubly-so when Bindings is thrown into the
mix. You're in for a world of hurt with your current level of
understanding, but good luck. :-)

>  Just think of something along the lines of
>
>  @interface MyObject : NSObject
>  {
> NSString *name;
> NSString *color;
>
>  }

  In this case, as I said, just do it the easier way first so you
understand what's involved. Then if you want a 'subview as a cell in a
table', you'll have a much easier time. To do it the simple way,
you'll need to make the necessary adjustments for your color column in
code.

1 - Subclass NSCell (probably NSImageCell would be easiest, YMMV) and
get it to draw whatever color is given as its value.
2 - Obtain a reference to your "color" column and set its data cell to
your NSCell subclass (like "MyColorCell".

  More may be needed, but I'm busy and this is as much thought as I've
put into it.

>  It's really more about getting more values into the one NSTableCell.

  Simple, huh? Except that with the approach you're taking, not so much. ;-)

  With respect, you're biting off way more than you have the teeth to
chew at the moment. It's not just a Core Data thing as your subject
line suggests. You're actually missing a few very critical
prerequisite topics:

1 - How views(controls) and cells work.
2 - How to configure a table view (to use custom cells).
3 - POTENTIALLY how to intermix bindings and table data source methods
(for custom cells).
4 - Bindings (and probably the required KVC/KVO concepts).
5 - NSController/NSArrayController specifics (such as how to filter
here, as well as the fact that 'here' is 'where' you filter).

>  The actual implementation does not really matter. But seems like building
> up a NSPredicate (by basically parsing the input) and then again setting
> that on the array controller should be it.

  Correct.

--
I.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: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Scott Ribe
> Even if NSTask doesn't have options for this, you can always call fork
> and execv, which is what NSTask uses under the hood.

But that gives you a child process, and there's no way that I found around
it without ugly hacks involving exec'ing a launchctl script...

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

This email sent to [EMAIL PROTECTED]


Re: Autorelease question

2008-04-04 Thread Jens Alfke


On 3 Apr '08, at 5:50 PM, Adam Leonard wrote:

If you are writing a tool that links with Foundation and not AppKit,  
an autorelease pool is NOT created for you. As you saw in your first  
example, you need to explicitly create and destroy one whenever you  
are dealing with Foundation objects in a method.


It depends. At the outermost scope, like the main() method and things  
called directly by it, you have to create your own pools. But if your  
process uses NSRunLoop, that class ensures that everything it calls is  
in the context of an autorelease pool. So you don't have to worry  
about this when writing delegate/target methods for NSTimers,  
NSURLConnections, etc.


Of course, it doesn't hurt to add your own anyway, if you want; it's  
just a very small performance overhead.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: How to create process independent of current process AND that takes command line arguments?

2008-04-04 Thread Jens Alfke


On 3 Apr '08, at 11:47 PM, Chris Suter wrote:


I don't think the docs. cover this issue.


This is pretty fundamental Unix stuff. I'm sure the Unix-level docs  
(like man pages, or "Advanced Mac OS X Programming" or "Mac OS X  
Internals", or Unix textbooks) describe all the gory details of  
process creation and control.


Even if NSTask doesn't have options for this, you can always call fork  
and execv, which is what NSTask uses under the hood.


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: activate my application while dragging on other application window

2008-04-04 Thread Jens Alfke


On 3 Apr '08, at 11:03 PM, Apparao Mulpuri wrote:

What type of Security issues are there in Windows appearance  
attributes change?

Jens, Could you please explain your reply clearly?


A window's pixels are accessible only to the process that owns the  
window, and to the window-server process (which is responsible for  
copying them to the screen.) If other processes could write into them,  
which is what your feature would require, then
(a) a buggy process could write garbage into other applications'  
windows, messing up the entire screen;
(b) a malicious process could write fake content into other  
applications' windows. For example, hiding a system security alert by  
clearing it to transparent. Even reading the pixels could be a  
security problem if there were confidential data in the other app's  
window.


You haven't even explained _why_ your app would need such a feature,  
or what it's for in the first place. What's the use of an app that  
draws squares on my screen and changes other apps' windows colors when  
they move into them?


—Jens

smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: core data - beyond the simple example

2008-04-04 Thread Torsten Curdt


On Apr 4, 2008, at 17:04, I. Savant wrote:
I have got a little demo project. I have a NSTableView bound to a  
Core Data
array of objects that where I can edit the name. So that was the  
first easy

step. Here are a few more:


 A few points.

 First, you probably want (or meant) to bind a column in your table
view to some keypath. This is 100% bindings-related. It's very
important for you to not only understand the difference or (because
you may already understand it) at least be specific about what is
bound to what.

 Second, there is no such thing as a "Core Data array of objects".
Again, you need to be specific if you expect help. Core Data returns
collections as sets (NSSet or NSMutableSet).


Hm ...OK ...I just know there is a collection of data objects stored  
through core data that I can make accessible through the bindings.



 Third, your table or column is bound to (most likely) an array
controller. The array controller's content set is bound, in turn, to
something else or it is set to Entity mode and will therefore contain
all instances of the specified entity (unless filtered with a
predicate -- see below). Again, be specific.


Sorry for being not specific enough.

So I have a NSTableColumn which is bound to my NSArrayController. And  
indeed the NSArrayController is set to Entity mode.



1.) What I want to do next is show all attributes of the object in my
NSTableView. Right now I assume I need to subclass the NSTableCell  
and
somehow make the NSTableView use that class instead. Then I will  
need to
bind the individual attributes to the controls in that view. Is  
that the

correct way to do it?


 I'm not even sure how to answer this. You talk about cells then
switch to views. The usual scenario is to bind each *column* (not the
whole table) to a specific keypath (usually an attribute) of the
arranged objects of a controller. Since you're struggling with the
newness, I recommend doing it the usual way first, then getting
fancier later.


Again me not being precise enough. So IIUC the NSTableView has  
NSTableColumns which have NSTableCells. I would have assumed that  
NSTableCells is also a view - which is why I talked about views. Right  
now the cell is a NSTextFieldCell. I somehow need to replace that with  
something bigger. Something that can have multiple controls that I  
then can bind to the other attributes.



 Since you haven't described the entity and its properties you're
representing in your table view, it's difficult to say exactly what
you'll need to do.


Just think of something along the lines of

@interface MyObject : NSObject
{
NSString *name;
NSString *color;
}


Start there. For general things (strings, numbers,
etc.) no subclassing is necessary. To represent a color, you'll
probably need a custom cell as (I believe) there is no NSColorWellCell
or equivalent.


It's really more about getting more values into the one NSTableCell.



It's important to note that most of your problem (as you suspected)
is in fact due to lack of complete understanding of the Cocoa Bindings
mechanism(s). You *must* learn this if you are to 'master' Core Data.
A lot of your questions will "go away" if you master Cocoa Bindings
first.


Hm ...yeah. Still quite a newbie there. And especially the switch to  
IB3 didn't help it.


2.) Instead of binding ALL the objects to the NSTableView I would  
like to
filter the objects so only objects e.g. with attributes  
"color='red'" get

shown.

3.) Now I would like be able to make this filter more dynamic. For  
example

adding 3 buttons. "show red", "show green", "show all".


 Look up "NSArrayController" and "filter predicate". Also look up
"NSPredicate" and the use thereof. This is all possible with these
mechanisms.


Alright then I will just somehow need to set a filter predicate  
depending on what button was clicked.


4.) Next thing would be to have this filter somehow defined  
dynamically.
Having the user assigning the condition "color='red'" to the "show  
red"

button and so on.


 The answer to this depends on exactly how you want this to work. Is
the number of available buttons dynamic and dependent on some other
factor? Is this function purely user-definable?


The actual implementation does not really matter. But seems like  
building up a NSPredicate (by basically parsing the input) and then  
again setting that on the array controller should be it.



 Most likely, you'll want to assign a set of filter rules for the
button. If you're targeting Leopard or above, the Predicate Editor
control found in IB should help provide UI for the user to define the
filters for your controller.


Yeah ...already found that. Thanks.

I was also wondering ...what if we are talking about 1M objects (or  
rows

thinking of it in terms of a database). How does this scale?


 See the many threads on this list (and the topic in the
documentation) regarding "Core Data performance". It's been documented
and discussed to death here in the past a

Re: NSDate and millis

2008-04-04 Thread Randall Meadows

On Apr 4, 2008, at 9:41 AM, Torsten Curdt wrote:

Hmmm ...doing this

	NSDate *date1 = [[NSDate alloc] initWithString:@"2008-05-01  
00:00:00 +0200"];

NSLog(@"date1=%@, %lf", date1, [date1 timeIntervalSince1970]);

and then using the output

   date1=2008-05-01 00:00:00 +0200, 1209592800.00

like this

	NSDate* date2 = [[NSDate alloc]  
initWithTimeIntervalSinceReferenceDate:1209592800L];

NSLog(@"date2=%@, %lf", date2, [date2 timeIntervalSince1970]);

gives this

  date2=2132-11-06 20:46:08 +0100, 5139056768.00

which is not exactly what I would be expecting.

What's wrong?


Nothing's "wrong"; you're just feeding mismatched data.   
"ReferenceDate" != "1970".

___

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

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

2008-04-04 Thread Scott Ribe
> What's wrong?

Seriously, slow down, read the docs, look at what you're doing.

You're taking timeIntervalSince1970 and passing it to
initWithTimeIntervalSinceReferenceDate. That makes no sense.

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

This email sent to [EMAIL PROTECTED]


Re: NSOutlineView: to insert a checkbox column as the first column

2008-04-04 Thread Nick Rogers

hi,
have figured out how to set the second column as outlineColumn and  
also put checkboxes in the first column by dragging NSButtonCell into  
the first column.


That leaves the customizing the second column part.

Regards,
Nick
On 04-Apr-08, at 8:39 PM, Nick Rogers wrote:


Hi,
I am writing the file browser part of my app now.

If i try inserting the checkbox in IB, the indentation marker is  
always in the first column.

Where as I want the first column to have only checkbox.
And I want the indentation marker in the second column.
Attached with the email is the look, that I wanted.

For the second column I guess i'll have to make a custom cell  
subclass.

But how to affix the indentation marker with it?
Not to mention that I'm a newbie with NSOutlineView and in cocoa as  
well, AFAIK.


Wishes,
Nick

___ 



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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/roger_s1%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: NSDate and millis

2008-04-04 Thread Torsten Curdt

Hmmm ...doing this

	NSDate *date1 = [[NSDate alloc] initWithString:@"2008-05-01 00:00:00  
+0200"];

NSLog(@"date1=%@, %lf", date1, [date1 timeIntervalSince1970]);

and then using the output

date1=2008-05-01 00:00:00 +0200, 1209592800.00

like this

	NSDate* date2 = [[NSDate alloc]  
initWithTimeIntervalSinceReferenceDate:1209592800L];

NSLog(@"date2=%@, %lf", date2, [date2 timeIntervalSince1970]);

gives this

   date2=2132-11-06 20:46:08 +0100, 5139056768.00

which is not exactly what I would be expecting.

What's wrong?

cheers
--
Torsten


___

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

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

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

This email sent to [EMAIL PROTECTED]


enterFullScreenMode trouble

2008-04-04 Thread slasktrattenator
Hi,

I'm having a small problem with NSView's
enterFullScreenMode:withOptions: method. The windowed view handles
keyboard events by overriding keyDown:, but once I enter fullscreen
mode it stops receiving these events, all I get is a NSBeep. I have
correctly set the new fullscreen window's delegate and made sure the
fullscreen view is the first responder, but to no avail. What am I
missing?

TIA
F.
___

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

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

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

This email sent to [EMAIL PROTECTED]


NSOutlineView: to insert a checkbox column as the first column

2008-04-04 Thread Nick Rogers

Hi,
I am writing the file browser part of my app now.

If i try inserting the checkbox in IB, the indentation marker is  
always in the first column.

Where as I want the first column to have only checkbox.
And I want the indentation marker in the second column.
Attached with the email is the look, that I wanted.

For the second column I guess i'll have to make a custom cell subclass.
But how to affix the indentation marker with it?
Not to mention that I'm a newbie with NSOutlineView and in cocoa as  
well, AFAIK.


Wishes,
Nick

<>___

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

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

2008-04-04 Thread I. Savant
>  I have got a little demo project. I have a NSTableView bound to a Core Data
> array of objects that where I can edit the name. So that was the first easy
> step. Here are a few more:

  A few points.

  First, you probably want (or meant) to bind a column in your table
view to some keypath. This is 100% bindings-related. It's very
important for you to not only understand the difference or (because
you may already understand it) at least be specific about what is
bound to what.

  Second, there is no such thing as a "Core Data array of objects".
Again, you need to be specific if you expect help. Core Data returns
collections as sets (NSSet or NSMutableSet).

  Third, your table or column is bound to (most likely) an array
controller. The array controller's content set is bound, in turn, to
something else or it is set to Entity mode and will therefore contain
all instances of the specified entity (unless filtered with a
predicate -- see below). Again, be specific.

>  1.) What I want to do next is show all attributes of the object in my
> NSTableView. Right now I assume I need to subclass the NSTableCell and
> somehow make the NSTableView use that class instead. Then I will need to
> bind the individual attributes to the controls in that view. Is that the
> correct way to do it?

  I'm not even sure how to answer this. You talk about cells then
switch to views. The usual scenario is to bind each *column* (not the
whole table) to a specific keypath (usually an attribute) of the
arranged objects of a controller. Since you're struggling with the
newness, I recommend doing it the usual way first, then getting
fancier later.

  Since you haven't described the entity and its properties you're
representing in your table view, it's difficult to say exactly what
you'll need to do. Start there. For general things (strings, numbers,
etc.) no subclassing is necessary. To represent a color, you'll
probably need a custom cell as (I believe) there is no NSColorWellCell
or equivalent.

  It's important to note that most of your problem (as you suspected)
is in fact due to lack of complete understanding of the Cocoa Bindings
mechanism(s). You *must* learn this if you are to 'master' Core Data.
A lot of your questions will "go away" if you master Cocoa Bindings
first.

>  2.) Instead of binding ALL the objects to the NSTableView I would like to
> filter the objects so only objects e.g. with attributes "color='red'" get
> shown.
>
>  3.) Now I would like be able to make this filter more dynamic. For example
> adding 3 buttons. "show red", "show green", "show all".

  Look up "NSArrayController" and "filter predicate". Also look up
"NSPredicate" and the use thereof. This is all possible with these
mechanisms.

>  4.) Next thing would be to have this filter somehow defined dynamically.
> Having the user assigning the condition "color='red'" to the "show red"
> button and so on.

  The answer to this depends on exactly how you want this to work. Is
the number of available buttons dynamic and dependent on some other
factor? Is this function purely user-definable?

  Most likely, you'll want to assign a set of filter rules for the
button. If you're targeting Leopard or above, the Predicate Editor
control found in IB should help provide UI for the user to define the
filters for your controller.

>  I was also wondering ...what if we are talking about 1M objects (or rows
> thinking of it in terms of a database). How does this scale?

  See the many threads on this list (and the topic in the
documentation) regarding "Core Data performance". It's been documented
and discussed to death here in the past and recently.

>  Also I am wondering about migrations. When you change the data model and
> users upgrade the application. How can one define the migrations?

  Read the documentation. This is covered thoroughly. If you have more
specific questions, ask away.

--
I.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: NSDate and millis

2008-04-04 Thread Scott Ribe
> How can I create a NSDate based on time millis (since epoch). Could
> not find any appropriate method.

dateWithTimeIntervalSince1970 or dateWithTimeIntervalSinceReferenceDate

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

This email sent to [EMAIL PROTECTED]


NSDate and millis

2008-04-04 Thread Torsten Curdt

Guys,

How can I create a NSDate based on time millis (since epoch). Could  
not find any appropriate method.


Create a NSData passing in epoch as string and then add the time  
interval? There gotta be a better way.



cheers
--
Torsten

___

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

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

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

This email sent to [EMAIL PROTECTED]


core data - beyond the simple example

2008-04-04 Thread Torsten Curdt

Hey guys

I am currently trying to get my head around core data. First  
impression - quite impressive.


I've followed some tutorials to get started but somehow I am a bit  
lost when I want to do some more complex things. This might actually  
be more because of bindings than because of core data. Or maybe I just  
did not look at the right place. Maybe you guys can give me some hints  
links and so on.


I have got a little demo project. I have a NSTableView bound to a Core  
Data array of objects that where I can edit the name. So that was the  
first easy step. Here are a few more:


1.) What I want to do next is show all attributes of the object in my  
NSTableView. Right now I assume I need to subclass the NSTableCell and  
somehow make the NSTableView use that class instead. Then I will need  
to bind the individual attributes to the controls in that view. Is  
that the correct way to do it?


2.) Instead of binding ALL the objects to the NSTableView I would like  
to filter the objects so only objects e.g. with attributes  
"color='red'" get shown.


3.) Now I would like be able to make this filter more dynamic. For  
example adding 3 buttons. "show red", "show green", "show all".


4.) Next thing would be to have this filter somehow defined  
dynamically. Having the user assigning the condition "color='red'" to  
the "show red" button and so on.


I was also wondering ...what if we are talking about 1M objects (or  
rows thinking of it in terms of a database). How does this scale?


Also I am wondering about migrations. When you change the data model  
and users upgrade the application. How can one define the migrations?


cheers
--
Torsten




___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSPopupButton Cell in NSTableView

2008-04-04 Thread Steven Huey

Thomas,

Take a look at the setDataCell: method of the NSTableColumn class.

http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSTableColumn_Class/Reference/Reference.html#/ 
/apple_ref/doc/uid/2119-setDataCell_


You'll want to set the data cell of your column to use a  
NSPopUpButtonCell instance.


- Steve

On Apr 3, 2008, at 2:38 PM, Thomas Bartelmess wrote:
I've spent a lot of time to find out to add a collum with  
NSPopupButtons, but it wasn't able to do this.


Can PLEASE anyone help me?

Thanks a lot
Thomas


--
Steven Huey Software - http://www.stevenhuey.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 [EMAIL PROTECTED]


Re: NSCondition easter-egg hunt

2008-04-04 Thread Michael Tsai

On Apr 3, 2008, at 9:14 PM, Jack Repenning wrote:

(1) When did NSCondition come to be?  Cocoa Fundamentals Guide (as  
contained in my Leopard Xcode) has a Note: "The NSCondition class  
was introduced in Mac OS X v10.5. It is not available in earlier  
versions of the operating system."  That would mean I can't use it,  
since I need to support 10.3.9 (and build on either 10.4 or 10.5).   
But clicking that word "NSCondition" in that very note leads to the  
class reference page, which says "Available in Mac OS X v10.0 and  
later."  Eh?


It was present on 10.0, and with 10.5 Apple originally said that it  
was retroactively available on previous systems. You could just copy  
and paste the interface into one of your headers.


However, in trying to use it on 10.4, I found a deadlock bug that  
makes it unusable in the main situation where it would be preferable  
to NSConditionLock. Apple confirmed the bug and said that they will  
document NSCondition as requiring 10.5.



--
Michael Tsai 

___

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

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

2008-04-04 Thread Scott Ribe
> I notice when this is the case, calling [pool
> release] causes a crash

You've either put in an object that has already been released, or have put
in a dangling pointer.

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

This email sent to [EMAIL PROTECTED]


Re: Main Thread UI and Detached Thread

2008-04-04 Thread Scott Ribe
> If that is the case then why does the progress bar get updated with the
> correct value every time when I insert the sleep( 1 ) call?

Sounds rather like you might not be executing everything on the thread you
think you are.

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

This email sent to [EMAIL PROTECTED]


Re: QTKit Capture Filtering

2008-04-04 Thread douglas a. welton

Bridger,

Check out the documentation on QTCaptureDecopressedvideoOutput.  If I  
read correctly, you should be able to use the CVImageBufferRef sent to  
the delegate method - 
captureOutput:didOutputVideoFrame:withSampleBuffer:fromConnection: as  
the source for your Core Image based processing.  Subsequently, you  
can push the results thru an image compression session and save the  
results to a file...


Check out the Quicktime-API list archives.  This question has been  
asked there several time...  you may find more/better details in the  
responses.


Also, you should check out the CIVideoDemoGL sample code.

later,

douglas


On Apr 4, 2008, at 3:53 AM, Bridger Maxwell wrote:


Hello,
 I would like a little help in designing my application, before I
veer off into the wrong direction. I am making an application that
captures input from a webcam using QTKit Capture, runs the image
through a few filters (background subtraction, contrast, high pass)
then runs that image through a blob detection algorithm. I will then
show the final image (with some additional drawing on it to represent
the blobs that were detected) in a QTCaptureView. I am wondering where
I should apply the filters to the video. In the QTRecorder example the
filters are applied right before being displayed to the view in the
method:
- (CIImage *)view:(QTCaptureView *)view willDisplayImage:(CIImage  
*)image

Is this what I should use too? I am still reading about Core Image and
Core Video, but in the QTRecorder example Core Video is not used.
Should I not use it either? How do Core Video and QTKit Capture
relate? Your advice will help me to study in the right direction. I am
trying to rewrite the application OpenTouch in Cocoa by May in time
for science fair, so I am fairly pressed for time.

Thank You,
  Bridger Maxwell
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Can we write Mac Servies like We write for Windows services

2008-04-04 Thread Sherm Pendley
On Fri, Apr 4, 2008 at 8:00 AM, ∞ <[EMAIL PROTECTED]> wrote:

>
> Il giorno 04/apr/08, alle ore 12:52, Sherm Pendley ha scritto:
>
> > For the moral equivalent of adding your app to Windows' list of
> > services,
> > you'll want to create a preference pane:
> >
> No, that's the moral equivalent of adding an icon to Windows' Control
> Panel.
>

Yes, there are many obvious interface similarities there.

My point is that there's a difference that's not so obvious. On Windows,
there's a services list where you can start or stop services, and change
them to start automatically, as needed, or only when started manually.
There's no such centralized list on the Mac - its moral equivalent is *also*
your app's preference pane, if of course you want to provide a GUI
start/stop button at all. If your app is a server app and you're pretty sure
your audience is experienced admins, you could probably just provide a
sample plist for managing your app with launchd.

sherm--
___

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

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

2008-04-04 Thread Christy Hoffman

6 month contract in Cambridge MA

 

For more information call Christy Hoffman at 781-530-3088 or [EMAIL PROTECTED]

 

 








 


 



We are seeking a Software Development Engineer with experience development 
skills in Mac OS X environment, with in-depth knowledge and experience writing 
commercial software using Objective-C, C++, XCode, Interface Builder, and Cocoa 
frameworks. The position is for a three month contract working in Cambridge. 
The existing team includes 3 developers and one PM.



 



Must Haves:



- Objective C experience 

- C++ experience 

- Mac OS 10 Imaging experience 

- Cocoa framework experience


Nice to Haves:



- Core animation 

- X Code 

- Interface Builder












 

 

Christy Hoffman MM 

Staffing Manager

Winter, Wyman Technology Contracting

Phone: 781-530-3088

Fax: 781-530-3988

[EMAIL PROTECTED]

www.wwcontracts.com

www.linkedin.com/in/christyhoffman

 

 

**Winter, Wyman offers a $500 referral for each Contract Professional you refer 
who completes 160 hours on an assignment**


 



1,312 contract placements/1,128 direct hires in 2007
 
Winter, Wyman was recently named one of the "Best Places to Work" for the 
second consecutive year.  Read more at www.winterwyman.com.










 

-Original Message-
From:John C. Randolph [EMAIL PROTECTED] 
To: "Kristan Kennedy" <[EMAIL PROTECTED]>;
Cc: "cocoa-dev@lists.apple.com" ;
Sent: Apr 3, 2008 06:45:47 PM
Subject: Re: Need Mac Developers


On Apr 3, 2008, at 11:19 AM, Kristan Kennedy wrote: 

> I desperately need to hire two Mid-Level Mac/Cocoa Developers. 

Cocoa-dev is a technical discussion list. If you have a job opening, 
then post a description of the position, and include [JOB] in the 
title. If anyone's interested, they'll contact you. 

-jcr 
___ 

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

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

Help/Unsubscribe/Update your Subscription: 
http://lists.apple.com/mailman/options/cocoa-dev/choffman%40winterwyman.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: Can we write Mac Servies like We write for Windows services

2008-04-04 Thread


Il giorno 04/apr/08, alle ore 12:52, Sherm Pendley ha scritto:
For the moral equivalent of adding your app to Windows' list of  
services,

you'll want to create a preference pane:


No, that's the moral equivalent of adding an icon to Windows' Control  
Panel. The equivalent of a service, in that an executable is  launched  
and maintained by the system in the background (and possibly restarted  
on crash and such) is a launchd-managed daemon or (10.5+) agent.


The Daemonomicon (also known as Technical Note 2083) describes it all  
in excruciating detail. 


 - ∞

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Can we write Mac Servies like We write for Windows services

2008-04-04 Thread Sherm Pendley
On Fri, Apr 4, 2008 at 1:50 AM, Ghufran Ahamad <[EMAIL PROTECTED]>
wrote:

>
> I need to write a service in Mac (like we write a Windows services for
> PC).
> This will automatically run as soon as start the Mac machine.

I would appreciate if any one knows how to write a Service for Mac OS X.


Many such apps (Apache, MySQL, etc.) are written as traditional UNIX
daemons, although they're managed by launchd on Mac OS X, not by the
traditional init.d scripts. In fact, if you already have a port of your
server to another *nix such as Linux, BSD, or Solaris, then I'd probably use
that version as a starting point of a Mac port.

For the moral equivalent of adding your app to Windows' list of services,
you'll want to create a preference pane:

<
http://developer.apple.com/documentation/UserExperience/Conceptual/PreferencePanes/PreferencePanes.html
>

sherm--
___

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

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