Re: A distinct group of pictures in the bundle

2009-10-28 Thread Ron Fleckner
When you add your folder of jpgs to your project, be sure to set  
"Create folder references for any added folders" to true.  Also don't  
forget to check the checkbox with "Copy items into destination group's  
folder, if needed."  Then you can do, for example:


	NSString *bellSoundPath = [[NSBundle mainBundle]  
pathForResource:@"Cow Bell" ofType:@"aiff" inDirectory:@"Sounds"];


and it Just Works™.

Ron


On 29/10/2009, at 4:01 PM, Pierre Berloquin wrote:

I do use pathForResource:ofType:inDirectory: with nil for Directory  
and jpg

for Type
It helps separate jpg's from other pictures

But suppose I want to have my pictures in a directory called Pic,  
how do I

go about it?
Thanks Dave
Pierre

2009/10/28 Dave Carrigan 



On Oct 28, 2009, at 10:46 AM, Pierre Berloquin wrote:

My app uses a hundred pictures.
How can I group them somewhere in the bundle so that my app loads  
them

without confusing them with button images and icons .



Have you tried NSBundle's -pathForResource:ofType:inDirectory:

To install them, create a new copy files build phase that copies  
them to

the subdirectory of your choosing.

--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA





--
Blogs : http://bibliobs.nouvelobs.com/blog/jeux-litteraires
  http://pierre-berloquin.blogspot.com/

Développement durable des neurones par le jeu de réflexion
www.crealude.net

Sustainable development of neurones through mind games
www.crealude.net/us

Que fait-on pour les mal-codants ?
___

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

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

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

This email sent to ronfleck...@ozemail.com.au


___

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

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

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

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


Re: waiting for async callback in main thread

2009-10-28 Thread John Engelhart
On Wed, Oct 28, 2009 at 7:08 AM, Dave Keck  wrote:

>
> I've hit several other brick walls from recursive run loops, but they
> escape me at the moment. Nonetheless, recursive run loops are a fancy
> way of blocking, and are contrary to the event-driven model that we
> know and love.
>
> I guess the rule that I stick by is "Don't use recursive run loops.
> But If you do, never (ever!) run them in anything but a custom run
> loop mode."


Well, just to be clear, I'm not saying "Don't do this", I said that I
"strongly advise against doing this." As both you, I, and others have
pointed out, there can be some unexpected consequences to running a run loop
recursively.  I'd categorize it as an "advanced technique for the
experienced Objective-C / Cocoa programmer".  No arguing that you can "get
it right", but it can be tricky and cause unexpected, non-intuitive
side-effects.  Particularly for beginning and intermediate Cocoa
programmers.

I guess I could summarize my position as "Try to solve the problem 'the
right way' (for some vaguely defined value of 'right way') before trying to
solve the problem by recursively running the run loop, particularly the main
run loop."  Recursively running a run loop on your own thread is probably an
entirely different matter all together- you're in complete control and
you've (probably) specifically programmed things with that fact in mind.
 The main run loop, on the other hand, has the potential to be a big can of
worms.

If you are forced to run the main run loop recursively, strive for
"simplicity".  As others have mentioned (Kyle Sluder), one way to do this is
to run the run loop in your own, custom run loop mode.  This is probably
your best option and it avoids the bulk of the problems I can think of.  Of
course, this assumes you can get whatever it is you want to wait on to
deliver events in that custom run loop mode.  It's been my experience that
API support for specifying run loop modes in third party stuff (which the OP
said he/she was using) is kind of hit or miss, so this might not be an
option.  If the third party API doesn't support a run loop modes argument,
it's probably going to deliver 'events' in NSRunLoopCommonModes.  If that's
the case, then IMHO, I'd try really, really hard to find an alternate
solution rather than trying to run the main run loop recursively
in NSRunLoopCommonModes.  While I'm sure you COULD get it to work, my guess
is that it's not going to be worth the effort and likely to be brittle,
especially in the face of "major" changes that can happen between major OS
releases.

But lets face it, sometimes you're forced in to a corner and you just gotta.
 :(
___

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

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

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

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


Re: A distinct group of pictures in the bundle

2009-10-28 Thread Pierre Berloquin
I do use pathForResource:ofType:inDirectory: with nil for Directory and jpg
for Type
It helps separate jpg's from other pictures

But suppose I want to have my pictures in a directory called Pic, how do I
go about it?
Thanks Dave
Pierre

2009/10/28 Dave Carrigan 

>
> On Oct 28, 2009, at 10:46 AM, Pierre Berloquin wrote:
>
>  My app uses a hundred pictures.
>> How can I group them somewhere in the bundle so that my app loads them
>> without confusing them with button images and icons .
>>
>
> Have you tried NSBundle's -pathForResource:ofType:inDirectory:
>
> To install them, create a new copy files build phase that copies them to
> the subdirectory of your choosing.
>
> --
> Dave Carrigan
> d...@rudedog.org
> Seattle, WA, USA
>
>


-- 
Blogs : http://bibliobs.nouvelobs.com/blog/jeux-litteraires
   http://pierre-berloquin.blogspot.com/

Développement durable des neurones par le jeu de réflexion
www.crealude.net

Sustainable development of neurones through mind games
www.crealude.net/us

Que fait-on pour les mal-codants ?
___

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

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

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

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


Re: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)

2009-10-28 Thread Graham Cox


On 29/10/2009, at 7:02 AM, Russell Finn wrote:


I'm pretty sure you got this backwards -- it's ObjectsAndKeys, not
KeysAndObjects:

attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
  [NSFont fontWithName:@"Helvetica" size:75],   
NSFontAttributeName,

  NSColor redColor], NSForegroundColorAttributeName,
  shadow, NSShadowAttributeName,
  nil];

Ref: 
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDictionary/initWithObjectsAndKeys:
("First the key for firstObject, then a null-terminated list of
alternating values and keys.").

No doubt this was part of the motivation for creating the MYUtilities
library. I'll have to check it out myself.



No, the OP is right. Check again:


initWithObjectsAndKeys:
Initializes a newly allocated dictionary with entries constructed  
from the specified set of values and keys.


- (id)initWithObjectsAndKeys:(id)firstObject , ...

Parameters
firstObject
The first value to add to the new dictionary.

...
First the key for firstObject, then a null-terminated list of  
alternating values and keys. If any key isnil, an  
NSInvalidArgumentException is raised.


The confusion is that the first word on the last line should be  
'Then', not 'First'.


Usually when coming up with a method name, it should self-document as  
far as possible. These nil-terminated lists don't fully do that, but  
at least the order of words gives you a hint:


initWithObjects(first)andKeys(second)

Therefore the list is ordered object, key, object, key

--Graham


___

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

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

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

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


[moderator] Re: Software visualisation tool

2009-10-28 Thread Scott Anguish
I.S. is not responsible for determining which lists are valid and which aren’t.

The moderator is.

That’s me

It’s off topic (as you say) and as a result, not for here.

Where? I don’t know.


But not here.

scott
[moderator]
On Oct 28, 2009, at 11:01 AM, MacProjects wrote:

> Which from apple developer maillists in Your opinion would be more 
> appropriate for discussing the "algorithm/structure visualisation stage" when 
> developing on osx? Which list would hold users that are more likely using 
> such tools and can give a good advice based on empirical knowledge? I don't 
> expect answer to this:) Pardon, over and out. Reinis
> 
> On 28.10.2009., at 16:42, I. Savant wrote:
> 
>> On Oct 28, 2009, at 10:20 AM, MacProjects wrote:
>> 
>>> Pardon for being a bit off-cocoa-topic, but thought this is a good place to 
>>> ask.
>> 
>> You thought a Cocoa development list with strict topic rules was a good 
>> place to post questions about which visualization applications are best?
>> 
>> Come on. It's not just 'a bit' off topic.
>> 
>> --
>> 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/mac%40krokoarch.lv
>> 
>> This email sent to m...@krokoarch.lv
> 
> ___
> 
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
> 
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
> 
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/scott%40cocoadoc.com
> 
> This email sent to sc...@cocoadoc.com

___

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

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

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

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


10.4 System Preferences Cannot Find Its Main Window When Launched by a Pane Bundle

2009-10-28 Thread Grant Erickson
I am working on a preference pane and in order to accommodate differences
among 10.4 and 10.5 and later without hard-coding widths, I call my own
[self resizeView] from mainViewDidLoad to adjust the view width as
appropriate:

- (void) resizeView
{
NSRect viewFrame, windowFrame;
NSWindow * mainWindow = NULL;

viewFrame = [[self mainView] frame];

mainWindow = [[NSApplication sharedApplication] mainWindow];

if (mainWindow != NULL) {
contentFrame = [mainWindow contentRectForFrameRect: [mainWindow
 frame]];

viewFrame.size.width = contentFrame.size.width;

[[self mainView] setFrame: viewFrame];
}
}

Overall, this seems to work well; however, when testing automatic updates
with Sparkle, I noticed that when Sparkle relaunches the bundle
("/Library/PreferencePanes/MyPane.prefPane") using its 'relaunch' binary
(which in turn uses NSWorkspace), that [[NSApplication sharedApplication]
mainWindow] returns NULL.

In fact, when I check [[NSApplication sharedApplication] mainWindow] in all
of:

* initWithBundle
* mainViewDidLoad
* willSelect
* didSelect

it is always NULL. Removing Sparkle from the loop, I can recreate the
problem using the 'open' shell executable:

% open /Library/PreferencePanes/MyPane.prefPane

Anyone else seen this behavior or developed a reasonable workaround? Perhaps
registering for and resize on NSWindowDidBecomeMainNotification?

Regards,

Grant


___

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

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

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

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


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

2009-10-28 Thread Dalmazio Brisinda


On 2009-10-28, at 8:17 AM, cocoa-dev-requ...@lists.apple.com wrote:


On 28/10/2009, at 4:49 PM, Peter N Lewis wrote:

a) composite two images, preferably while keeping the different
resolutions of the icon
b) how to dim an image similarly to kTransformDisabled


I'm unclear what you mean by a), but certainly compositing NSImage
into another one or into a view/context is trivial.


An NSImage (potentially) contains multiple resolutions (eg 16x16,
128x128, 512x512).  Especially if it is created from an IconRef.

What trivial way is there to take two NSImages and composite one on
top the other and retain this multiple resolution facility?  The only
compositing method I see for NSImage is the carious drawInRect/
drawAtPoint/drawRepresentation (and the deprecated composite variants)
that all require a specified size).  So as near as I can figure it, to
properly composite two NSImages, you would have to do something like:

scan through all the representations of each image and union all the
sizes
scan through all those sizes and composite the two NSImages at that  
size

create a union NSImage.

Possible, but fairly ugly, and not entirely trivial.  Is this the only
way.


