Re: Custom NSView/NSWindow & First Responders

2009-06-10 Thread Michael Ash
On Wed, Jun 10, 2009 at 9:34 PM, John Ku wrote:
> Good afternoon all,
> Im having trouble setting the correct first responder / key window in my
> app.
>
> I have a subclass NSWindow with NSBorderlessWindowMask and a custom drawing
> NSView inside the window. So the window is transparent showing the NSView's
> drawing. The NSView image is drawn with NSDrawThreePartImage to create a
> resizable window.
>
> The problem is this: if i have an instance of NSTextField created within the
> NSView or NSWindow, the text field is selectable with mouse but does not
> accept keyboard events.
>
> I have my NSView set acceptsFirstResponder & becomeFirstResponder to return
> YES but still no dice.

By default, an NSWindow created with NSBorderlessWindowMask cannot
become the key window and thus cannot accept keyboard events. Subclass
NSWindow and override -canBecomeKeyWindow and it should work better
for you.

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


Re: Drop dowm status menubar item while hovering cursor over it

2009-06-10 Thread Andrew Farmer

On 10 Jun 2009, at 23:02, Arjun SM wrote:

Pardon me for i din't understand (still a novice). I did try adding a
tooltip for the menu item, but when i clicked on the menu bar and  
hovered
the mouse over my Menulet drop down didn't appear even though  
menuitem of
Time Machine, Bluetooth and other applications did drop down. any  
help is

much appreciated.


Oh, what he's asking is why you can't single-click to drop down one  
menu, then switch over to a statusbar item's menu without clicking  
again.


This behavior is common to all status bar items, and is arguably a  
bug. You can try reporting it to Apple, but it's unlikely to be fixed  
for a while yet.

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: Drop dowm status menubar item while hovering cursor over it

2009-06-10 Thread Gami Ravi
Hi,
I am also facing same problem that on adding tooltip for menuitem ,still 
dropdown list didn't come up while hovering mouse cursor over it.

Thanks & Regards,
Ravi Gami.
  - Original Message - 
  From: Arjun SM 
  To: Graham Cox 
  Cc: Gami Ravi ; Cocoa-dev Mailinglist 
  Sent: Thursday, June 11, 2009 11:32 AM
  Subject: Re: Drop dowm status menubar item while hovering cursor over it


  Pardon me for i din't understand (still a novice). I did try adding a tooltip 
for the menu item, but when i clicked on the menu bar and hovered the mouse 
over my Menulet drop down didn't appear even though menuitem of Time Machine, 
Bluetooth and other applications did drop down. any help is much appreciated.

  thanks,
  Arjun
   

  On Thu, Jun 11, 2009 at 10:49 AM, Graham Cox  wrote:


On 11/06/2009, at 3:10 PM, Gami Ravi wrote:


  In Mac, When menubar is in focus, at that time hovering cursor on any of 
menu item will drop down status menu for that item. I want to implement same 
functionality.




Just add a tooltip in IB to the menu item.

--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/arjun.sm%40gmail.com

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




Email Scanned for Virus & Dangerous Content by : 
www.CleanMailGateway.com 
___

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

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

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

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


Re: Drop dowm status menubar item while hovering cursor over it

2009-06-10 Thread Arjun SM
Pardon me for i din't understand (still a novice). I did try adding a
tooltip for the menu item, but when i clicked on the menu bar and hovered
the mouse over my Menulet drop down didn't appear even though menuitem of
Time Machine, Bluetooth and other applications did drop down. any help is
much appreciated.

thanks,
Arjun

On Thu, Jun 11, 2009 at 10:49 AM, Graham Cox  wrote:

>
> On 11/06/2009, at 3:10 PM, Gami Ravi wrote:
>
>  In Mac, When menubar is in focus, at that time hovering cursor on any of
>> menu item will drop down status menu for that item. I want to implement same
>> functionality.
>>
>
>
> Just add a tooltip in IB to the menu item.
>
> --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/arjun.sm%40gmail.com
>
> This email sent to arjun...@gmail.com
>
___

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

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

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

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


Re: Outlets not allocated

2009-06-10 Thread Kevin Cathey
 I know I could set the string in objects and on awakeFromNib set  
the text fields, but it just seems inefficien
We encourage you to use the controller's controller specific methods  
for knowing when you content is loaded:


NSWindowController -- windowDidLoad
UIViewController -- viewDidLoad

Since the behavior of awakeFromNib differs between iPhone OS and Mac  
OS X, using windowDidLoad or viewDidLoad will ensure you only receive  
that message once: when the window or view is loaded.


Kevin

--
Kevin Cathey


On 10 Jun 2009, at 09:56, Micha Fuhrmann wrote:


Rajendran,

Many thanks for your answer. You are right. Now there's something I  
don't understand in terms of sequence, at least it doesn't make  
sense to me. I instantiate the Object, why shouldn't I be able to  
send messages to contained objects? How am I suppose to deal with  
the sequence? I mean, I instantiate an object but the I can't  
dispose from it after. How do you deal with that kind issue? I know  
I could set the string in objects and on awakeFromNib set the text  
fields, but it just seems inefficient. Any tricks?


Michael

On 10 juin 09, at 18:30, rajendran_pichaimur...@mcafee.com wrote:



Hi,
 oulets are not allocated on initiate . Its guaranteed to be  
allocated only on awakeFromNib . Any message to outlet should be  
sent from awakeFromNib and not from init method.




Regards
Rajendran P

-Original Message-
From: cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
 [mailto:cocoa-dev-bounces 
+rajendran_pichaimurthy=mcafee@lists.apple.com] On Behalf Of  
Micha Fuhrmann

Sent: Wednesday, June 10, 2009 9:40 PM
To: Cocoa List
Subject: Outlets not allocated

Hi there,

It's been hours and really I don't get it. I've got a custom  
NSWindowController class. I'm loading it with a Nib. That Nib  
contains a window and text fields in it all linked through outlets  
to my NSWindowController class. When I allocate and initiate the  
window appears fine, but when I send a message to fill in the text  
fields nothing happens. If I set a breakpoint I can see that none  
of my outlets are allocated (0x0 under the value column). Why  
aren't they allocated and initiated when the Nib is loaded?


Any help greatly appreciated.
___

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

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

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

This email sent to rajendran_pichaimur...@mcafee.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/cathey%40apple.com

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


___

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

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

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

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


Re: Drop dowm status menubar item while hovering cursor over it

2009-06-10 Thread Graham Cox


On 11/06/2009, at 3:10 PM, Gami Ravi wrote:

In Mac, When menubar is in focus, at that time hovering cursor on  
any of menu item will drop down status menu for that item. I want to  
implement same functionality.



Just add a tooltip in IB to the menu item.

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


Drop dowm status menubar item while hovering cursor over it

2009-06-10 Thread Gami Ravi
Hi All,
In Mac, When menubar is in focus, at that time hovering cursor on any of menu 
item will drop down status menu for that item. I want to implement same 
functionality.


Thanks & Regards,
Ravi Gami.
___

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

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

2009-06-10 Thread Lorenzo Thurman
>
>
>  http://developer.apple.com/documentation/Cocoa/
> Conceptual/DrawColor/Tasks/StoringNSColorInDefaults.html
>
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty

Thanks, this page helped.
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: App does not start on a different machine

2009-06-10 Thread Nick Zitzmann


On Jun 10, 2009, at 8:35 PM, Martin Batholdy wrote:

11.06.09 04:24:15 com.apple.launchd[66]  
([0x0-0x53053].com.yourcompany. test[762]) Exited abnormally: Trace/ 
BPT trap

11.06.09 04:24:30 test[767] An uncaught exception was raised

11.06.09 04:24:30 test[767] *** -[NSCFArray objectAtIndex:]: index  
(0) beyond bounds (0)



Good; I figured there had to be something in the console... What I  
would do is install the developer tools on that other computer, if you  
haven't already, and then run the executable on the command line with  
GDB. Break on objc_exception_throw, and then you can get a trace on  
the problem once the exception is thrown. That ought to narrow down  
the problem.


Nick Zitzmann




___

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

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

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

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


Re: MVC Theory Help

2009-06-10 Thread Andy Lee

On Jun 10, 2009, at 1:23 PM, Chunk 1978 wrote:
so i get View and understand Controller, but i'm a touch fuzzy on  
Model.

does anyone have a simple way of explaining this?  perhaps a clever
anecdote?


I thought this was pretty clever:



My own off-the-cuff take on the subject:

The model is the information you present in the view.  It is often an  
abstraction of some real-world concept.  Simple examples include  
business concepts like Employee and mathematical concepts like  
Rectangle.  A typical view for displaying an Employee is a window  
containing text fields for viewing or editing the employee's name,  
social security number, salary, etc.  A typical view for displaying a  
Rectangle is, well, a window that draws a rectangle.


The model is kept separate from the view; it knows nothing about how  
it is displayed.  For one thing, this so-called "separation of  
concerns" helps you write maintainable and reusable code.  For another  
thing, by keeping the model independent of the view, you can easily  
display the same model different ways in different views.  A common  
example is any application with an inspector window -- it displays  
information one way in your document window and another way in the  
inspector.  Look at how IB displays the frame rectangle of any given  
view.  It displays this information graphically in the view's window  
(you can see where the view is located and how big it is) and  
textually in the inspector (you can read the x, y, width, and  
height).  Same model information (a rectangle) displayed in two views.


