get a window in front by clicking on a menu item

2009-06-05 Thread Martin Batholdy

hi!

I have a problem, getting a window in front by clicking a menu item;

In my xcode project I have a menuHandler, which has methods to create  
a menu, add items to that menu, delete items and so on.


My AppController knows about the menuHandler and creates an instance  
of it in the awakeFromNib function.
There it tells the menuHandler to create a menu and add items to that  
menu.



One of that items has the title "open window x".
The method that generates this item in the menuHandler refers to the  
function "showWindow" inside itself

(setTarget:self).

I have created a window in the Interface Builder and have connected it  
with an IBOutlet NSWindow variable in the MenuHandler.



But the problem is, that the menu item does not do what it should do  
(invoke the window).


I know that it gets called, when I click on the item "open window x".
But all calls to the window are just ignored without a message in the  
log
(like [myWindow makeKeyAndOrderFront:self]; [myWindow orderBack:self];  
etc.)



Can someone help me on this?

I have also tried several options for the window in the IB ... no  
improvement ...

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: get a window in front by clicking on a menu item

2009-06-05 Thread Martin Batholdy
If you create your menuHandler in awakeFromNib, how can you connect  
it to the window in IB? It not there when you try to connect the  
outlet.


You seem to connect to another / a wrong menuHandler instance.


Yeah ... I think that is what is going wrong;

what I know is, that the method (showWindow:) gets called
(did make that sure by adding NSLog-messages) -
but it does not interact with the window.


but ... how would you do the connections to the window properly?

Do I have to connect the window in the IB with the AppController?
But than ... the MenuHandler don't know nothing about the window ...

And how can I say the menuItem in menuHandler to  use an existing  
instance of an AppController Object?

(with setTarget: ...) ..

I am pretty new to object-oriented programming.

So I don't really know how you can say a menuItem;
hey, there is an instance of an object that created you, and this also  
have connection to an existing window; now go to the openWindow method  
when someone clicks on you and get that damn window in front...

(is that the way it should work ..?)







Am 05.06.2009 um 20:54 schrieb Alexander Spohr:


Ah, wait!

Am 05.06.2009 um 18:03 schrieb Martin Batholdy:

My AppController [...] creates an instance of it in the  
awakeFromNib function.


[...]

I have created a window in the Interface Builder and have connected  
it with an IBOutlet NSWindow variable in the MenuHandler.


If you create your menuHandler in awakeFromNib, how can you connect  
it to the window in IB? It not there when you try to connect the  
outlet.


You seem to connect to another / a wrong menuHandler instance.


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


understanding problem; creation of instances of objects; xCode vs. Menu Builder

2009-06-05 Thread Martin Batholdy

hi,


I think I have a major understanding problem ...
And I just don't know how to solve the problem.


I have a methodfile X
and a methodfile Y


And I have a window that I have set up in the Interface Builder.
The window is connected with the method Y.


So, when the program starts, the window pops up and
because of the window-creation - an instance of Y was created (right?).


Now when I create an instance of Y inside of X -
how can I get access to that created window?

I have now two instances of Y; the one where my window "is in" - made  
by the interface builder.

And the one made inside the methodfile X ...


but how can I get acces to the instance of Y (where the window is  
defined) inside of X?





I don't know if I am thinking in the right way.
It would be great if someone here could give me a hint to get back on  
the right path ...


___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: get a window in front by clicking on a menu item

2009-06-05 Thread Martin Batholdy




[menuItem setTarget:myWindowOutlet];
[menuItem setAction:@selector(makeKeyAndOrderFront:)];




ok, that makes sense to me.
But now, the menuItem is inactive (so I cant click on it).


here my code;

hope someone can give me a clue what is wrong with the code...



AppController.h

#import "MenuHandler.h"

@implementation AppController

MenuHandler *menuCreate;

- (void) awakeFromNib {

menuCreate = [[MenuHandler alloc] init];

[menuCreate setIcon];
[menuCreate initItems];

return self;
}




And that happens when initItems get called;


MenuHandler.m

- (void) initOtherItems
{   
// Edit-List-Button
//NSMenuItem *newItem;
newItem = [[NSMenuItem alloc] init];
[newItem initWithTitle:@"Preferences"
   action:@selector(makeKeyAndOrderFront:)
   keyEquivalent:@""];
[menu addItem:newItem];
[newItem setEnabled:YES];
[newItem setTarget:prefs];

[menu addItem:[NSMenuItem separatorItem]];

}




and prefs is defined in MenuHandler.m, and connected with the window  
made in IB;



MenuHandler.h


@interface MenuHandler : NSObject {

NSMenu *menu;
NSMenuItem *newItem;
IBOutlet NSWindow *prefs;
}