Yes, I think you're right. I tried to to use NSImage's compositing  
facility to init two NSImage's from two IconRef's and then composite  
one on the other. If I examine the NSImage's after initializing they  
have all the different representations of the original IconRef: 16x16,  
32x32, 128x128, 256x256 etc. The underlying representation is given as  
private NSIconRefImageRep's. Here is the code:


CGSize iconSize = [self iconSize];
NSRect iconRect = NSMakeRect(0, 0, iconSize.width, iconSize.height);

	NSImage * resultImage = [[NSImage alloc]  
initWithIconRef:targetIconRef];
	NSImage * overlayImage = [[NSImage alloc]  
initWithIconRef:overlayIconRef];


[resultImage lockFocus];
	[overlayImage drawInRect:iconRect fromRect:iconRect  
operation:NSCompositeSourceOver fraction:1.0];

[resultImage unlockFocus];

But examining the contents of the resultImage shows that the  
underlying representation has now been changed to a single  
NSCGImageSnapshotRep at 128x128 with all other image representation  
data being lost. And is there a way to convert this back to an IconRef  
object if that's the object that's needed?


Best,
Dalmazio

___

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

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

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

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


Re: Multithreading NSBezierPath creation and stroking. Measuring performance

2009-10-28 Thread Sean McBride
On 10/27/09 2:05 AM, Karolis Ramanauskas said:

>At this point I started optimizing drawing, so I implemented some cacheing,
>etc. and I see significant performance gains. Now my attention is on drawing
>multiple series as can be seen in the picture above. I decided that this is
>a great place to introduce some multithreading (note that I have never done
>any multithreading until two days ago).

Be forewarned that writing correct multithreaded code is hard.  Be sure
to read up and what is and is not thread safe.  Most of AppKit is not
thread safe.

You might also want to read about "Concurrent View Drawing" here:


>   2. How do I measure (using instruments, I guess) the performance gain, if
>   any?

Both Instruments and Shark can be useful in measuring performance
bottlenecks and testing your improvements.

Good luck!

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Re: Bold and Italic For Dictionary Font Attributes (Hillegass Chapter 20, Challenge 2)

2009-10-28 Thread Russell Finn
On Tue, Oct 27, 2009 at 3:39 PM, Jens Alfke  wrote:
>
> On Oct 27, 2009, at 4:59 AM, Chunk 1978 wrote:
>
>> attributes = [[NSMutableDictionary alloc] init];
>>
>> [attributes setObject:[NSFont fontWithName:@"Helvetica" size:75] forKey:
>> NSFontAttributeName];
>>
>> [attributes setObject:[NSColor redColor] forKey:
>> NSForegroundColorAttributeName];
>>
>> [attributes setObject:shadow forKey:NSShadowAttributeName];
>
> You can change this to
>
> attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
>        NSFontAttributeName, [NSFont fontWithName:@"Helvetica" size:75],
>        NSForegroundColorAttributeName, NSColor redColor],
>        NSShadowAttributeName, shadow,
>        nil];

I'm pretty sure you got this backwards -- it's ObjectsAndKeys, not
KeysAndObjects:

attributes = [[NSMutableDictionary alloc] initWithObjectsAndKeys:
   [NSFont fontWithName:@"Helvetica" size:75],  NSFontAttributeName,
   NSColor redColor], NSForegroundColorAttributeName,
   shadow, NSShadowAttributeName,
   nil];