Another example: imagine a chess game.  In one view, it could be  
displayed graphically on a picture of a chessboard.  In another view,  
it could be displayed textually in algebraic notation.  In yet another  
view, it could be displayed textually in descriptive notation.  Same  
underlying model -- a ChessGame class or some such -- with three  
different presentations.


The controller acts as a liaison between the model and the view.

Sometimes the lines between model, view, and controller get fuzzy.  It  
happens.  So we scratch our heads for a while and try to sort them out  
as best we can.


--Andy

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: App does not start on a different machine

2009-06-10 Thread Luke the Hiesterman
Launch your app in the xcode debugger and then take a look at the  
backtrace. Find where you call objectAtIndex: in that backtrace, just  
before things crash, and that should point you to your problem. Paste  
the backtrace if you need help.


Luke

On Jun 10, 2009, at 7:35 PM, Martin Batholdy wrote:


ok,
this is what happens in the console;


11.06.09 04:24:15 com.apple.launchd[66]  
([0x0-0x53053].com.yourcompany. test[762]) Exited abnormally: Trace/ 
BPT trap

11.06.09 04:24:30 test[767] An uncaught exception was raised

11.06.09 04:24:30 test[767] *** -[NSCFArray objectAtIndex:]: index  
(0) beyond bounds (0)
11.06.09 04:24:30 test[767] *** Terminating app due to uncaught  
exception 'NSRangeException', reason: '*** -[NSCFArray  
objectAtIndex:]: index (0) beyond bounds (0)'

11.06.09 04:24:30 test[767] Stack: (
  2481156363,
  2476822075,
  2481155819,
  2481155882,
  2508822527,
  2508288392,
  13265,
  12362,
  2481215765,
  2499953754,
  2499913350,
  2499911656,
  2499910699,
  2499910505,
  2499909656,
  10118
)
11.06.09 04:24:32 com.apple.launchd[66]  
([0x0-0x56056].com.yourcompany. test[767]) Exited abnormally: Trace/ 
BPT trap





I had problems with array bounds,
but I thought I found all errors.

The problem is, when the program is running in debug mode - there  
don't appear any errors ...

So how can I find the array call that leads to this?





Am 11.06.2009 um 01:19 schrieb Nick Zitzmann:



On Jun 10, 2009, at 5:10 PM, Martin Batholdy wrote:

ZeroLinker is off, when I change the build configuration to  
"Release", right?


ZeroLink was removed from Xcode 3.0 for exactly this reason.

So I am pretty helpless with that issue, having no real experience  
with building programs on the mac.

And as I said, the program works fine on my machine ...



And as I said, what gets logged to the console, if anything, when  
the app fails to launch? If it was a dyld error, then it will be  
logged to the system console, and it often provides critical clues  
when an app isn't launching. You can find out by running / 
Applications/Utilities/Console.app.


Nick Zitzmann




___

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

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

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

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


___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Martin Batholdy

ok,
this is what happens in the console;


11.06.09 04:24:15 com.apple.launchd[66]  
([0x0-0x53053].com.yourcompany. test[762]) Exited abnormally: Trace/ 
BPT trap

11.06.09 04:24:30 test[767] An uncaught exception was raised

11.06.09 04:24:30 test[767] *** -[NSCFArray objectAtIndex:]: index (0)  
beyond bounds (0)
11.06.09 04:24:30 test[767] *** Terminating app due to uncaught  
exception 'NSRangeException', reason: '*** -[NSCFArray  
objectAtIndex:]: index (0) beyond bounds (0)'

11.06.09 04:24:30 test[767] Stack: (
   2481156363,
   2476822075,
   2481155819,
   2481155882,
   2508822527,
   2508288392,
   13265,
   12362,
   2481215765,
   2499953754,
   2499913350,
   2499911656,
   2499910699,
   2499910505,
   2499909656,
   10118
)
11.06.09 04:24:32 com.apple.launchd[66]  
([0x0-0x56056].com.yourcompany. test[767]) Exited abnormally: Trace/ 
BPT trap





I had problems with array bounds,
but I thought I found all errors.

The problem is, when the program is running in debug mode - there  
don't appear any errors ...

So how can I find the array call that leads to this?





Am 11.06.2009 um 01:19 schrieb Nick Zitzmann:



On Jun 10, 2009, at 5:10 PM, Martin Batholdy wrote:

ZeroLinker is off, when I change the build configuration to  
"Release", right?


ZeroLink was removed from Xcode 3.0 for exactly this reason.

So I am pretty helpless with that issue, having no real experience  
with building programs on the mac.

And as I said, the program works fine on my machine ...



And as I said, what gets logged to the console, if anything, when  
the app fails to launch? If it was a dyld error, then it will be  
logged to the system console, and it often provides critical clues  
when an app isn't launching. You can find out by running / 
Applications/Utilities/Console.app.


Nick Zitzmann




___

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

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

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

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


Custom NSView/NSWindow & First Responders

2009-06-10 Thread John Ku
Good afternoon all,
Im having trouble setting the correct first responder / key window in my
app.

I have a subclass NSWindow with NSBorderlessWindowMask and a custom drawing
NSView inside the window. So the window is transparent showing the NSView's
drawing. The NSView image is drawn with NSDrawThreePartImage to create a
resizable window.

The problem is this: if i have an instance of NSTextField created within the
NSView or NSWindow, the text field is selectable with mouse but does not
accept keyboard events.

I have my NSView set acceptsFirstResponder & becomeFirstResponder to return
YES but still no dice.


Anyone got any suggestions or leads?

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


Re: App does not start on a different machine

2009-06-10 Thread Nick Zitzmann


On Jun 10, 2009, at 5:10 PM, Martin Batholdy wrote:

ZeroLinker is off, when I change the build configuration to  
"Release", right?


ZeroLink was removed from Xcode 3.0 for exactly this reason.

So I am pretty helpless with that issue, having no real experience  
with building programs on the mac.

And as I said, the program works fine on my machine ...



And as I said, what gets logged to the console, if anything, when the  
app fails to launch? If it was a dyld error, then it will be logged to  
the system console, and it often provides critical clues when an app  
isn't launching. You can find out by running /Applications/Utilities/ 
Console.app.


Nick Zitzmann


___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Rob Ross
You could try adding logging statements after major milestones in your  
start-up sequence, and see what the last one it writes is. That might  
give you a clue how far it's getting (if at all) before it quits. It  
you don't even see the first message (which you should add as the very  
first line of main() ) then the problem may not be with the code  
itself but with how XCode has built it.


Rob

On Jun 10, 2009, at 4:10 PM, Martin Batholdy wrote:

well, I am pretty unexperienced and new to writing programs on the  
mac.


the app just creates two text files on start in a subfolder of the  
"application support" folder in the library folder of the user.

Then it reads and writes stuff in there.


There are no external / exotic libraries.
It is really a pretty simple program and it is compiled in 32bit  
universal (as seen in the project infos).


I haven't changed anything in the compile settings, have the latest  
XCode version and the console does not say anything.

And it is a release version I tried on the other macBook.

ZeroLinker is off, when I change the build configuration to  
"Release", right?




So I am pretty helpless with that issue, having no real experience  
with building programs on the mac.

And as I said, the program works fine on my machine ...






Am 11.06.2009 um 00:43 schrieb vinai:



--- On Wed, 6/10/09, Martin Batholdy  wrote:


my app works fine on my macbook,
but on a macbook pro it starts and then just disappears
immediately after the start
(nor error message).

The OS version is the same,
and the app is pretty simple (no graphic stuff or something
like that).

There are no errors or warnings in the code ... and as I
said, the app works fine on my machine.

why could that be?


You didn't provide a whole lot of information for us to go on, but  
just from the info you provided, the only things I could think of  
are external library dependencies, or user permission to run the  
application, or are you malloc'ing a huge amount of RAM on one  
machine that you don't have on the other machine ?


As another tip, I've had good luck debugging stuff by opening up OS  
X's terminal, and from the command line of the terminal, running  
the binary of the application itself from terminal's command line;  
something akin to:


  $ cd YourApp.app/Contents/MacOS/
  $ ./YourApp

This will output debugging info from fprintf's or NSLog's in your  
code to the terminal command line.  IIRC, this is equivalent to  
running the program from XCode's "Build and Run" option, where you  
get a logging terminal.  So if nothing shows up there, I am not  
sure how useful this tip is.


But more info would be helpful ...

vinai




___

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

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

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

This email sent to batho...@googlemail.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/rob.ross%40gmail.com

This email sent to rob.r...@gmail.com


___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Martin Batholdy

well, I am pretty unexperienced and new to writing programs on the mac.

the app just creates two text files on start in a subfolder of the  
"application support" folder in the library folder of the user.

Then it reads and writes stuff in there.


There are no external / exotic libraries.
It is really a pretty simple program and it is compiled in 32bit  
universal (as seen in the project infos).


I haven't changed anything in the compile settings, have the latest  
XCode version and the console does not say anything.

And it is a release version I tried on the other macBook.

ZeroLinker is off, when I change the build configuration to "Release",  
right?




So I am pretty helpless with that issue, having no real experience  
with building programs on the mac.

And as I said, the program works fine on my machine ...






Am 11.06.2009 um 00:43 schrieb vinai:



--- On Wed, 6/10/09, Martin Batholdy  wrote:


my app works fine on my macbook,
but on a macbook pro it starts and then just disappears
immediately after the start
(nor error message).

The OS version is the same,
and the app is pretty simple (no graphic stuff or something
like that).

There are no errors or warnings in the code ... and as I
said, the app works fine on my machine.

why could that be?