- (void) initOtherItems;



___

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

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


NSArray vs. NSMutableArray ... "distinct objective-c type"

2009-06-06 Thread Martin Batholdy

hi,

I have created a method that do something with an NSArray.

Now when I use the method and give it an NSMutableArray instead of an  
NSArray,

I get a warning;

"passing argument x of "method" from distinct objective-c type"


Now, the result is ok. Everything is working how it is intended.


So, should I just ignore the message?
Or is that bad practice ...?

___

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

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


movable / dragable menu symbol

2009-06-06 Thread Martin Batholdy

hi,

I successfully created a menu item / symbol at the menu bar at the top  
right of mac OS.


Now I was wondering;
I can not drag the symbol via cmd+click and change the position of it  
by that.


With other symbols from other apps I can do that.


Is there a way to give the own symbol this ability?




thanks!




___

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

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

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

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


NSTabView; How to get the current / active tab ..?

2009-06-07 Thread Martin Batholdy

hi,


I have an IBOutlet defined in my header;

IBOutlet NSTabView *tabView;


This Outlet is connected with a TabView generated with Interface  
Builder.


The TabView has two tabs,
and in my implementation file I want to do something when tab1 is  
active and something else when tab2 is active.


I tried the following;

NSTabViewItem *tabViewItemX;
tabViewItemX = [tabView selectedTabViewItem];

if([tabViewItemX isEqualTo:[tabView tabViewItemAtIndex:0]]){
NSLog(@"1");
} else{
NSLog(@"2");
}

But it doesn't work properly. It is just always "2".

What do I wrong?



thanks!

___

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

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

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

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


How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy

Hi,

I have added a NSButton Check Box to a window.

Now I want to grab the state of this check box.

I added an IBOutlet to my header file and connected it with the check  
box in Interface Builder;


IBOutlet NSButton *launchOption;



Now I want to test the state via;

if([launchOption state] == 0) { NSLog(@"A");  }
else if([launchOption state] == 1) {NSLog(@"B");  }

The answer of this if / else statement is always A and I don't  
understand why.





Can someone help me?
thanks!
___

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

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

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

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


Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy
Use [launchOption state] == NSOnState or [launchOption state] ==  
NSOffState



I have tried this before,
but that does not change the behavior.

I have checked the connection in IB again ... but that seems also ok.


Is there another mistake that can be made concerning the issue ...?


Am 08.06.2009 um 23:58 schrieb KK:

Use [launchOption state] == NSOnState or [launchOption state] ==  
NSOffState


Keita

On Mon, Jun 8, 2009 at 5:52 PM, Martin Batholdy > wrote:

Hi,

I have added a NSButton Check Box to a window.

Now I want to grab the state of this check box.

I added an IBOutlet to my header file and connected it with the  
check box in Interface Builder;


IBOutlet NSButton *launchOption;



Now I want to test the state via;

if([launchOption state] == 0) { NSLog(@"A");}
else if([launchOption state] == 1) {NSLog(@"B");}

The answer of this if / else statement is always A and I don't  
understand why.





Can someone help me?
thanks!
___

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

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

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

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



___

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

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

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

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


Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy

You are right ... there is something wrong with the connection.

What I have done is the following;

IBOutlet NSButton *launchOption;

I have connected this Outlet with the NSButton by ctrl+dragging from  
the NSObject to the CheckBox in the window.


Then I control+dragged from the NSButton to the NSObject and connected  
a method to the NSButton / check box (which works fine)...



Is there something fundamentally wrong ...?




Am 09.06.2009 um 00:41 schrieb Steve Bird:



On Jun 8, 2009, at 6:33 PM, Martin Batholdy wrote:

Use [launchOption state] == NSOnState or [launchOption state] ==  
NSOffState



I have tried this before,
but that does not change the behavior.

I have checked the connection in IB again ... but that seems also ok.


Is there another mistake that can be made concerning the issue ...?


--- Try testing if (launchOption == nil).  Maybe there's something  
wrong with the connection that you can't tell by looking.


WHEN are you looking at the state?









Am 08.06.2009 um 23:58 schrieb KK:

Use [launchOption state] == NSOnState or [launchOption state] ==  
NSOffState


Keita

On Mon, Jun 8, 2009 at 5:52 PM, Martin Batholdy > wrote:

Hi,

I have added a NSButton Check Box to a window.

Now I want to grab the state of this check box.

I added an IBOutlet to my header file and connected it with the  
check box in Interface Builder;


IBOutlet NSButton *launchOption;



Now I want to test the state via;

if([launchOption state] == 0) { NSLog(@"A");}
else if([launchOption state] == 1) {NSLog(@"B");}