Ref: 
http://developer.apple.com/mac/library/DOCUMENTATION/Cocoa/Reference/Foundation/Classes/NSDictionary_Class/Reference/Reference.html#//apple_ref/occ/instm/NSDictionary/initWithObjectsAndKeys:
("First the key for firstObject, then a null-terminated list of
alternating values and keys.").

No doubt this was part of the motivation for creating the MYUtilities
library. I'll have to check it out myself.

-- Russell
___

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

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

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

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


Re: Programmatically invoking double-click bindings on NSTableView

2009-10-28 Thread Jim Correia

On Oct 28, 2009, at 1:51 PM, Gerd Knops wrote:


On Oct 28, 2009, at 11:41 AM, Jim Correia wrote:


If you are looking for a more general solution, you can retrieve the
binding data from the table view using -infoForBinding:, valuate the
target & arguments, and invoke the method that way.



I could, but given the flexible number of arguments that is a bit of  
work.


The cocoa frameworks provide a lot of functionality. But sometimes you  
have to write some code...


And since the tableview already knows how to do that, I was  
wondering if that code was exposed in some way. Apparently not.


For now I just added a transparent button with similar bindings and  
trigger that one.


Creating an invisible button to trigger a programmatic action is  
generally the wrong way to design your code flow. (If you are already  
doing work programmatically, don’t call back into the view layer to do  
additional work by side effect, do it directly.)


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


Re: A distinct group of pictures in the bundle

2009-10-28 Thread Dave Carrigan


On Oct 28, 2009, at 10:46 AM, Pierre Berloquin wrote:


My app uses a hundred pictures.
How can I group them somewhere in the bundle so that my app loads them
without confusing them with button images and icons .


Have you tried NSBundle's -pathForResource:ofType:inDirectory:

To install them, create a new copy files build phase that copies them  
to the subdirectory of your choosing.


--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA

___

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

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

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

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


Re: Programmatically invoking double-click bindings on NSTableView

2009-10-28 Thread Gerd Knops


On Oct 28, 2009, at 11:41 AM, Jim Correia wrote:


If you are looking for a more general solution, you can retrieve the
binding data from the table view using -infoForBinding:, valuate the
target & arguments, and invoke the method that way.

I could, but given the flexible number of arguments that is a bit of  
work. And since the tableview already knows how to do that, I was  
wondering if that code was exposed in some way. Apparently not.


For now I just added a transparent button with similar bindings and  
trigger that one.


Thanks

Gerd

___

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

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

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

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


A distinct group of pictures in the bundle

2009-10-28 Thread Pierre Berloquin
Hi

My app uses a hundred pictures.
How can I group them somewhere in the bundle so that my app loads them
without confusing them with button images and icons .

Thanks
___

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

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

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

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


Re: waiting for async callback in main thread

2009-10-28 Thread Jens Alfke


On Oct 27, 2009, at 11:13 PM, John Engelhart wrote:

While Cocoa might do this, there's probably a few "important  
details" that
you're glossing over.  Using a different run loop mode for the the  
recursive

run of the loop is a good example.  I'd be willing to bet there's an
implicit assumption that the tranistion to NSModalPanelRunLoopMode or
NSEventTrackingRunLoopMode "only happens once".  In a nutshell, one  
does not
recursively become modal or recursively begin tracking the mouse,  
you either
are or you aren't, and it would be an "illegal state transition" to  
go from

modal to modal.


I've found through experience that the safest thing to do when running  
a nested runloop like this is to use a unique mode. This prevents  
unwanted unrelated runloop sources (like incoming UI events) from  
firing. The tricky part is that you have to ensure that any runloop  
sources you are waiting on get added to your custom mode. (For  
example, if waiting on an NSURLConnection, you have to explicitly call  
its -scheduleInRunLoop:withMode: method.)


The re-entrancy issues aren't going to come up all the time, but they  
do happen, and can cause really weird behavior that has you scratching  
your head until you manage to hit a breakpoint and look at your stack  
realizing you had no idea that this configuration of calls could  
occur...


—Jens___

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

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

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

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


Re: Single Static Library for iPhone and Desktop applications

2009-10-28 Thread Karolis Ramanauskas
Thanks to you both, I'll look into my options more deeply. Sorry about the
wrong list...
___

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

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

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

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


Re: Odd window behavior LSUIElement=1

2009-10-28 Thread Jens Alfke


On Oct 28, 2009, at 5:37 AM, Matthew Lindfield Seager wrote:


If that is the case it would seem to imply that when A quits the
system looks for the "next" app. In this case "next" seems to be
determined in the same way command-tab chooses the "next" app.


Yup. This is basically the expected behavior. LSUIElement windows  
behave a bit oddly in this respect; you could call it an OS bug*, but  
it's been that way for years so I suspect the people in charge decided  
this was the right way to do it.


—Jens

*and I'd agree with you. It can make finding a buried window from such  
an app very difficult. I run into this with Last.fm, which puts up a  
window showing play info it's going to upload, and this window  
invariably ends up hidden behind other windows and can't be brought to  
the front without hiding every app until it shows 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 arch...@mail-archive.com


Re: Detecting a network connection

2009-10-28 Thread Jens Alfke


On Oct 28, 2009, at 9:22 AM, colors wrote:

Is there an API for determining a physical network connection  
(ethernet, WiFi, etc.)?


Again, SystemConfiguration has APIs for that. But unless you're doing  
something unusual, you probably don't need to check for physical  
network interfaces. An active link doesn't necessarily mean you can  
connect to any remote hosts. In almost all cases, what you really want  
to know is whether a particular host or net is reachable.


—Jens___

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

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

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

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


Re: Programmatically invoking double-click bindings on NSTableView

2009-10-28 Thread Jim Correia
On Wed, Oct 28, 2009 at 12:25 PM, Gerd Knops  wrote:
> Seems this should be easy:
>
> I have an NSTableView's "Double Click Target", "Double Click Argument",
>  "Double Click Argument2" etc. binding set, and they work fine.
>
> Now I would like to programmatically get the tableview to issue a
> double-click response. Obviously "target" and "doubleAction" are not useful
> in that context.
>
> Any ideas how to get this done?

If this is just a one-off case, the simplest solution is to invoke the
method with the appropriate arguments on the target directly.

If you are looking for a more general solution, you can retrieve the
binding data from the table view using -infoForBinding:, valuate the
target & arguments, and invoke the method that way.

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


Programmatically invoking double-click bindings on NSTableView

2009-10-28 Thread Gerd Knops

Seems this should be easy:

I have an NSTableView's "Double Click Target", "Double Click  
Argument",  "Double Click Argument2" etc. binding set, and they work  
fine.


Now I would like to programmatically get the tableview to issue a  
double-click response. Obviously "target" and "doubleAction" are not  
useful in that context.


Any ideas how to get this done?

Thanks

Gerd

___

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

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

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

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


Re: Detecting a network connection

2009-10-28 Thread colors
Is there an API for determining a physical network connection  
(ethernet, WiFi, etc.)?


On Oct 28, 2009, at 7:37 AM, Dave Carrigan wrote:



On Oct 28, 2009, at 7:32 AM, colors wrote:

I am currently use NSHost to determine if I can see a particular  
domain, before I initiate a lengthly sso to that domain.  However,  
I am finding that depending on the settings of some network DNS  
servers, this method does not always work.  Any suggestions of a  
better way to confirm a live internet connection?


Have a look at the SCNetworkReachability APIs in the  
SystemConfiguration framework.


--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA



___

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

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

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

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


Re: EXC_BAD_ACCESS when migrating a store, but only sometimes...

2009-10-28 Thread Sean McBride
On 10/28/09 10:48 AM, Daniel Kennett said:

>I've come across a rather perplexing problem which is driving me nuts.
>I'm attempting to migrate a core data SQLite store to the current
>model version, and most of the time it works fine. However, sometimes
>I get an EXC_BAD_ACCESS in the following stack:
>
> *SNIP*
>
>
>All of my vars are correct and I have no memory leaks or overreleases.

You sound very sure of that.  Did you run the clang analyzer, test with
zombies, etc. to be sure?

>If anyone could help me start debugging what on earth is going on, I'd
>really appreciate it.

I'd also try guard malloc.

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Re: Adding new Core Data objects through a form

2009-10-28 Thread Martin Cote
On Wed, Oct 28, 2009 at 12:01 PM, mmalc Crawford  wrote:
> On Oct 28, 2009, at 6:26 am, Martin Cote wrote:
>
>> That said, the situation in this sample project is quite different.
>> When they add an object, they actually add an empty object in an array
>> controller.
>>
> This is precisely what the example does not do.

Oh!  I must have confused the sample name with another one.  Thanks
for the link!
___

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

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

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

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


Re: FSMountServerVolumeSync Authentication problem

2009-10-28 Thread Sean McBride
On 10/26/09 9:34 PM, Sandro Noël said:

>I'm having some problems with FSMountServerVolumeSync

Since that's a Carbon function, maybe the carbon-dev list would be more
appropriate (and yield you better answers).

--

Sean McBride, B. Eng s...@rogue-research.com
Rogue Researchwww.rogue-research.com
Mac Software Developer  Montréal, Québec, Canada


___

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

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

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

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


Re: [iPhone] Why so many calls?

2009-10-28 Thread Corbin Dunn

On Oct 27, 2009, at 5:22 PM, Phil Curry wrote:

>>> But can anyone explain all the other duplicate calls?
>> 
>> Why does it matter?  If you have eight or nine sections it makes
>> perfect sense.  Or you could have one section and it needs to draw
>> multiple times, and whoever designed the API didn't want to go through
>> the expense of a KVO observation, instead asking the delegate for the
>> header/footer each time it needed it.
>> 
>> But none of that matters.
> Kyle-
> 
> But, as I thought I explained in the original post, the table only has 2 
> sections, 1 with 2 rows and 1 with 1 row.
> The table is only being loaded once. So why does it take:
> 
> 9 tableView:titleForHeaderInSection: calls for 2 sections
> 8 tableView:titleForFooterInSection: calls for 2 sections
> 2 numberOfSectionsInTableView: calls for a single load
> 
> In a table of this size, you're right - "Why does it matter".
> But what if my real table has 99 sections? Why should I get bogged down with 
> 800-900 calls for section header titles and section footer titles.
> Seems like an incredible waste of effort. Just curious if anyone knows why 
> this happens. If you don't know why, just say so.

You should log a bug for this, especially if it is a performance concern. 

However, the iPhone has a lot of performance tuning done to it. This area was 
obviously not a hot spot.

corbin


___

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

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

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

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


Re: Adding new Core Data objects through a form

2009-10-28 Thread mmalc Crawford

On Oct 28, 2009, at 6:26 am, Martin Cote wrote:

> That said, the situation in this sample project is quite different.
> When they add an object, they actually add an empty object in an array
> controller.
> 
This is precisely what the example does not do.

It creates a separate managed object context to allow a discrete set of edits 
to be made that don't affect the array controller or the document's main 
context (which avoids "questions about other parts of your app—like entity mode 
array controllers—dealing with this transient object being created"). The 
significant advantage of using an actual managed object is that you can then 
leverage bindings to invoke its native validation methods, ensuring consistency 
of business logic.

mmalc

___

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

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

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

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


Re: Software visualisation tool

2009-10-28 Thread MacProjects
I know, OmniGraffle is praised everywhere. This could be a good  
investment, unless there is the need for sharing - asking others to  
buy a software isn't right, especially when working on a freeware  
project. I will look into xfig, thanks Sarah.
I.Savant, taking this discussion down. Sorry AGAIN for taking Your  
time. Please, do not answer this, mkay?

Reinis

Personally I use Omnigraffle but if you are ruling that out and want  
something open source try xfig which is fine on the mac as long as  
you have installed X11 from the install disk.

Best Regards
Sarah


On 28.10.2009., at 17:06, I. Savant wrote:


On Oct 28, 2009, at 11:01 AM, MacProjects wrote:

Which from apple developer maillists in Your opinion would be more  
appropriate for discussing the "algorithm/structure visualisation  
stage" when developing on osx?


 Apple mailing lists for this topic? There are none. There's the  
Apple Developer Forums (google it), or else you'll have to find  
lists elsewhere. Google is your friend. There are plenty of places  
out there (you even cited one - StackOverflow) that are more broad  
in scope.



Which list would hold users that are more likely using such tools  
and can give a good advice based on empirical knowledge?


 Completely irrelevant as an excuse for posting here and up to you  
to search for better-suited places. Again, you already cited one  
such place.


--
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/mac%40krokoarch.lv

This email sent to m...@krokoarch.lv


___

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

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

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

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


Re: Software visualisation tool

2009-10-28 Thread I. Savant

On Oct 28, 2009, at 11:01 AM, MacProjects wrote:

Which from apple developer maillists in Your opinion would be more  
appropriate for discussing the "algorithm/structure visualisation  
stage" when developing on osx?


  Apple mailing lists for this topic? There are none. There's the  
Apple Developer Forums (google it), or else you'll have to find lists  
elsewhere. Google is your friend. There are plenty of places out there  
(you even cited one - StackOverflow) that are more broad in scope.



Which list would hold users that are more likely using such tools  
and can give a good advice based on empirical knowledge?


  Completely irrelevant as an excuse for posting here and up to you  
to search for better-suited places. Again, you already cited one such  
place.


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


Re: Software visualisation tool

2009-10-28 Thread MacProjects
Which from apple developer maillists in Your opinion would be more  
appropriate for discussing the "algorithm/structure visualisation  
stage" when developing on osx? Which list would hold users that are  
more likely using such tools and can give a good advice based on  
empirical knowledge? I don't expect answer to this:) Pardon, over and  
out. Reinis


On 28.10.2009., at 16:42, I. Savant wrote:


On Oct 28, 2009, at 10:20 AM, MacProjects wrote:

Pardon for being a bit off-cocoa-topic, but thought this is a good  
place to ask.


 You thought a Cocoa development list with strict topic rules was a  
good place to post questions about which visualization applications  
are best?


 Come on. It's not just 'a bit' off topic.

--
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/mac%40krokoarch.lv

This email sent to m...@krokoarch.lv


___

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

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

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

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


Re: Detecting a network connection

2009-10-28 Thread colors

That looks perfect, thank you.

Rich

On Oct 28, 2009, at 7:37 AM, Dave Carrigan wrote:



On Oct 28, 2009, at 7:32 AM, colors wrote:

I am currently use NSHost to determine if I can see a particular  
domain, before I initiate a lengthly sso to that domain.  However,  
I am finding that depending on the settings of some network DNS  
servers, this method does not always work.  Any suggestions of a  
better way to confirm a live internet connection?


Have a look at the SCNetworkReachability APIs in the  
SystemConfiguration framework.


--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA




___

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

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

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

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


Re: Software visualisation tool

2009-10-28 Thread I. Savant

On Oct 28, 2009, at 10:20 AM, MacProjects wrote:

Pardon for being a bit off-cocoa-topic, but thought this is a good  
place to ask.


  You thought a Cocoa development list with strict topic rules was a  
good place to post questions about which visualization applications  
are best?


  Come on. It's not just 'a bit' off topic.

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


Re: Detecting a network connection

2009-10-28 Thread Dave Carrigan


On Oct 28, 2009, at 7:32 AM, colors wrote:

I am currently use NSHost to determine if I can see a particular  
domain, before I initiate a lengthly sso to that domain.  However, I  
am finding that depending on the settings of some network DNS  
servers, this method does not always work.  Any suggestions of a  
better way to confirm a live internet connection?


Have a look at the SCNetworkReachability APIs in the  
SystemConfiguration framework.


--
Dave Carrigan
d...@rudedog.org
Seattle, WA, USA

___

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

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

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

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


Detecting a network connection

2009-10-28 Thread colors
I am currently use NSHost to determine if I can see a particular  
domain, before I initiate a lengthly sso to that domain.  However, I  
am finding that depending on the settings of some network DNS servers,  
this method does not always work.  Any suggestions of a better way to  
confirm a live internet connection?


*
Richard Collyer
iseecol...@sbcglobal.net
*


___

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

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

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

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


Software visualisation tool

2009-10-28 Thread MacProjects

Hello!
Pardon for being a bit off-cocoa-topic, but thought this is a good  
place to ask.
Until now my choice for visualising algorithms, structure etc has been  
pen&paper... time to go digital.
I do own some apps like AI, VectorDesigner, xMind that would do the  
job and have googled up for some other free/shareware solutions.
Wanted to hear Your experience (leaving the ultimate solution -  
OmniGraffle - out :) ) in software visualisation. Freeware is mre  
than welcome as the "going digital thing" is motivated by the need of  
sharing those drawings. It does not need to be a cross-platform  
solution.
Btw, has anyone used online tools mentioned here http://stackoverflow.com/questions/86234/diagram-tool-for-mac-os-x/1458768#1458768 
 for the matter?
I did post the same question in Apple discussions developer forum. The  
only answer suggested using VISIO, but, honestly, I'm not willing to  
spend "Office Visio Standard 2007 $259.95, Office Visio Professional  
2007 $559.95". I doubt $250 reflect the difference in using Visio  
compared to i.e. OpenOffice.org answer to it, namely Draw http://www.openoffice.org/product/draw.html 
.

Many thanks in advance,
Reinis

___

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

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

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

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


Re: Problem with allocating memory

2009-10-28 Thread Jeremy Pereira


On 28 Oct 2009, at 09:27, Michael Abendroth wrote:


Basically, I got a source list to witch the user can add entries via a
button. The user can also edit the entries title by double clicking on
it. The problem is that when you add 3 entries for example, and then
edit them, all the items you renamed before will change their names -
even though they obviously shouldn't. So already while typing in the
new name, all other items will change their names, eventually all are
exactly the same.

Why is this happening?


That's easy.  It's because you have a bug in your code.






If you think that answer is unhelpful, it's the best you'll get  
without showing us the code.




Mike
___

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

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

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

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



__
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
__

___

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

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

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

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


Updating property of core data entity does not update outline view

2009-10-28 Thread Richard
hey

thanks, that is exactly what i was looking for, i have got it working now
(nearly).

so, a related question. i have an outline view and when searches are
performed a new item is added to the outline view with a badge that displays
the number of search results. the outline view is bound to a tree controller
working in entity mode of type SidebarItem.

when search results arrive, i get the relevant SidebarItem from the
managedObjectContext and update the count property with the new amount. the
problem is that this does not update the outline view. if i cause the view
to be redrawn, the badge updates with the correct value. how can i get it to
do this automatically?

i tried sending a notification when the count was updated, and then
searching for the item in the outlineview when the notification is received,
but [outlineView rowForItem: ] always returns -1, so i cannot redraw the
updated row.

what am i doing wrong?



On Wed, Oct 28, 2009 at 9:23 AM, Matthew Lindfield Seager <
matt...@sagacity.com.au> wrote:

> > could someone point me in the right direction, what is the easiest way of
> > doing this? would i have to override the text cell for the outline view,
> or
> > can i use a value transformer of some sort?
>
> I'm sure someone will correct me if (when?) I'm wrong but I've heard
> them called badges. Googling nsoutlineview badges returned a bunch of
> results & I'm sure you can find your way from there!
>
> 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 arch...@mail-archive.com


Re: Adding new Core Data objects through a form

2009-10-28 Thread Martin Cote
I just replied directly to Kyle, here's my response:

On Wed, Oct 28, 2009 at 12:16 AM, Kyle Sluder  wrote:
> On Tue, Oct 27, 2009 at 6:58 PM, Martin Cote  wrote:
>> I'm trying to do something really simple with Core Data, but I can't
>> find a graceful way to do it.
>
> Perhaps we can agree on "idiomatic?"  Which is quite different from
> "idiot-o-matic," though I always seem to read it that way.  ;-)