You didn't provide a whole lot of information for us to go on, but  
just from the info you provided, the only things I could think of  
are external library dependencies, or user permission to run the  
application, or are you malloc'ing a huge amount of RAM on one  
machine that you don't have on the other machine ?


As another tip, I've had good luck debugging stuff by opening up OS  
X's terminal, and from the command line of the terminal, running the  
binary of the application itself from terminal's command line;  
something akin to:


   $ cd YourApp.app/Contents/MacOS/
   $ ./YourApp

This will output debugging info from fprintf's or NSLog's in your  
code to the terminal command line.  IIRC, this is equivalent to  
running the program from XCode's "Build and Run" option, where you  
get a logging terminal.  So if nothing shows up there, I am not sure  
how useful this tip is.


But more info would be helpful ...

vinai




___

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

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

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

This email sent to batho...@googlemail.com


___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Kyle Sluder
Are you trying to run a debug build on a machine without the developer
tools installed?

--Kyle Sluder
___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Jean-Daniel Dupas


Le 11 juin 09 à 00:26, Martin Batholdy a écrit :


hi,

my app works fine on my macbook,
but on a macbook pro it starts and then just disappears immediately  
after the start

(nor error message).

The OS version is the same,
and the app is pretty simple (no graphic stuff or something like  
that).


There are no errors or warnings in the code ... and as I said, the  
app works fine on my machine.



why could that be?


In addition to what other have suggested, it may be that an Input  
Manager or something else like that is installed on the second machine  
and conflict with your app.



___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: App does not start on a different machine

2009-06-10 Thread vinai

--- On Wed, 6/10/09, Martin Batholdy  wrote:

> my app works fine on my macbook,
> but on a macbook pro it starts and then just disappears
> immediately after the start
> (nor error message).
> 
> The OS version is the same,
> and the app is pretty simple (no graphic stuff or something
> like that).
> 
> There are no errors or warnings in the code ... and as I
> said, the app works fine on my machine.
> 
> why could that be?

You didn't provide a whole lot of information for us to go on, but just from 
the info you provided, the only things I could think of are external library 
dependencies, or user permission to run the application, or are you malloc'ing 
a huge amount of RAM on one machine that you don't have on the other machine ?

As another tip, I've had good luck debugging stuff by opening up OS X's 
terminal, and from the command line of the terminal, running the binary of the 
application itself from terminal's command line; something akin to:

$ cd YourApp.app/Contents/MacOS/
$ ./YourApp

This will output debugging info from fprintf's or NSLog's in your code to the 
terminal command line.  IIRC, this is equivalent to running the program from 
XCode's "Build and Run" option, where you get a logging terminal.  So if 
nothing shows up there, I am not sure how useful this tip is.

But more info would be helpful ...

vinai



  
___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: App does not start on a different machine

2009-06-10 Thread Martin Batholdy

No,
both are intel macs.


Am 11.06.2009 um 00:31 schrieb Luke the Hiesterman:


Intel app on PPC?

Luke

On Jun 10, 2009, at 3:30 PM, Nick Zitzmann wrote:



On Jun 10, 2009, at 4:26 PM, Martin Batholdy wrote:

There are no errors or warnings in the code ... and as I said, the  
app works fine on my machine.



why could that be?



What does it say in the system console when the app won't launch,  
if anything?


Nick Zitzmann


___

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

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

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

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




___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Glenn L. Austin

On Jun 10, 2009, at 3:26 PM, Martin Batholdy wrote:


hi,

my app works fine on my macbook,
but on a macbook pro it starts and then just disappears immediately  
after the start

(nor error message).

The OS version is the same,
and the app is pretty simple (no graphic stuff or something like  
that).


There are no errors or warnings in the code ... and as I said, the  
app works fine on my machine.



why could that be?



Do you have ZeroLink enabled?  That causes many of the "works on my  
machine, but not on another machine" issues...


--
Glenn L. Austin, Computer Wizard and Race Car Driver <><




___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: App does not start on a different machine

2009-06-10 Thread Luke the Hiesterman

Intel app on PPC?

Luke

On Jun 10, 2009, at 3:30 PM, Nick Zitzmann wrote:



On Jun 10, 2009, at 4:26 PM, Martin Batholdy wrote:

There are no errors or warnings in the code ... and as I said, the  
app works fine on my machine.



why could that be?



What does it say in the system console when the app won't launch, if  
anything?


Nick Zitzmann


___

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

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

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

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


___

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

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

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

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


Re: App does not start on a different machine

2009-06-10 Thread Nick Zitzmann


On Jun 10, 2009, at 4:26 PM, Martin Batholdy wrote:

There are no errors or warnings in the code ... and as I said, the  
app works fine on my machine.



why could that be?



What does it say in the system console when the app won't launch, if  
anything?


Nick Zitzmann


___

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

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

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

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


Re: NSColorWell and bindings

2009-06-10 Thread Jerry Krinock


On 2009 Jun 10, at 13:16, Lorenzo Thurman wrote:


NSColor * color = [NSColor selectedMenuItemColor];

[defaults setObject:[NSArchiver archivedDataWithRootObject:color]  
forKey:

@"textColor"];

NSData * colorData = [defaults objectForKey:@"textColor"];


// Other default values


[[NSUserDefaultsController sharedUserDefaultsController]  
setInitialValues

:defaults];


There is a Data value in the preferences file, so there must be  
something

else going on.


Storing a color in user defaults is something you'd expect to be easy  
but is not.  I wrote a little category that helps, but if I recall  
correctly there are a few other hoops you need to jump through to make  
it work with bindings.  Anyhow they're all explained in the link to  
apple.com given below.  Read that whole web page and do what it says.


#import 


/*!
 @brief

 @details  The NSColor methods were copied from
 
http://developer.apple.com/documentation/Cocoa/Conceptual/DrawColor/Tasks/StoringNSColorInDefaults.html
*/
@interface NSUserDefaults (MoreTypes)

- (void)setColor:(NSColor*)aColor
  forKey:(NSString*)aKey ;

- (NSColor*)colorForKey:(NSString*)aKey ;

@end

@implementation NSUserDefaults (MoreTypes)

- (void)setColor:(NSColor *)aColor forKey:(NSString *)aKey {
NSData* theData = [NSArchiver archivedDataWithRootObject:aColor] ;
[self setObject:theData forKey:aKey] ;
}

- (NSColor*)colorForKey:(NSString *)aKey {
NSColor* theColor = nil ;
NSData* theData = [self dataForKey:aKey] ;
if (theData != nil) {
theColor = (NSColor*)[NSUnarchiver  
unarchiveObjectWithData:theData] ;

}

return theColor ;
}

@end

___

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

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


App does not start on a different machine

2009-06-10 Thread Martin Batholdy

hi,

my app works fine on my macbook,
but on a macbook pro it starts and then just disappears immediately  
after the start

(nor error message).

The OS version is the same,
and the app is pretty simple (no graphic stuff or something like that).

There are no errors or warnings in the code ... and as I said, the app  
works fine on my machine.



why could that be?
___

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

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

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

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


Re: CGGetMidX error?

2009-06-10 Thread Chunk 1978
ahh... thanks :)

On Wed, Jun 10, 2009 at 5:25 PM, Greg Parker wrote:
> On Jun 10, 2009, at 2:11 PM, Chunk 1978 wrote:
>>
>> i don't understand why i'm getting an error "invalid initializer" when
>> just declaring some variables in a method:
>>
>> -=-=-=-
>> CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
>> CGPoint screenCenterPoint = (CGRectGetMidX(fullScreenRect),
>> CGRectGetMidY(fullScreenRect));
>> -=-=-=-
>
> Because your initializer for `screenCenterPoint` is invalid. Try spelling it
> like one of these:
>
>    CGPoint screenCenterPoint = CGPointMake(CGRectGetMidX(fullScreenRect),
> CGRectGetMidY(fullScreenRect));
>
>    CGPoint screenCenterPoint = { CGRectGetMidX(fullScreenRect),
> CGRectGetMidY(fullScreenRect) };
>
>
> --
> Greg Parker     gpar...@apple.com     Runtime Wrangler
>
>
>
___

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

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

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

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


Re: CGGetMidX error?

2009-06-10 Thread Greg Parker

On Jun 10, 2009, at 2:11 PM, Chunk 1978 wrote:

i don't understand why i'm getting an error "invalid initializer" when
just declaring some variables in a method:

-=-=-=-
CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
CGPoint screenCenterPoint = (CGRectGetMidX(fullScreenRect),
CGRectGetMidY(fullScreenRect));
-=-=-=-


Because your initializer for `screenCenterPoint` is invalid. Try  
spelling it like one of these:


CGPoint screenCenterPoint = CGPointMake(CGRectGetMidX 
(fullScreenRect), CGRectGetMidY(fullScreenRect));


CGPoint screenCenterPoint = { CGRectGetMidX(fullScreenRect),  
CGRectGetMidY(fullScreenRect) };



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


___

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

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

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

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


Re: CGGetMidX error?

2009-06-10 Thread Clark Cox
On Wed, Jun 10, 2009 at 2:11 PM, Chunk 1978 wrote:
> i don't understand why i'm getting an error "invalid initializer" when
> just declaring some variables in a method:
>
> -=-=-=-
> CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
> CGPoint screenCenterPoint = (CGRectGetMidX(fullScreenRect),
> CGRectGetMidY(fullScreenRect));
> -=-=-=-

Replace the parentheses around the two CGRectGetMid... functions with
curly braces:

CGPoint screenCenterPoint = {CGRectGetMidX(fullScreenRect),
CGRectGetMidY(fullScreenRect)};

-- 
Clark S. Cox III
clarkc...@gmail.com
___

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

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

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

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


CGGetMidX error?

2009-06-10 Thread Chunk 1978
i don't understand why i'm getting an error "invalid initializer" when
just declaring some variables in a method:

-=-=-=-
CGRect fullScreenRect = [[UIScreen mainScreen] bounds];
CGPoint screenCenterPoint = (CGRectGetMidX(fullScreenRect),
CGRectGetMidY(fullScreenRect));
-=-=-=-
___

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

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

2009-06-10 Thread Lorenzo Thurman
On Wed, Jun 10, 2009 at 1:55 PM, Alexander Spohr  wrote:

> Your NSUserDefaults do not contain a default for the color. Hence the
> complaining of the color well. Provode a default color and it will work.
>
>atze
>
> ps. what are all those ** doing in your mail?
>
>
> Am 10.06.2009 um 18:13 schrieb Lorenzo Thurman:
>
>  I've just added an NSColorWell to my application. I bound it to my
>> NSUserDefaultsController with a controller key of values, model key path
>> values and a value transformer of NSUnarchiveFromData. When I run my
>> program
>> and click on the color well, I get this error in the console:
>>
>>  Assertion failure in -[NSColorPanelColorWell setColor:],
>> /SourceCache/AppKit/AppKit-949.46/AppKit.subproj/NSColorWell.m:496*
>>
>> *Invalid parameter not satisfying: aColor != nil*
>>
>> *I checked COcoaBuilder and google, but could not find and answer to this,
>> but I did find this tutorial at Stanford U:*
>>
>> *CocoaBindingsTutorial.pdf<
>> http://www.stanford.edu/class/cs193e/Downloads/CocoaBindingsTutorial.pdf>
>> *
>>
>> *This suggests what I've done is correct, but clearly, I've either missed
>> something or there is a bug somewhere. Can someone provide me with some
>> insight? I've running XCode 3.1 on Leopard.*
>>
>> *Thanks*
>>
>> *
>> *
>>
>> --
>> "My break-dancing days are over, but there's always the funky chicken"
>> --The Full Monty
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/atze%40freeport.de
>>
>> This email sent to a...@freeport.de
>>
>
> I use +initialize to provide a default value for the color well.

NSColor * color = [NSColor selectedMenuItemColor];

[defaults setObject:[NSArchiver archivedDataWithRootObject:color] forKey:
@"textColor"];

NSData * colorData = [defaults objectForKey:@"textColor"];


// Other default values


[[NSUserDefaultsController sharedUserDefaultsController] setInitialValues
:defaults];


There is a Data value in the preferences file, so there must be something
else going on.


-- 
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty
___

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

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

2009-06-10 Thread Greg Guerin

Chunk 1978 wrote:

so i get View and understand Controller, but i'm a touch fuzzy on  
Model.

 does anyone have a simple way of explaining this?  perhaps a clever
anecdote?


Look at a Finder window.

The file-system is the Model for Finder windows.  The view depends on  
what the user has chosen: Icons, List, Columns, or Cover Flow.  The  
choice of view does not affect the model, but things that exist or  
change in the model drive what appears in the view.


If something changes in the model, say some program creates or  
deletes a file, then the view changes, even though the creation or  
deletion of the file only changed the model, i.e. the file-system.   
Observers of the model will see the change, and make the requisite  
changes to the view, but exactly what those view changes are depend  
entirely on what kind of view it is.


Another example is CPU temperature.

The physical temperature sensor (and its device driver, etc.)  
comprise the model.  Any number of views can monitor and express  
temperature: a digital display (Centigrade or Fahrenheit), a vertical  
bar, a horizontal bar, or even something that changes the display's  
color calibration so that hotter temps make the display redder.


Not every view has to be visual, however.  For example, the  
temperature monitor (a Controller) can drive a speech synthesizer  
"view" that changes speech modulation to sound more frantic as  
temperature rises.  It can even send Tweets or do other things that  
have no visual element.


Furthermore, there can be hardware-based "views", like fan-speed,  
where the Controller monitors changes in the model and drives some  
hardware, namely a fan-driver chip.


  -- GG
___

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

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


NSWindow curved shape antialiasing + shadow

2009-06-10 Thread Stamenkovic Florijan

Hi all,

I am experimenting with custom shaped NSWindows, that I draw into  
using NSBezierPath. Generally all is good, but there is a small  
problem. If the edge of the window is defined by a curve that is  
antialiased, then the shadow is drawn at the first outside pixel that  
is not drawn into at all. Resulting in the window edge having  
consisting of:


Opaque pixels -> Semitransparent pixels -> Opaque shadow line ->  
Shadow falloff


This is irritating. I have the possibility of turning of antialiasing  
for my background shape, resulting in not having semitransparent  
pixels in between of the opaque background and the opaque shadow line.  
This is better. However, results in rough curves...


I am looking for a way to have both (smooth curves, and a nice  
shadow). What I am thinking of is putting a window with the same  
shape, slightly smaller, behind my main window. And then only have the  
back window draw a shadow, which would hopefully result in something  
decent.


Any thoughts on this? Is there a better solution?

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


Re: Outlets not allocated

2009-06-10 Thread Andy Lee
On Wednesday, June 10, 2009, at 12:56PM, "Micha Fuhrmann"  
wrote:
>Rajendran,
>
>Many thanks for your answer. You are right. Now there's something I  
>don't understand in terms of sequence, at least it doesn't make sense  
>to me. I instantiate the Object, why shouldn't I be able to send  
>messages to contained objects?

A nib file describes a bunch of connected objects.  When Cocoa loads the nib 
file, there are two things it has to do: (1) instantiate the objects (using 
alloc plus an appropriate init method) and (2) connect them (using setter 
methods where they exist, otherwise accessing ivars directly).  At the time 
objects are being initted (i.e., inside your init method), the connections 
haven't been made yet.  This means the outlets have not been set.  The outlets 
are set in a separate stage, after all the objects being connected have been 
fully initted.

> How am I suppose to deal with the  
>sequence?

That is exactly what awakeFromNib is for.  After Cocoa (1) instantiates the 
objects and (2) connects them, it (3) sends awakeFromNib to them so they can do 
any initialization they have to do that has to be done after the connections 
have been made.

> I mean, I instantiate an object but the I can't dispose from  
>it after.

What do you mean "dispose from it"?  Can you show a code example of what you 
mean?  What are you trying to do that would be "inefficient" in awakeFromNib as 
opposed to init?

--Andy

> How do you deal with that kind issue? I know I could set the  
>string in objects and on awakeFromNib set the text fields, but it just  
>seems inefficient. Any tricks?
>
>Michael
>
>On 10 juin 09, at 18:30, rajendran_pichaimur...@mcafee.com wrote:
>
>>
>> Hi,
>>   oulets are not allocated on initiate . Its guaranteed to be  
>> allocated only on awakeFromNib . Any message to outlet should be  
>> sent from awakeFromNib and not from init method.
>>
>>
>>
>> Regards
>> Rajendran P
>>
>> -Original Message-
>> From: cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
>>  [mailto:cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
>> ] On Behalf Of Micha Fuhrmann
>> Sent: Wednesday, June 10, 2009 9:40 PM
>> To: Cocoa List
>> Subject: Outlets not allocated
>>
>> Hi there,
>>
>> It's been hours and really I don't get it. I've got a custom  
>> NSWindowController class. I'm loading it with a Nib. That Nib  
>> contains a window and text fields in it all linked through outlets  
>> to my NSWindowController class. When I allocate and initiate the  
>> window appears fine, but when I send a message to fill in the text  
>> fields nothing happens. If I set a breakpoint I can see that none of  
>> my outlets are allocated (0x0 under the value column). Why aren't  
>> they allocated and initiated when the Nib is loaded?
>>
>> Any help greatly appreciated.
>> ___
>>
>> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>>
>> Please do not post admin requests or moderator comments to the list.
>> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>>
>> Help/Unsubscribe/Update your Subscription:
>> http://lists.apple.com/mailman/options/cocoa-dev/rajendran_pichaimurthy%40mcafee.com
>>
>> This email sent to rajendran_pichaimur...@mcafee.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/aglee%40mac.com
>
>This email sent to ag...@mac.com
>
>
___

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

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

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

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


Re: Outlets not allocated

2009-06-10 Thread Alexander Spohr


Am 10.06.2009 um 18:56 schrieb Micha Fuhrmann:


Any tricks?


Provide some 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: NSColorWell and bindings

2009-06-10 Thread Alexander Spohr
Your NSUserDefaults do not contain a default for the color. Hence the  
complaining of the color well. Provode a default color and it will work.


atze

ps. what are all those ** doing in your mail?


Am 10.06.2009 um 18:13 schrieb Lorenzo Thurman:


I've just added an NSColorWell to my application. I bound it to my
NSUserDefaultsController with a controller key of values, model key  
path
values and a value transformer of NSUnarchiveFromData. When I run my  
program

and click on the color well, I get this error in the console:

 Assertion failure in -[NSColorPanelColorWell setColor:],
/SourceCache/AppKit/AppKit-949.46/AppKit.subproj/NSColorWell.m:496*

*Invalid parameter not satisfying: aColor != nil*

*I checked COcoaBuilder and google, but could not find and answer to  
this,

but I did find this tutorial at Stanford U:*