The answer of this if / else statement is always A and I don't  
understand why.





Can someone help me?
thanks!
___

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

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

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


This email sent to kthem...@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/sbird 
%40culverson.com


This email sent to sb...@culverson.com



Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175




___

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

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

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

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


Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy


WHEN are you looking at the state?



I look at the state in the method that is invoked by the NSButton  
(clicking on it).













Am 08.06.2009 um 23:58 schrieb KK:

Use [launchOption state] == NSOnState or [launchOption state] ==  
NSOffState


Keita

On Mon, Jun 8, 2009 at 5:52 PM, Martin Batholdy > wrote:

Hi,

I have added a NSButton Check Box to a window.

Now I want to grab the state of this check box.

I added an IBOutlet to my header file and connected it with the  
check box in Interface Builder;


IBOutlet NSButton *launchOption;



Now I want to test the state via;

if([launchOption state] == 0) { NSLog(@"A");}
else if([launchOption state] == 1) {NSLog(@"B");}

The answer of this if / else statement is always A and I don't  
understand why.





Can someone help me?
thanks!
___

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

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

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


This email sent to kthem...@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/sbird 
%40culverson.com


This email sent to sb...@culverson.com



Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175




___

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

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

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

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


Re: How to get a NSButton (check box) state

2009-06-08 Thread Martin Batholdy




in that case, you should use [sender state]

K



Thanks!
That did it!


But what do I have to do if I want to set the state in the awakeFromNib?

I tried:

[launchOption setState:NSOnState];
[launchOption setState:1];


But the Button stays on "Off" state (like in Interface Builder set)...




thanks again!




On Mon, Jun 8, 2009 at 6:54 PM, Martin Batholdy > wrote:


WHEN are you looking at the state?


I look at the state in the method that is invoked by the NSButton  
(clicking on it).












Am 08.06.2009 um 23:58 schrieb KK:

Use [launchOption state] == NSOnState or [launchOption state] ==  
NSOffState


Keita

On Mon, Jun 8, 2009 at 5:52 PM, Martin Batholdy > wrote:

Hi,

I have added a NSButton Check Box to a window.

Now I want to grab the state of this check box.

I added an IBOutlet to my header file and connected it with the  
check box in Interface Builder;


IBOutlet NSButton *launchOption;



Now I want to test the state via;

if([launchOption state] == 0) { NSLog(@"A");}
else if([launchOption state] == 1) {NSLog(@"B");}

The answer of this if / else statement is always A and I don't  
understand why.





Can someone help me?
thanks!
___

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

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

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

This email sent to kthem...@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/sbird%40culverson.com

This email sent to sb...@culverson.com


Steve Bird
Culverson Software - Elegant software that is a pleasure to use.
www.Culverson.com (toll free) 1-877-676-8175



___

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

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

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

This email sent to kthem...@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


Add app to "launch on startup" list via AppleScript

2009-06-08 Thread Martin Batholdy

Hi,

I have the following AppleScript that let me add an application to the  
"launch on startup" menu:


tell application "System Events"
make login item at end with properties {path:"...", kind:application}
end tell

The script works fine when I start it in the script editor for  
AppleScripts.


But when I implement it in my cocoa app, the code is executed properly  
(when I copy the code that is created out of the log window and start  
it in the script editor it works) - but the app don't appear in the  
"launch on startup" menu under preferences -> users ...


Does my app have the propper rights to do that?
Is that the problem?



thanks for any help!

___

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

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


no scroll bars (NSTableView)

2009-06-08 Thread Martin Batholdy

hi,


I have set up a NSTableView in the Interface Builder.
I have connected this with a NSObject Outlet.
And I have set the data source of the NSTableView to the NSObject.

The problem I have is that there don't appear any scroll bars even  
when the content doesn't fit.


I have a method called "delete" which deletes the selected entry when  
a button is pressed.

In this method there is a [TableOutlet reloadData]; call.

After deleting an entry there are appearing at least vertical  
scrollbars.



I tried to add the reloadData call to the init call.
I also tried noteNumberOfRowsChanged like suggested in some forum  
postings I found ...



But nothing happens.


Can someone help me on this issue?
Thanks!
___

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

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

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

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


Re: no scroll bars (NSTableView)

2009-06-09 Thread Martin Batholdy

ok,

I think now I can describe my problem with a little more detail;

I have a table view which has only one column.

Now when the user resizes this column expanding it to the right, the  
horizontal scroll bar appears and everything is fine.



But I want to size the column, depending on the entries.
So that the user doesn't have to do the resizing manually-

How can I say the app;
look at how many characters the entries have, and then expand the  
column-width so that horizontal scroll bars appear,
and the user is able to read whole entries by using the horizontal  
scroll bar.