Agreed!

>> I would like to show a form to my user that they can fill, and when
>> they press 'OK', a new managed object is created.  This can be done
>> very simply, but I  would like to use IB bindings as much as possible.
>
> Rather than binding to a temporary managed object, as in Scenario 1
> (which raises even questions about other parts of your app—like entity
> mode array controllers—dealing with this transient object being
> created), the idiomatic approach would be to bind the fields to
> properties of a controller object for your form.  (In practice, this
> might be an NSWindowController/NSViewController subclass, an
> NSObjectController subclass, or a one-off NSObject subclass.)  Then
> you wire up your button to a method on that controller that commits
> editing and creates the managed object.

Well, that's pretty much what I'm doing right now.  What I don't like
about this approach is the manual managed object creation (and setting
up all its properties).  Now I realize that I must sound like a very
lazy person.  I was just hoping I could bind my GUI directly to a
managed object instead of using an intermediate controller object.

> Alternatively, you could forego bindings and create traditional
> outlets to your UI objects, querying them from within your button's
> action method.  But bindings make the work so much easier, especially
> with NSEditorRegistration-conforming controllers!

Oh, NSEditorRegistration sounds interesting.  I'll continue reading.

> To be honest, this is a very fundamental Cocoa pattern, yet it took me
> the better part of two years to get a handle on it.  Here's what it
> looks like in action (warning, code typed in compose window!):