*CocoaBindingsTutorial.pdf

*

*This suggests what I've done is correct, but clearly, I've either  
missed
something or there is a bug somewhere. Can someone provide me with  
some

insight? I've running XCode 3.1 on Leopard.*

*Thanks*

*
*

--
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty
___

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

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

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

This email sent to a...@freeport.de


___

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

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

2009-06-10 Thread Uli Kusterer

On 09.06.2009, at 17:48, Greg Guerin wrote:

How do you know -init is only run once?

Are you sure no other init method is run?  Like maybe initWithCoder:?



 As a general rule, when you wonder where an object is coming from,  
it helps to have a look at any and all -init methods the class has. In  
particular init and initWithCoder:. In addition to that, objects can  
be created by a call to copy or mutableCopy, so you can get very  
interesting behaviour if your base class implements NSCopying and you  
forgot to override that in the subclass and do your own additional work.


Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





___

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

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

2009-06-10 Thread Stephen Blinkhorn

On 10 Jun 2009, at 11:27, Nick Zitzmann wrote:


On Jun 10, 2009, at 11:20 AM, Stephen Blinkhorn wrote:

I use NSPopUpButton to create menus with say 30-40 entries.  I'd  
like to divide the top half of the menu visually from the bottom  
half with lines or some kind of heading.  Is this possible via  
NSPopUpButton - I populate the menu via addItemsWithTitles:



It's possible, but not with -addItemsWithTitles:. You'll need to  
insert separator items, created by calling +[NSMenuItem  
separatorItem], into the pop-up button's menu object.


Ahh, thanks Nick.

Stephen
___

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

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

2009-06-10 Thread Quincey Morris

On Jun 10, 2009, at 10:23, Chunk 1978 wrote:

so i get View and understand Controller, but i'm a touch fuzzy on  
Model.

does anyone have a simple way of explaining this?  perhaps a clever
anecdote?


So mmalc, b.bum and Twiggy walk into a bar ...

Oops, nvm, wrong model.

Have you looked at:


http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/ObjCTutorial/01Introduction/01Introduction.html

yet?


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: re-making connections with a different controller

2009-06-10 Thread Quincey Morris

On Jun 10, 2009, at 07:40, Stephen Blinkhorn wrote:

Can I make connections programmatically?  That might be easier for  
now.


It's catch-22, I think. You have to find all the controls that need  
their target set, and identify which target to use for which control.  
Normally, the easiest way to do that would be to use IBOutlets, but  
you'd need hundreds of those, and then you'd have to drag a connection  
from each to the corresponding control. :)



___

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

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

2009-06-10 Thread Nick Zitzmann


On Jun 10, 2009, at 11:20 AM, Stephen Blinkhorn wrote:

I use NSPopUpButton to create menus with say 30-40 entries.  I'd  
like to divide the top half of the menu visually from the bottom  
half with lines or some kind of heading.  Is this possible via  
NSPopUpButton - I populate the menu via addItemsWithTitles:



It's possible, but not with -addItemsWithTitles:. You'll need to  
insert separator items, created by calling +[NSMenuItem  
separatorItem], into the pop-up button's menu object.


Nick Zitzmann


___

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

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

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

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


MVC Theory Help

2009-06-10 Thread Chunk 1978
so i get View and understand Controller, but i'm a touch fuzzy on Model.
 does anyone have a simple way of explaining this?  perhaps a clever
anecdote?
___

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

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


Organising visual content of NSPopUpButton

2009-06-10 Thread Stephen Blinkhorn

Hello, quick question,

I use NSPopUpButton to create menus with say 30-40 entries.  I'd like  
to divide the top half of the menu visually from the bottom half with  
lines or some kind of heading.  Is this possible via NSPopUpButton - I  
populate the menu via addItemsWithTitles:


Thanks,
Stephen


___

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

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

2009-06-10 Thread Rajendran_Pichaimurthy
Michael,
   the nib files are more like a serialized/archived object. Basically nib 
files are all data stored in a flat file. After the init method Cocoa Runtime 
creates objects(windows/text fields) from these nib files and uses it. Its more 
or less guaranteed to fail if you are sending a message from init.The complete 
object creation from the NIB file is completed only on getting a 
awakeFromNib.If want to initialize from init try binding 

Regards
Rajendran P



-Original Message-
From: cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
[mailto:cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com] On 
Behalf Of Micha Fuhrmann
Sent: Wednesday, June 10, 2009 10:26 PM
To: Pichaimurthy, Rajendran
Cc: Cocoa List
Subject: Re: Outlets not allocated

Rajendran,

Many thanks for your answer. You are right. Now there's something I don't 
understand in terms of sequence, at least it doesn't make sense to me. I 
instantiate the Object, why shouldn't I be able to send messages to contained 
objects? How am I suppose to deal with the sequence? I mean, I instantiate an 
object but the I can't dispose from it after. How do you deal with that kind 
issue? I know I could set the string in objects and on awakeFromNib set the 
text fields, but it just seems inefficient. Any tricks?

Michael

On 10 juin 09, at 18:30, rajendran_pichaimur...@mcafee.com wrote:

>
> Hi,
>   oulets are not allocated on initiate . Its guaranteed to be 
> allocated only on awakeFromNib . Any message to outlet should be sent 
> from awakeFromNib and not from init method.
>
>
>
> Regards
> Rajendran P
>
> -Original Message-
> From: cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
>  [mailto:cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
> ] On Behalf Of Micha Fuhrmann
> Sent: Wednesday, June 10, 2009 9:40 PM
> To: Cocoa List
> Subject: Outlets not allocated
>
> Hi there,
>
> It's been hours and really I don't get it. I've got a custom  
> NSWindowController class. I'm loading it with a Nib. That Nib  
> contains a window and text fields in it all linked through outlets  
> to my NSWindowController class. When I allocate and initiate the  
> window appears fine, but when I send a message to fill in the text  
> fields nothing happens. If I set a breakpoint I can see that none of  
> my outlets are allocated (0x0 under the value column). Why aren't  
> they allocated and initiated when the Nib is loaded?
>
> Any help greatly appreciated.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/rajendran_pichaimurthy%40mcafee.com
>
> This email sent to rajendran_pichaimur...@mcafee.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/rajendran_pichaimurthy%40mcafee.com

This email sent to rajendran_pichaimur...@mcafee.com
___

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

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

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

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


Re: Outlets not allocated

2009-06-10 Thread Micha Fuhrmann

Rajendran,

Many thanks for your answer. You are right. Now there's something I  
don't understand in terms of sequence, at least it doesn't make sense  
to me. I instantiate the Object, why shouldn't I be able to send  
messages to contained objects? How am I suppose to deal with the  
sequence? I mean, I instantiate an object but the I can't dispose from  
it after. How do you deal with that kind issue? I know I could set the  
string in objects and on awakeFromNib set the text fields, but it just  
seems inefficient. Any tricks?


Michael

On 10 juin 09, at 18:30, rajendran_pichaimur...@mcafee.com wrote:



Hi,
  oulets are not allocated on initiate . Its guaranteed to be  
allocated only on awakeFromNib . Any message to outlet should be  
sent from awakeFromNib and not from init method.




Regards
Rajendran P

-Original Message-
From: cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
 [mailto:cocoa-dev-bounces+rajendran_pichaimurthy=mcafee@lists.apple.com 
] On Behalf Of Micha Fuhrmann

Sent: Wednesday, June 10, 2009 9:40 PM
To: Cocoa List
Subject: Outlets not allocated

Hi there,

It's been hours and really I don't get it. I've got a custom  
NSWindowController class. I'm loading it with a Nib. That Nib  
contains a window and text fields in it all linked through outlets  
to my NSWindowController class. When I allocate and initiate the  
window appears fine, but when I send a message to fill in the text  
fields nothing happens. If I set a breakpoint I can see that none of  
my outlets are allocated (0x0 under the value column). Why aren't  
they allocated and initiated when the Nib is loaded?


Any help greatly appreciated.
___

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

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

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

This email sent to rajendran_pichaimur...@mcafee.com


___

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

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

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

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


Re: Outlets not allocated

2009-06-10 Thread Sidney San Martín
What are your interface elements hooked up to in IB?

They should be going to File's Owner, set to your controller's class,
which will point to the object that owns the nib. If you've dragged a
new instance of your controller into the nib, it'll be totally
separate from the once that loaded it.
-Sidney

On Wed, Jun 10, 2009 at 12:10 PM, Micha Fuhrmann wrote:
> Hi there,
>
> It's been hours and really I don't get it. I've got a custom
> NSWindowController class. I'm loading it with a Nib. That Nib contains a
> window and text fields in it all linked through outlets to my
> NSWindowController class. When I allocate and initiate the window appears
> fine, but when I send a message to fill in the text fields nothing happens.
> If I set a breakpoint I can see that none of my outlets are allocated (0x0
> under the value column). Why aren't they allocated and initiated when the
> Nib is loaded?
>
> Any help greatly appreciated.
> ___
>
> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
> http://lists.apple.com/mailman/options/cocoa-dev/s%40sidneysm.com
>
> This email sent to s...@sidneysm.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


NSColorWell and bindings

2009-06-10 Thread Lorenzo Thurman
I've just added an NSColorWell to my application. I bound it to my
NSUserDefaultsController with a controller key of values, model key path
values and a value transformer of NSUnarchiveFromData. When I run my program
and click on the color well, I get this error in the console:

 Assertion failure in -[NSColorPanelColorWell setColor:],