thanks for any hints!


Am 09.06.2009 um 17:38 schrieb Shlok Datye:

I assume you have set your scroll view to automatically hide and  
show its scrollbars as needed.


When exactly do the scrollbars not appear but should? Only when the  
app first launches? Does the problem remain if you resize the window  
slightly (and the scroll view is set to resize with the window)?


Can you post a sample project that replicates your problem?

Shlok Datye
Coding Turtle
http://codingturtle.com


On 09.06.2009, at 01:57, Martin Batholdy wrote:


hi,


I have set up a NSTableView in the Interface Builder.
I have connected this with a NSObject Outlet.
And I have set the data source of the NSTableView to the NSObject.

The problem I have is that there don't appear any scroll bars even  
when the content doesn't fit.


I have a method called "delete" which deletes the selected entry  
when a button is pressed.

In this method there is a [TableOutlet reloadData]; call.

After deleting an entry there are appearing at least vertical  
scrollbars.



I tried to add the reloadData call to the init call.
I also tried noteNumberOfRowsChanged like suggested in some forum  
postings I found ...



But nothing happens.


Can someone help me on this issue?
Thanks!


___

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

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

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

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


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: 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
<http://www.chronosnet.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/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

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 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
<http://www.chronosnet.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


program crashes because of a variable declaration

2009-06-11 Thread Martin Batholdy

Hi,

my program crashes if I add a variable declaration to a header file.
I really don't understand what the hell is wrong with it;


The programm works fine with this lines;

@interface AppleScriptHandler : NSObject {
NSDictionary *errorInfo;
NSString *appFolder, *filePathFinderFiles;  
}



But it crashes on startup when I add something like;

@interface AppleScriptHandler : NSObject {
NSDictionary *errorInfo;
NSArray *test;
NSString *appFolder, *filePathFinderFiles;  
}



... or this;

@interface AppleScriptHandler : NSObject {
NSString *xxx;
NSDictionary *errorInfo;
NSString *appFolder, *filePathFinderFiles;  
}




I don't change anything but this line ...

___

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

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)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: program crashes because of a variable declaration

2009-06-11 Thread Martin Batholdy

ok, I am sorry.


It's rare that an app crashes silently.  Is anything printed to the  
console?  Do you have a crash log?  If you run the app in the  
debugger, what line of code does it crash on?


Also, are there any compiler warnings that you are ignoring?



There are no compiler warnings in the code.


this is printed in the debugger console;

[Session started at 2009-06-11 16:07:48 +0200.]
Loading program into debugger…
GNU gdb 6.3.50-20050815 (Apple version gdb-962) (Sat Jul 26 08:14:40  
UTC 2008)

Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and  
you are
welcome to change it and/or distribute copies of it under certain  
conditions.

Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for  
details.

This GDB was configured as "i386-apple-darwin".Program loaded.
sharedlibrary apply-load-rules all
Attaching to program: `/Users/jorggro/Documents/Programmierung/Cocoa/ 
Builds/Debug/Fibo.app/Contents/MacOS/Fibo', process 1375.


The Debugger Debugger is attaching to process




Is this the same problem as your earlier post? It seems like maybe  
you're trying to do stuff with NSObjects before the runtime is  
initialised properly. Obviously it's not adding the extra ivar  
that's causing the problem, but some other problem that this  
exposes. What objects are you creating when? Are you doing anything  
in main()? Generally your app shouldn't start to do any processing  
until the app delegate gets the green light in the form of - 
applicationWillFinishLaunching: or similar.


It is pretty strange to me.
I changed something in another file that has nothing to do with the  
file that I am having problems with and now it works ...


Does anyone know how this could be?



Try also enabling NSZombieEnabled, as it sounds like you may have a  
memory management problem (over-release most likely).



So I release more stuff than I should be?
But wouldn't that lead to more obvious wrong behavior, as the app  
don't have the information it needs at some point ..?





Am 11.06.2009 um 15:50 schrieb Andy Lee:


On Jun 11, 2009, at 9:38 AM, Martin Batholdy wrote:

But it crashes on startup when I add something like;

@interface AppleScriptHandler : NSObject {
NSDictionary *errorInfo;
NSArray *test;
NSString *appFolder, *filePathFinderFiles;  
}


It's rare that an app crashes silently.  Is anything printed to the  
console?  Do you have a crash log?  If you run the app in the  
debugger, what line of code does it crash on?


Also, are there any compiler warnings that you are ignoring?

These are the very first things you should look at when you're  
debugging, and if you're still stumped, this is the kind of  
information that would help us help you.  When you post a question,  
try to include relevant information.


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