> Hope that helps.  I think I'm going to need to write a blog post to
> make that clearer.  First step would be to get a blog, I guess.

That helps very much.  It's not exactly what I had in mind, but it is
certainly enlightening!

Let me know if you ever get that blog live ;)

Regards,
Martin Cote
___

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

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

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

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


Re: Adding new Core Data objects through a form

2009-10-28 Thread Martin Cote
> Martin, you should also have a look at how it's done in Apple's
> DepartmentAndEmployees sample project.
>
> http://developer.apple.com/mac/library/samplecode/DepartmentAndEmployees/listing13.html

Yes, I looked into this one.  Actually, this sample is what made me
realize that you could bind managed object directly in the GUI.

That said, the situation in this sample project is quite different.
When they add an object, they actually add an empty object in an array
controller.  The user can then "fill" the object by editing its
properties in the table view.

In my case, I want to create the object only when its properties are
properly set in the GUI.

I guess I'll have to follow Kyle's indication!

Regards,
Martin Cote
___

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

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

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

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


Re: Odd window behavior LSUIElement=1

2009-10-28 Thread Matthew Lindfield Seager
> Let's say I have existing applications running, "A" with a window on top of 
> application "B". My program pops up a window and forces it to the front. So I 
> have "MyApp" on top of "A" on top of "B". Now I click on Application "A", 
> bringing it to the front. Now I have "A" on top of "MyApp" on top of "B". Now 
> I quit "A". As I quit "A", "MyApp" suddenly pops behind "B".
>
> The same thing happens whether I programmatically forced "MyApp" to the 
> front, or whether I bring it to the front by clicking on it. It doesn't 
> happen when I run LSUIElement=0
>
> Can anyone tell me what is going on?
I can't specifically tell you but it sounds to me like B pops in front
of YourApp rather than YourApp behind B (testing with more apps should
verify this).