/SourceCache/AppKit/AppKit-949.46/AppKit.subproj/NSColorWell.m:496*

*Invalid parameter not satisfying: aColor != nil*

*I checked COcoaBuilder and google, but could not find and answer to this,
but I did find this tutorial at Stanford U:*

*CocoaBindingsTutorial.pdf
*

*This suggests what I've done is correct, but clearly, I've either missed
something or there is a bug somewhere. Can someone provide me with some
insight? I've running XCode 3.1 on Leopard.*

*Thanks*

*
*

-- 
"My break-dancing days are over, but there's always the funky chicken"
--The Full Monty
___

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

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


Outlets not allocated

2009-06-10 Thread Micha Fuhrmann

Hi there,

It's been hours and really I don't get it. I've got a custom  
NSWindowController class. I'm loading it with a Nib. That Nib contains  
a window and text fields in it all linked through outlets to my  
NSWindowController class. When I allocate and initiate the window  
appears fine, but when I send a message to fill in the text fields  
nothing happens. If I set a breakpoint I can see that none of my  
outlets are allocated (0x0 under the value column). Why aren't they  
allocated and initiated when the Nib is loaded?


Any help greatly appreciated.
___

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

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

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

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


Re: Photoshop plugin with Cocoa UI problems

2009-06-10 Thread Florian Soenens

Hi Frederik,

Have you tried wiring your window to an IBOutlet of your Controller  
and displaying it with [window makeKeyAndOrderFront:nil]; ?


This works for me anyway.

HTH,
Florian.

On 10 Jun 2009, at 16:07, Frederik Slijkerman wrote:


Hi all,

I'm trying to make a Photoshop plugin with a Cocoa user interface,  
but I'm running into a persistent problem: after closing the plugin  
window, Photoshop crashes 90% of the time with the following call  
stack:


#0  0xa04590d8 in _XHNDL_trapback_instruction
#1  0xbf800fac in ??
#2  0x917ea9a2 in __CFRunLoopDoObservers
#3  0x917ebcfc in CFRunLoopRunSpecific
#4  0x917eccd8 in CFRunLoopRunInMode
#5  0x969f42c0 in RunCurrentEventLoopInMode
#6  0x96aa7904 in GetNextEventMatchingMask
#7  0x96aa7766 in WNEInternal
#8  0x96aa76c5 in WaitNextEvent

I've tried every suggestion I could find. The main plugin is a  
Carbon bundle that locates the Cocoa bundle that actually contains  
the core plugin as suggested here:

http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/

The Cocoa bundle exports a plugin entry point as a C function. The  
Carbon bundle calls this from its own entry point using  
CFBundleCreate / CFBundleGetFunctionPointerForName, but it never  
releases the Cocoa bundle since apparently Cocoa bundles should not  
be unloaded. The whole idea behind this, as far as I can see, is  
that Photoshop unloads the Carbon bundle, but does not unload the  
core Cocoa bundle.


Next, the Cocoa bundle calls NSApplicationLoad, displays an empty  
window using [NSApp runModalForWindow], then closes the window and  
returns. At this point, I get the aforementioned crash.


What am I doing wrong? Any pointers would be highly appreciated --  
I've been staring at this for about three days now...


Best regards,
Frederik Slijkerman
___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/florian.soenens%40nss.be

This email sent to florian.soen...@nss.be




Looking for Web-to-Print Solutions?
Visit our website :   http://www.vit2print.com


This e-mail, and any attachments thereto, is intended only for use by the 
addressee(s) named herein and may contain legally privileged and/or 
confidential information and/or information protected by intellectual property 
rights.
If you are not the intended recipient, please note that any review, 
dissemination, disclosure, alteration, printing, copying or transmission of 
this e-mail and/or any file transmitted with it, is strictly prohibited and may 
be unlawful.
If you have received this e-mail by mistake, please immediately notify the 
sender and permanently delete the original as well as any copy of any e-mail 
and any printout thereof.
We may monitor e-mail to and from our network.

NSS nv Tieltstraat 167 8740 Pittem Belgium 
___


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

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

2009-06-10 Thread Scott Andrew
Make sure your C function calls NSApplicationLoad() this is needed to  
initialize Cocoa (including Cocoa runloops) from Carbon. Also make  
sure you setup your autorelease pool in you plug-in's main entry  
function.


The plug-in I wrote had all objective C except the startup code.

Scott Andrew

On Jun 10, 2009, at 7:07 AM, Frederik Slijkerman wrote:


Hi all,

I'm trying to make a Photoshop plugin with a Cocoa user interface,  
but I'm running into a persistent problem: after closing the plugin  
window, Photoshop crashes 90% of the time with the following call  
stack:


#0  0xa04590d8 in _XHNDL_trapback_instruction
#1  0xbf800fac in ??
#2  0x917ea9a2 in __CFRunLoopDoObservers
#3  0x917ebcfc in CFRunLoopRunSpecific
#4  0x917eccd8 in CFRunLoopRunInMode
#5  0x969f42c0 in RunCurrentEventLoopInMode
#6  0x96aa7904 in GetNextEventMatchingMask
#7  0x96aa7766 in WNEInternal
#8  0x96aa76c5 in WaitNextEvent

I've tried every suggestion I could find. The main plugin is a  
Carbon bundle that locates the Cocoa bundle that actually contains  
the core plugin as suggested here:

http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/

The Cocoa bundle exports a plugin entry point as a C function. The  
Carbon bundle calls this from its own entry point using  
CFBundleCreate / CFBundleGetFunctionPointerForName, but it never  
releases the Cocoa bundle since apparently Cocoa bundles should not  
be unloaded. The whole idea behind this, as far as I can see, is  
that Photoshop unloads the Carbon bundle, but does not unload the  
core Cocoa bundle.


Next, the Cocoa bundle calls NSApplicationLoad, displays an empty  
window using [NSApp runModalForWindow], then closes the window and  
returns. At this point, I get the aforementioned crash.


What am I doing wrong? Any pointers would be highly appreciated --  
I've been staring at this for about three days now...


Best regards,
Frederik Slijkerman
___

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

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

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

This email sent to scottand...@roadrunner.com


___

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

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

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

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


Re: [NSTask] -launch return

2009-06-10 Thread M Pulis

Erg,

It is you that asked the group for help.
It is your app that requires rosetta and bound to require it running;
presumably a user NOT using your app would not have it installed;
In our user testing, a delay during once a day computer startup is  
more tolerable than one at application launch. Humans still expect  
computers to take a moment to start once a day but we can agree that  
they want their apps now.
What "lots" of system resources are you possibly speaking of?  if no  
code is executing via rosetta, then, once started, please, what does  
it occupy? Mouse slower? What marginal system do you run that running  
rosetta makes any difference and yet a 2-3 second easily avoidable  
one-time startup at any time is unacceptable?
You can not possibly care about performance or resources if you must  
execute PPC code anyway. Sounds like the story of the princess and  
the pea.


Actually, I don't care as I find your response ungrateful and  
insulting, thank you. Have fun paying DTS for help!


gary

On Jun 10, 2009, at 4:08 AM, ERG Consultant wrote:



Oh sure - let's waste lots of system resources by starting rosetta  
every single time the system is booted whether or not it needs it.  
Nooo thanks!


Sent from my iPod

On Jun 9, 2009, at 10:08 PM, M Pulis  wrote:


On Jun 9, 2009, at 9:56 PM, Erg Consultant wrote:

I am willing to do the "pre-launch Rosetta" hack to work around but  
if it takes 2-3 seconds to launch and I do a exec/waitpid or  
whatever on my dummy process, then my main app is going to take up  
to 3 seconds to launch which is unacceptably slow.


Erg


I see. Let's hope DTS works out a better solution you. Extend the  
hack one step - make the dummy process a startup item.


Gary






___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: re-making connections with a different controller

2009-06-10 Thread Scott Andrew
One other thing to keep things simple.. Take all common functionality  
and put it into a base view controller class. Then subclass from there  
for any new controls, functionality, setup, etc.


Scott

On Jun 10, 2009, at 7:40 AM, Stephen Blinkhorn wrote:


On 9 Jun 2009, at 22:44, Quincey Morris wrote:


On Jun 9, 2009, at 19:50, Stephen Blinkhorn wrote:

If you must use a tab view, you could also approach it with a  
view xib and a view controller to define the common part of each  
tab. The view controller would act as an intermediary to pass the  
action methods on to the correct controller. (The details, and  
feasibility, of this approach might depend on exactly what class  
of controllers you're trying to use.)


That sounds interesting but will involve a near complete overhaul.


Are you sure?


Well, yes and no.  I'm writing the GUI for a real time audio  
program.  The back end of that is written in C++ which I've written  
too.  The Cocoa UI is getting quite complex now but is nearly  
finished so I'm a bit reluctant to tear it apart.  It is my first  
real Cocoa project though so I can't assume I've got it all right  
first time.



Moving the contents of the tabs to a different xib file (or is it  
xib files? are all the tabs identical in appearance?) is  
straightforward. Connecting the individual controls to the view  
controller (File's Owner) is straightforward. Writing intermediary  
action methods in your view controller subclass to pass the actions  
on the correct controller (held in an instance variable, or set as  
the representedObject) is straightforward.


All my tabs are identical.  The current purpose of my controller  
objects is to map the value from a control onto a nonlinear range.   
I display the nonlinear value in the UI for user feedback and then  
pass it to the C++ audio side.  There are a number of controls  
within in each tab(s) which require a custom mapping and differ from  
controller to controller based on some user selection.  Currently I  
deal with this by dynamically allocating/deallocating a kind of sub  
controller object of the required type at that time.



The only real work happens in (say) your window controller's  
awakeFromNib method. In that method, you would create as many view  
controllers as there are distinct tabs, passing the correct action  
controller object as a parameter, and letting the view controller  
instantiate its nib. Then, for each view controller, replace the  
appropriate tab subview with the view controller's view.


That doesn't require any design changes anywhere else in your  
application, AFAICT. It also has the advantage of making your life  
really easy if you ever have to add one more control to all of the  
tabs.


I know I will be adding and changing things over the next few months  
so I think it will be worthwhile putting the time in to implement  
something like this.  It isn't so much the tedium of manually  
connecting things together but the inevitability that a few  
connections will go astray at some point.  I did try something with  
bindings but it quickly got out of hand for me.


Can I make connections programmatically?  That might be easier for  
now.


Thanks,
Stephen


___

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

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

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

This email sent to scottand...@roadrunner.com


___

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

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

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

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


Re: Using non-id sender in IBAction methods

2009-06-10 Thread Scott Ribe
> I never thought of trying this before, but it seems that having a more
> narrowly defined sender also limits the kind of controls IB lets you
> connect *from*, at least in the Cocoa IB and presumably in the iPhone
> IB as well.

Likewise for IBOutlets...

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: re-making connections with a different controller

2009-06-10 Thread Stephen Blinkhorn

On 9 Jun 2009, at 22:44, Quincey Morris wrote:


On Jun 9, 2009, at 19:50, Stephen Blinkhorn wrote:

If you must use a tab view, you could also approach it with a view  
xib and a view controller to define the common part of each tab.  
The view controller would act as an intermediary to pass the  
action methods on to the correct controller. (The details, and  
feasibility, of this approach might depend on exactly what class  
of controllers you're trying to use.)


That sounds interesting but will involve a near complete overhaul.


Are you sure?


Well, yes and no.  I'm writing the GUI for a real time audio program.   
The back end of that is written in C++ which I've written too.  The  
Cocoa UI is getting quite complex now but is nearly finished so I'm a  
bit reluctant to tear it apart.  It is my first real Cocoa project  
though so I can't assume I've got it all right first time.



Moving the contents of the tabs to a different xib file (or is it  
xib files? are all the tabs identical in appearance?) is  
straightforward. Connecting the individual controls to the view  
controller (File's Owner) is straightforward. Writing intermediary  
action methods in your view controller subclass to pass the actions  
on the correct controller (held in an instance variable, or set as  
the representedObject) is straightforward.


All my tabs are identical.  The current purpose of my controller  
objects is to map the value from a control onto a nonlinear range.  I  
display the nonlinear value in the UI for user feedback and then pass  
it to the C++ audio side.  There are a number of controls within in  
each tab(s) which require a custom mapping and differ from controller  
to controller based on some user selection.  Currently I deal with  
this by dynamically allocating/deallocating a kind of sub controller  
object of the required type at that time.



The only real work happens in (say) your window controller's  
awakeFromNib method. In that method, you would create as many view  
controllers as there are distinct tabs, passing the correct action  
controller object as a parameter, and letting the view controller  
instantiate its nib. Then, for each view controller, replace the  
appropriate tab subview with the view controller's view.


That doesn't require any design changes anywhere else in your  
application, AFAICT. It also has the advantage of making your life  
really easy if you ever have to add one more control to all of the  
tabs.


I know I will be adding and changing things over the next few months  
so I think it will be worthwhile putting the time in to implement  
something like this.  It isn't so much the tedium of manually  
connecting things together but the inevitability that a few  
connections will go astray at some point.  I did try something with  
bindings but it quickly got out of hand for me.


Can I make connections programmatically?  That might be easier for now.

Thanks,
Stephen


___

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

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


Photoshop plugin with Cocoa UI problems

2009-06-10 Thread Frederik Slijkerman

Hi all,

I'm trying to make a Photoshop plugin with a Cocoa user interface, but 
I'm running into a persistent problem: after closing the plugin window, 
Photoshop crashes 90% of the time with the following call stack:


#0  0xa04590d8 in _XHNDL_trapback_instruction
#1  0xbf800fac in ??
#2  0x917ea9a2 in __CFRunLoopDoObservers
#3  0x917ebcfc in CFRunLoopRunSpecific
#4  0x917eccd8 in CFRunLoopRunInMode
#5  0x969f42c0 in RunCurrentEventLoopInMode
#6  0x96aa7904 in GetNextEventMatchingMask
#7  0x96aa7766 in WNEInternal
#8  0x96aa76c5 in WaitNextEvent

I've tried every suggestion I could find. The main plugin is a Carbon 
bundle that locates the Cocoa bundle that actually contains the core 
plugin as suggested here:

http://furbo.org/2008/07/08/plug-ins-the-cocoa-way/

The Cocoa bundle exports a plugin entry point as a C function. The 
Carbon bundle calls this from its own entry point using CFBundleCreate / 
CFBundleGetFunctionPointerForName, but it never releases the Cocoa 
bundle since apparently Cocoa bundles should not be unloaded. The whole 
idea behind this, as far as I can see, is that Photoshop unloads the 
Carbon bundle, but does not unload the core Cocoa bundle.


Next, the Cocoa bundle calls NSApplicationLoad, displays an empty window 
using [NSApp runModalForWindow], then closes the window and returns. At 
this point, I get the aforementioned crash.


What am I doing wrong? Any pointers would be highly appreciated -- I've 
been staring at this for about three days now...


Best regards,
Frederik Slijkerman
___

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

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

2009-06-10 Thread Scott Ribe
> err = GetProcessForPID( pid, &psn );

As others have pointed out, this depends on the process reaching a certain
state, not just being launched. Perhaps use something like getpgid?

-- 
Scott Ribe
scott_r...@killerbytes.com
http://www.killerbytes.com/
(303) 722-0567 voice


___

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

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

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

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


Re: finding bundle identifiers

2009-06-10 Thread Rick C.
hi ken,

thanks for the reply and insight.  yes it seems no matter how i do it my idea 
is flawed because even if i start with a plist file and then try to find the 
associated app i will often find nothing since the app that did write the file 
did not necessarily follow naming after its bundle id.  and the apps that 
create several plist files i'm assuming can have one file named after its 
bundle id but any others will not be since there's just one id correct?  it 
does help me to move along to a better thought out plan.  thank you very much 
for your time.

rick






From: Ken Thomases 
To: Rick C. 
Cc: cocoa dev 
Sent: Wednesday, June 10, 2009 5:51:45 PM
Subject: Re: finding bundle identifiers

On Jun 10, 2009, at 4:27 AM, Rick C. wrote:

> to be more specific on what i'm trying to do i would like to be able to 
> review the files in a preferences folder and find the related app on the 
> system.  so i was trying to come up with a list of identifiers for 
> comparison.  but it seems that some files in a preferences folder (plists) do 
> not match up with the identifier of the related app.  maybe this is due to 
> the fact that a single app can create multiple plist files.  any input on how 
> i can achieve what i'm trying to do?

It's not generally possible to go from an arbitrary file to some "related" app. 
 And the files in the .../Library/Preferences folders are effectively 
arbitrary.  Sure, the vast majority of them are created by the CFPreferences or 
NSUserDefaults APIs, in which case they are probably named after bundle IDs, 
but some apps just write files directly to those folders.  Those apps don't 
always name their files using their bundle IDs.

Even if you do assume that those files are named after bundle IDs, then it 
seems strange to try to go from the list of all application bundle IDs to the 
files.  Why not go from the file names, parsing out the bundle IDs, to the 
apps?  It's easy enough to look up or manipulate an app given its bundle ID.

Lastly, you might be working from the files when you should be working from 
preference domains.  The frameworks currently work in terms of .plist files, 
but there's no guarantee that they will in the future.  They may start working 
in terms of some unified database, or whatever.  You might want to use 
-[NSUserDefaults persistentDomainNames] or CFPreferencesCopyApplicationList.

Regards,
Ken


  
___

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

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

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

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


Re: Reducing the Window size

2009-06-10 Thread Jean-Daniel Dupas


Le 10 juin 09 à 12:51, Arnab Ganguly a écrit :


Hi All,

From NSButton in the nib file is it possible to minimize part of the
application window? Like in case of Itunes when I click on the +  
button the

player content's lists get reduced and only the playing station can be
visible.How can I achieve the same ?



I think you can achieve this by creating a NSWindow subclass and  
overriding


- (void)zoom:(id)sender

which is the method called by the green button.


___

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

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


Reducing the Window size

2009-06-10 Thread Arnab Ganguly
Hi All,
>From NSButton in the nib file is it possible to minimize part of the
application window? Like in case of Itunes when I click on the + button the
player content's lists get reduced and only the playing station can be
visible.How can I achieve the same ?
Thanks
Arnab
___

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

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

2009-06-10 Thread Ken Thomases

On Jun 10, 2009, at 5:08 AM, Jean-Daniel Dupas wrote:


Le 10 juin 09 à 11:51, Ken Thomases a écrit :


On Jun 10, 2009, at 4:27 AM, Rick C. wrote:

to be more specific on what i'm trying to do i would like to be  
able to review the files in a preferences folder and find the  
related app on the system.  so i was trying to come up with a list  
of identifiers for comparison.  but it seems that some files in a  
preferences folder (plists) do not match up with the identifier of  
the related app.  maybe this is due to the fact that a single app  
can create multiple plist files.  any input on how i can achieve  
what i'm trying to do?


It's not generally possible to go from an arbitrary file to some  
"related" app.  And the files in the .../Library/Preferences  
folders are effectively arbitrary.  Sure, the vast majority of them  
are created by the CFPreferences or NSUserDefaults APIs, in which  
case they are probably named after bundle IDs, but some apps just  
write files directly to those folders.  Those apps don't always  
name their files using their bundle IDs.


No need to write file directly in the Preferences folder, you can  
pass any identifier when you use (low-level) CFPreferences API.


True, which is why I said "probably", above.  But 1) my point is that  
the files are arbitrary, not necessarily even created by CFPreferences  
or NSUserDefaults; and 2) they may not even conform to the reverse-DNS  
naming convention that CFPreferences says you should use for an app ID  
parameter.



Lastly, you might be working from the files when you should be  
working from preference domains.  The frameworks currently work in  
terms of .plist files, but there's no guarantee that they will in  
the future.  They may start working in terms of some unified  
database, or whatever.


And they will call it the Registry ;-)


Heh.  I thought of saying something like "... like the Windows  
registry", but decided not to pain all of my readers.  Apparently, the  
suffering was inevitable. ;)  And, I definitely am _not_ advocating  
such a change, nor do I imagine it likely.