If that is the case it would seem to imply that when A quits the
system looks for the "next" app. In this case "next" seems to be
determined in the same way command-tab chooses the "next" app.

A lot of speculation on my part but if I'm right I wouldn't call it a bug!

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


Re: waiting for async callback in main thread

2009-10-28 Thread Dave Keck
Recursive run loops always lead to cleaner but worse code (IMO, of
course :)). Recursive mouse tracking, for example, keeps all the code
dealing with the state changes in one place, and allows for
method-scope variables that keep track of the state rather than ivars.
On the other hand, you have to explicitly schedule timers and delayed
actions to perform on the mouse-tracking run loop mode, or else
they'll be delayed until the user mouses-up. I can never seem to
remember to do this, and it always leads to a that d'oh! moment.

Worse, I've found the frameworks make use of recursive run loops where
you'd least expect it, and I've never seen it documented in these
cases. This bit me in the case of NSTask's -isRunning. (And not only
does -isRunning run the run loop, but you can receive the
NSTaskDidTerminateNotification from within -isRunning's stack frame -
ouch. Guess I should file a bug about that, instead of just
complaining, eh? :))

I've hit several other brick walls from recursive run loops, but they
escape me at the moment. Nonetheless, recursive run loops are a fancy
way of blocking, and are contrary to the event-driven model that we
know and love.