Cheers,
Ken

___

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

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

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

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


Re: finding bundle identifiers

2009-06-10 Thread Jean-Daniel Dupas


Le 10 juin 09 à 11:51, Ken Thomases a écrit :


On Jun 10, 2009, at 4:27 AM, Rick C. wrote:

to be more specific on what i'm trying to do i would like to be  
able to review the files in a preferences folder and find the  
related app on the system.  so i was trying to come up with a list  
of identifiers for comparison.  but it seems that some files in a  
preferences folder (plists) do not match up with the identifier of  
the related app.  maybe this is due to the fact that a single app  
can create multiple plist files.  any input on how i can achieve  
what i'm trying to do?


It's not generally possible to go from an arbitrary file to some  
"related" app.  And the files in the .../Library/Preferences folders  
are effectively arbitrary.  Sure, the vast majority of them are  
created by the CFPreferences or NSUserDefaults APIs, in which case  
they are probably named after bundle IDs, but some apps just write  
files directly to those folders.  Those apps don't always name their  
files using their bundle IDs.


No need to write file directly in the Preferences folder, you can pass  
any identifier when you use (low-level) CFPreferences API.


Even if you do assume that those files are named after bundle IDs,  
then it seems strange to try to go from the list of all application  
bundle IDs to the files.  Why not go from the file names, parsing  
out the bundle IDs, to the apps?  It's easy enough to look up or  
manipulate an app given its bundle ID.


Lastly, you might be working from the files when you should be  
working from preference domains.  The frameworks currently work in  
terms of .plist files, but there's no guarantee that they will in  
the future.  They may start working in terms of some unified  
database, or whatever.



And they will call it the Registry ;-)


___

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

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

2009-06-10 Thread Ken Thomases

On Jun 10, 2009, at 4:27 AM, Rick C. wrote:

to be more specific on what i'm trying to do i would like to be able  
to review the files in a preferences folder and find the related app  
on the system.  so i was trying to come up with a list of  
identifiers for comparison.  but it seems that some files in a  
preferences folder (plists) do not match up with the identifier of  
the related app.  maybe this is due to the fact that a single app  
can create multiple plist files.  any input on how i can achieve  
what i'm trying to do?


It's not generally possible to go from an arbitrary file to some  
"related" app.  And the files in the .../Library/Preferences folders  
are effectively arbitrary.  Sure, the vast majority of them are  
created by the CFPreferences or NSUserDefaults APIs, in which case  
they are probably named after bundle IDs, but some apps just write  
files directly to those folders.  Those apps don't always name their  
files using their bundle IDs.


Even if you do assume that those files are named after bundle IDs,  
then it seems strange to try to go from the list of all application  
bundle IDs to the files.  Why not go from the file names, parsing out  
the bundle IDs, to the apps?  It's easy enough to look up or  
manipulate an app given its bundle ID.


Lastly, you might be working from the files when you should be working  
from preference domains.  The frameworks currently work in terms  
of .plist files, but there's no guarantee that they will in the  
future.  They may start working in terms of some unified database, or  
whatever.  You might want to use -[NSUserDefaults  
persistentDomainNames] or CFPreferencesCopyApplicationList.


Regards,
Ken

___

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

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

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

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


Re: finding bundle identifiers

2009-06-10 Thread Rick C.
hello again,

i have worked on this a bit more.  so far i have come up with this:

NSArray *urls;
_LSCopyAllApplicationURLs(&urls);

i can use this to find all the apps on a system.  then using NSBundle i can get 
the identifier.  to be more specific on what i'm trying to do i would like to 
be able to review the files in a preferences folder and find the related app on 
the system.  so i was trying to come up with a list of identifiers for 
comparison.  but it seems that some files in a preferences folder (plists) do 
not match up with the identifier of the related app.  maybe this is due to the 
fact that a single app can create multiple plist files.  any input on how i can 
achieve what i'm trying to do?  hope this makes sense and thanks again,

rick






From: Nikhil Khandelwal 
To: Rick C. 
Sent: Friday, June 5, 2009 5:34:23 PM
Subject: RE: finding bundle identifiers


-Original Message-
From: cocoa-dev-bounces+nikhil_khandelwal=persistent.co...@lists.apple.com 
[mailto:cocoa-dev-bounces+nikhil_khandelwal=persistent.co...@lists.apple.com] 
On Behalf Of Rick C.
Sent: Friday, June 05, 2009 2:55 PM
To: cocoa dev
Subject: finding bundle identifiers

hello,

is there a way to find all bundle identifiers that are installed?  i do know 
how to get the bundle identifier of an app for example, but i'm looking for a 
way to find all identifiers on a system.

thanks,

rick

Look for Launch Services application
It might help you
Otherwise send more details what u want to do.

___

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

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

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/nikhil_khandelwal%40persistent.co.in

This email sent to nikhil_khandel...@persistent.co.in

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



  
___

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

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

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

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


Re: nsdocument application hang ...

2009-06-10 Thread Brasseur Valéry
Hi,

thanks for your help.

How did you track the offending function ?
as of now, I roll back on some old code version (2 weeks ago) and did not get 
the probleme, so It seems that you got the good track... I am in the process of 
re-adding code line by line...
is there a better way ?

thanks

On 09/06/2009, at 5:05 PM, Brasseur Val�ry wrote:

> I am developing an NSDocument base app. When I run it without
> modifying my doc, all is working. If I made a modifcation, the
> application hang while display the "unsaved sheet" ...
>
> I don't know how to debug that ...
>
> any ideas would help.



I had this exact problem some time ago.

It turned out to be subtle corruption of my application's heap in a
completely unrelated part of the program. As such, it was extremely
difficult to track down, but the symptoms were exactly as you describe.

The cause, as I recall, was that I had two methods defined thus:

- (float) someMethod;
- (int)  someMethod;

Despite the different returns types, these have the same signature.
However, the compiler will use the signature of whichever one it
happens to encounter first during compilation, and emit code
accordingly. In my case, it went for the int version as it was defined
by a system framework. The resulting code will tend to corrupt things
pretty badly, yet do so without causing an immediate fault.

This is only one way that heap/stack corruption can occur of course,
but when it does occur, it seems to commonly cause a problem for the
"save changes" sheet. So you might want to look for similar corruption
occurring.

--Graham

"La photo ça se fait avec le Nikon dans les mains et pas une souris."




Ce message et les pièces jointes sont confidentiels et réservés à l'usage 
exclusif de ses destinataires. Il peut également être protégé par le secret 
professionnel. Si vous recevez ce message par erreur, merci d'en avertir 
immédiatement l'expéditeur et de le détruire. L'intégrité du message ne pouvant 
être assurée sur Internet, la responsabilité du groupe Atos Origin ne pourra 
être recherchée quant au contenu de ce message. Bien que les meilleurs efforts 
soient faits pour maintenir cette transmission exempte de tout virus, 
l'expéditeur ne donne aucune garantie à cet égard et sa responsabilité ne 
saurait être recherchée pour tout dommage résultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for 
the addressee; it may also be privileged. If you receive this e-mail in error, 
please notify the sender immediately and destroy it. As its integrity cannot be 
secured on the Internet, the Atos Origin group liability cannot be triggered 
for the message content. Although the sender endeavours to maintain a computer 
virus-free network, the sender does not warrant that this transmission is 
virus-free and will not be liable for any damages resulting from any virus 
transmitted.
___

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

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

2009-06-10 Thread Michael Ash
On Tue, Jun 9, 2009 at 11:12 PM, Erg Consultant wrote:
> I later monitor the pid that I squirreled away from within a periodic timer:
>
> err = GetProcessForPID( pid, &psn );
>
> If GetProcessForPID returns an error, I know the process is not running.

No you don't.

If GetProcessForPID returns an error, you know the process is not
running OR has not checked in with the window server yet.

A process can take an arbitrary amount of time to check in with the
window server. If this is your problem with Rosetta, then it's simply
exposing a bug in your code. You need to fix it to handle the case
where GetProcessForPID returns an error for a process that is alive.
This can and will happen. If you want to see if the process is
running, check for its existence directly (like with [task isRunning])
not by seeing if it has a PSN. Many processes do not have PSNs,
including every process you launch with NSTask until they check in
with the window server, if they ever do.

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