I guess the rule that I stick by is "Don't use recursive run loops.
But If you do, never (ever!) run them in anything but a custom run
loop mode."
___

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

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

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

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


EXC_BAD_ACCESS when migrating a store, but only sometimes...

2009-10-28 Thread Daniel Kennett

Hi list,

I've come across a rather perplexing problem which is driving me nuts.  
I'm attempting to migrate a core data SQLite store to the current  
model version, and most of the time it works fine. However, sometimes  
I get an EXC_BAD_ACCESS in the following stack:


objc_assign_strongCast + 19
-[NSMigrationManager  
migrateStoreFromURL:type:options:withMappingModel:toDestinationURL:destinationType:destinationOptions:error 
:] + 2750

(My methods...)

Most of the time, if I simply try and run the migration again on the  
same file it works fine. I'm not doing anything fancy - this is how I  
call -migrateStoreFromURL:...


[manager migrateStoreFromURL:url
type:NSSQLiteStoreType
options:nil
withMappingModel:mappingModel
toDestinationURL:destinationStoreURL
destinationType:NSSQLiteStoreType
destinationOptions:nil error:error]

All of my vars are correct and I have no memory leaks or overreleases.  
If anyone could help me start debugging what on earth is going on, I'd  
really appreciate it.


 Thanks,

-- Daniel

 ___

   dan...@kennettnet.co.uk
   http://www.kennettnet.co.uk

Please include previous messages in any reply you send.



___

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

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

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

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


Re: Problem with allocating memory

2009-10-28 Thread Alexander Spohr


Am 28.10.2009 um 10:27 schrieb Michael Abendroth:


Why is this happening?


How should we know if you don’t provide the faulty code?

atze

___

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

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

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

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


Re: can the button responce the second click before the first is finished before?

2009-10-28 Thread Alexander Spohr


Am 28.10.2009 um 10:19 schrieb XiaoGang Li:

jump out the for loop if the bStop flag changed to YES. How to  
implement it?


Use another thread to run your for loop.

atze

___

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

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

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

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


Re: Single Static Library for iPhone and Desktop applications

2009-10-28 Thread Jean-Daniel Dupas


Le 28 oct. 2009 à 10:44, Karolis Ramanauskas a écrit :

...also I wanted to ask, in case this is not possible how do I avoid  
copying
existing classes I have written for desktop and using them in  
iPhone? I can
easily create two versions of static library and keep copying/ 
pasting files

between them, but it seems cumbersome.

Thanks again


You can create one project with 2 configurations (one for iPhone, one  
for desktop) or create two projects referencing the same files.


Note that this is not a Cocoa question, and should be ask on Xcode- 
user list instead.


-- Jean-Daniel




___

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

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

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

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


Re: Single Static Library for iPhone and Desktop applications

2009-10-28 Thread Karolis Ramanauskas
...also I wanted to ask, in case this is not possible how do I avoid copying
existing classes I have written for desktop and using them in iPhone? I can
easily create two versions of static library and keep copying/pasting files
between them, but it seems cumbersome.

Thanks again
___

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

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

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

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


Single Static Library for iPhone and Desktop applications

2009-10-28 Thread Karolis Ramanauskas
Good day,

I'm trying to set up a single static library, I only need it to link against
Foundation, for both iPhone and Desktop applications. I can easily configure
one library for iPhone application only, same with desktop application.
However when I try to make one static library work with both environments I
get into trouble. Is there a way to configure static library for such
situation? Perhaps I just don't know how to do this manually, as Xcode has
templates for the other two variants.

Thanks,
Karolis
___

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

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

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

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


Re: Problem with allocating memory

2009-10-28 Thread Michael Abendroth
Thanks for the input! Using the %p printing, I found out that I might
not actually have the problem I thought I had. I checked for the
addresses in memory of the entries. They are all different so I guess
the problem isn't that they all point to the same object.
Basically, I got a source list to witch the user can add entries via a
button. The user can also edit the entries title by double clicking on
it. The problem is that when you add 3 entries for example, and then
edit them, all the items you renamed before will change their names -
even though they obviously shouldn't. So already while typing in the
new name, all other items will change their names, eventually all are
exactly the same.

Why is this happening?
Mike
___

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

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

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

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


can the button responce the second click before the first is finished before?

2009-10-28 Thread XiaoGang Li
when user click the OK button, the application will fall into a for loop for
a long time, how to jump out the for loop without using multi-threads? like
this:

BOOL bStop = NO;

- (IBAction)okButton:(id)sender
{
 //user can click the button again to stop the action to continue.
 [okButton setTitle:@"Stop"];
 [okButton displayIfNeeded];

 //N is a big number, and the doSomething method is a time consumer too.
 for(int i=0; ihttp://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

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


Re: outline view with mail style folder counts in rounded rectangle

2009-10-28 Thread Matthew Lindfield Seager
> could someone point me in the right direction, what is the easiest way of
> doing this? would i have to override the text cell for the outline view, or
> can i use a value transformer of some sort?

I'm sure someone will correct me if (when?) I'm wrong but I've heard
them called badges. Googling nsoutlineview badges returned a bunch of
results & I'm sure you can find your way from there!

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