Re: How to converting a Carbon nib to Cocoa?

2008-07-03 Thread Jean-Daniel Dupas
Anyway, it does note make sense, as upgrading the view without  
rewriting all the logic using Cocoa paradigms is probably not a good  
idea.
Unlike Carbon nib, Cocoa nib are not just a set of interface object  
with some property and flags, they also contains lots of information  
about action, target, bidings, outlets, and a bunch of controller  
objects (nib owner, Object Controllers, …)


And The layout manager is very different too.



Le 3 juil. 08 à 05:31, Fosse a écrit :

It would be a nightmare to recreate them by hand... , especially for  
the big

project which needs to move to Cocoa..

No better method?


On Mon, Jun 30, 2008 at 3:37 AM, Christopher Pavicich  
[EMAIL PROTECTED] wrote:



Hi:

 There is no way to automatically convert a Carbon Interface Builder
Document into a Cocoa Interface Builder Document.
 You are going to need to recreate all of your Carbon dialogues in  
Cocoa.

By hand.

--Chris


On Jun 29, 2008, at 1:59 AM, Fosse wrote:

My Carbon nib contains a lot of dialogs.  I want to make it be used  
by
another cocoa application and don't want to create all those  
dialogs and
econstruct the entire control hierarchy manually in the Interface  
Builder.

I
don't care about connections, I'll wire them up myself. I'm just  
hoping to

avoid repeating the layout work.

The Cocoa nib uses binary file objects.nib which is different with  
the xml
file used byCarbon nib . I can't find any way to convert it with  
either

Interface Builder or nibtool.

Does anyone know of an automated method for doing the conversion?   
Or

method
to create Cocoa NIB without using Interface Builder?

I found two related questions here but no more answers..
http://lists.apple.com/archives/cocoa-dev/2001/Jul/msg00243.html
http://lists.apple.com/archives/carbon-development/2003/Aug/msg00161.html

Thanks a lot!
___

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

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

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

This email sent to [EMAIL PROTECTED]





___

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

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

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

This email sent to [EMAIL PROTECTED]





smime.p7s
Description: S/MIME cryptographic signature
___

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

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

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

This email sent to [EMAIL PROTECTED]

Re: Does this caution need fixed? (newb)

2008-07-03 Thread Sherm Pendley
On Thu, Jul 3, 2008 at 1:47 PM, Kyle Sluder
[EMAIL PROTECTED] wrote:

 Many (dare I say most?) developers consider warnings to be the
 equivalent of the compiler vomiting in its mouth -- errors are the
 subsequent suffocation.  Perhaps you can tell how strongly I feel
 about this.

I completely agree with your opinion about warnings, but... ewww! :-)

sherm--

-- 
Cocoa programming in Perl: http://camelbones.sourceforge.net
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does this caution need fixed? (newb)

2008-07-03 Thread Jason Stephenson

Chris Paveglio wrote:

My code is like this:

NSMutableString *theSettings;
theSettings = [[NSMutableString alloc] init];

//myPrefs is an array of strings, each item is like Library/Safari

int i;
for (i = 0; i  8; i++
{
theSettings = [NSHomeDirectory() stringByAppendingPathComponent:[myPrefs 
objectAtIndex:i]];

}

Thinking about it, do I need the alloc and init commands? Sometimes I am unsure 
about what needs alloc or init versus what I can just declare as a variable 
without doing that.


No, you don't. Also, unless you're going to modify settings after 
assigning it in your loop, then you should make it a NSString *.


The compiler is likely complaining because you're assigning NSString * 
to a NSMutableString *.


If you really need a mutable string then change the assignment line to this:

theSettings = [[NSHomeDirectory() 
stringByAppendingPathComponent:[myPrefs objectAtIndex:i]] mutableCopy];




HtH,
Jason
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: How to support dictionary service in a custom text view?

2008-07-03 Thread Charles Srstka

On Jul 3, 2008, at 12:03 PM, Charles Srstka wrote:

Okay, so I've got a custom text view that's a subclass of NSView  
(not NSTextView). I've followed the instructions on this page:


http://developer.apple.com/documentation/Cocoa/Conceptual/InputManager/Tasks/TextViewTask.html#/ 
/apple_ref/doc/uid/20001040


I override acceptsFirstResponder to return YES, I override keyDown:  
to call interpretKeyEvents:, and I've implemented the NSTextInput  
protocol. I override all the mouse events and send those to the  
current input manager if it wants them (it never does). I even told  
the NSWindow to accept mouseMoved: events so I could forward them if  
the input manager wanted them (it doesn't). I've also implemented  
Services support, accepting NSStringPboardType data and providing it  
to services.


Anyway, this all works great for the most part. Text editing works  
fine, services work fine, everyone's happy, except for one thing - I  
want that dictionary widget that NSTextView has when you type  
command-control-D with the mouse hovering over a word. Since this is  
a system service and seems to get loaded into every Cocoa app, there  
must be a simple way to get my view to support it, but I'm drawing a  
blank as to what it is. I'm sure it's something simple, I'm just not  
sure what's the remaining piece of the puzzle that I need to  
implement. Anyone know what I'm forgetting?


Never mind! I found the answer to my own question - I needed to  
implement the NSAccessibility protocol. I've done that, and now it  
works.


Charles

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does this caution need fixed? (newb)

2008-07-03 Thread Steve Christensen

On Jul 3, 2008, at 9:40 AM, Chris Paveglio wrote:

Also, should my code be caution free as a sign of clean coding or  
can some cautions that don't affect functionality be dismissed?


I'm one of those people who turns on just about every warning and  
then fixes the code that generates the warnings. Yeah, I might need  
to do more work up front, but I'd rather know what the compiler is  
thinking than have to later suffer a hard-to-track bug due to a case  
of late-night coding... :)


steve

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does this caution need fixed? (newb)

2008-07-03 Thread Sean McBride
On 7/3/08 9:40 AM, Chris Paveglio said:

I have a loop that gets the user's home directory, and then adds a
string to complete the file path for several files.

This line:
theSettings = [NSHomeDirectory() stringByAppendingPathComponent:[myPrefs
objectAtIndex:i]];

gives me a caution sign when I compile

In addition to the other good comments, you should be extra extra
careful when writing file-related code: you don't want to accidently
move, copy, delete at the wrong path.  So I would add Ia test to check
for nil being returned from NSHomeDirectory().

--

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


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: launchd daemon at boot time

2008-07-03 Thread Herb Petschauer
{Snip}
 but still cannot get my daemon to work.  I have written the proper .plist to
 be loaded into launchctl, and it works when I load it manually, yet, when I
 place the same plist in either /Library/LaunchDaemons or
 System/Library/LaunchDaemons, it does not load when the mac boots up.  The
 plist isn't even loaded into launchctl when it the computer reboots(i.e.
 cannot be seen in the launchctl list).  What am I doing wrong?

Do you have the proper ownership set? (root:wheel I believe).  Proper
privs (-rw-r--r--) [the documentation should have the final word on
these values, not me].  Any messages in the system.log?

Also, how are you loading when you test?

sudo launchctl load xxx or
launchctl load xxx

Cheers,
-H.
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: launchd daemon at boot time

2008-07-03 Thread Mike Fischer

Am 03.07.2008 um 23:40 schrieb Nathan Wan [EMAIL PROTECTED]:


Hi all,



I followed documentation here
(http://developer.apple.com/documentation/MacOSX/Conceptual/ 
BPSystemStartup/
Articles/LaunchOnDemandDaemons.html#//apple_ref/doc/uid/ 
TP40001762-108425)
but still cannot get my daemon to work.  I have written the  
proper .plist to
be loaded into launchctl, and it works when I load it manually,  
yet, when I

place the same plist in either /Library/LaunchDaemons or
System/Library/LaunchDaemons, it does not load when the mac boots  
up.  The
plist isn't even loaded into launchctl when it the computer reboots 
(i.e.

cannot be seen in the launchctl list).  What am I doing wrong?


Who knows? Without knowing any details it's impossible to tell.

Also this is not a Cocoa question and is off-topic here. Try the  
launchd-dev mailing list.



Mike
--
Mike Fischer Softwareentwicklung, EDV-Beratung
Schulung, Vertrieb
Note: I read this list in digest mode!
  Send me a private copy for faster responses.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSDateFormatter question

2008-07-03 Thread Deborah Goldsmith

Correct.

We're aware there is a need for what you want to do, but there is  
currently no way to do it. Please file an enhancement request.


Deborah Goldsmith
Apple Inc.
[EMAIL PROTECTED]

On Jul 3, 2008, at 1:13 PM, Chuck Soper wrote:


Hello,

Currently, I'm creating a NSDateFormatter instance as follows:
 dateFormatter = [[NSDateFormatter alloc] init];
 [dateFormatter setDateStyle:kCFDateFormatterMediumStyle];
 [dateFormatter setTimeZone:myTimeZone];

Assuming that the user hasn't modified their International formats  
using System Preferences (a fairly big assumption), then the  
following regions will use these formats (using [dateFormatter  
dateFormat]):

 United States:  MMM d, 
 Belgium:dd MMM 
 Japan:  /MM/dd

Is there a way that I can add a day of week abbreviation and have to  
displayed correctly for all locales? For example, I'd like Thu, Jul  
3, 2008 for the United States and to have the day of week  
abbreviation added to the proper location (in the string) for other  
locales.


I'm fairly sure that what I'm trying to do is not possible or  
practical. I think that my only option is to specify a hard coded  
format string using setDateFormat: by referring to the following  
Date Format Patterns:

http://unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns
Of course, this approach would not be multi-locale compatible so I  
should avoid it.


In summary, if I want to have multi-locale compatible date formats,  
I should not attempt to add a day of week abbreviation. Instead, I  
should rely on kCFDateFormatterMediumStyle. Does this sound like the  
best approach?


Thanks,
Chuck

___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: NSPredicateEditor

2008-07-03 Thread Peter Ammon


On Jun 26, 2008, at 6:48 PM, Chris wrote:

On Fri, Jun 27, 2008 at 10:09 AM, Peter Ammon [EMAIL PROTECTED]  
wrote:




On Jun 25, 2008, at 7:27 PM, Chris wrote:



The net effect is that NSPredicateEditor can't display a predicate  
like


NOT (foo = bar)


A bug in NSPredicateEditor system perhaps? But surely someone  
would have

seen it before.



Hi Chris,

NOT type compound predicates only support exactly one subpredicate,  
or at
least they did when NSPredicateEditor was written.  For this  
reason, the
default implementation of NOT expects the sole subpredicate to be  
an OR

type.  So set this:

NOT(OR(foo=bar))



Ahh, this would explain why it hasn't been reported before.

However the BNF description of predicates does not impose that  
restriction:


http://developer.apple.com/documentation/Cocoa/Conceptual/Predicates/Predicates.pdf

And also, when you convert the predicate to a string, it doesn't  
show the
OR. The OR is apparently optimized away by the predicateFormat  
routine.
Since the only way to feasibly store a predicate is as a string, and  
then

parse it back in, its not really consistent.


The right way to store an NSPredicate is archival via NSCoding.  The  
string representation of a NSPredicate has always been lossy.


-Peter

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Does this caution need fixed? (newb)

2008-07-03 Thread Jason Stephenson

Chris Paveglio wrote:

Thanks all for your help and insight! I believe Jason's solution will
work for me as I am changing the assignment of what theSetting is
each time through the loop. I have a list (array) of files that gets
copied from one place to the other, and I change the origin and the
destination each time in the loop. Also Michael I understand now what
you are saying about the assignment. Thank you for putting it in a
nice detailed explanation! :-)


Just keep in mind that you'll be leaking memory with my example if you 
use it as written. I'm assuming that you'll do something with the string 
inside the loop. After doing whatever it is you do with it, you'll need 
to release theSettings. Making a mutable copy does allocate memory for 
the copy.







___

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

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

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

This email sent to [EMAIL PROTECTED]


Crashes with no backtrace when printing

2008-07-03 Thread Ben
I have just been getting my app to print two custom views. One uses a  
layer-backed NSView (many CALayer sublayers, in the region of 450- 
ish), one a plain NSView. Sometimes (rarely, but often enough), with  
no apparent pattern, the app is crashing just before showing the print  
dialog. The problem is that the backtraces I get are more or less as  
follows :


Attaching to program: `/Path/goes/here', process 14859.
Cannot access memory at address 0x9ead7
Cannot access memory at address 0x9ead7
(gdb) bt
#0  0x0009ead3 in ?? ()
#1  0x0018ee80 in ?? ()
Cannot access memory at address 0x9ead7


A crashlog in the console said the following:

image not found for lazy pointer at 0x973f014


My debugging skills are not good enough to know how to work around  
this and find the source of the crash. I have GC enabled and  
originally thought than some required object was being collected, but  
after maintaining strong references to all the objects I use and it  
still happens, I'm not sure that's it.


The reason I thought having GC enabled may be the source is that these  
crashes are often accompanied by messages warning of collected objects  
having a non-zero refcount. I'm pretty certain these objects aren't  
ones I've personally allocated.


Anyway, that's all the pertinent info I can think of. Does anyone have  
any suggestions about how to start tracing the cause of these crashes?



Regards,

Ben

___

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

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

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

This email sent to [EMAIL PROTECTED]


NSStatusItem custom view with menu

2008-07-03 Thread Jacob Bandes-Storch
I'm making an NSStatusItem with a custom view. In drawRect:, it draws  
things based on the value of the highlighted instance variable. When  
mouseDown: is called, it pops up a menu using the status item's  
popUpStatusItemMenu: method. Using the mouseUp: event does not work,  
because it is not called after the menu goes away. This is the way  
I've found that makes it work:


- (void)mouseDown:(NSEvent *)theEvent {
highlighted = YES;
[self setNeedsDisplay:YES];
[statusItem popUpStatusItemMenu:menu];
highlighted = NO;
[self setNeedsDisplay:YES];
[super mouseDown:theEvent];
}

Is this a good method, or is there something better that involves  
mouseUp:?

___

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

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

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

This email sent to [EMAIL PROTECTED]


NSTextView and Spell Checking with a layer backed view

2008-07-03 Thread Chilton Webb
Hi,

It appears that all 'check while typing' dots for both spelling and grammar 
show up at seemingly random places in an NSTextView if the view is layer 
backed. Is there some way around this? 

Thank you,
-Chilton
___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: launchd daemon at boot time

2008-07-03 Thread Mike Fischer

Am 04.07.2008 um 01:43 schrieb Wan, Nathan (CIV):


I am sorry, I do not find the launchd-dev list on lists.apple.com

That's because it's not on the Apple but on the MacOSForge site.  
Launchd is an Open Source project. See:

http://lists.macosforge.org/mailman/listinfo.cgi/launchd-dev

(It would actually be nice if Apple would provide a hint on  
lists.apple.com about the existence of additional lists on  
lists.macosforge.org. You might want to contact the list admin about  
that. See: http://lists.apple.com/contact.html.)



I did not use sudo, just lauchctl load myDaemon when i loaded  
it manually. File is readable by everyone.


Thanks, please tell me what else I can tell you

I don't know if I can actually help you with your problem. But for  
starters it would probably help to see the exact content of  
your .plist file, where this file is installed, the permissions of  
the file, permissions and location of your daemon, etc. Also are you  
sure the daemon can run in environment directly after boot, i.e. not  
within a user context and without a window server connection? So far  
you haven't provided any info except it doesn't work.


But please continue this discussion on the launchd-dev list.


HTH
Mike
--
Mike Fischer Softwareentwicklung, EDV-Beratung
Schulung, Vertrieb
Note: I read this list in digest mode!
  Send me a private copy for faster responses.

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: A question of style: Returning 'pairs'

2008-07-03 Thread David Casseres
I've run into this many times, and I think I've used all the  
techniques you mention and some others less hygienic.  I've been most  
satisfied with your 2) and 3) solutions. There's not really that much  
overhead in making a struct or Obj-C class for two specific kinds of  
values, and once you've got it you know exactly what you're doing at  
all times.  I like structs becaus they're so lightweight, and I like  
Obj-C classes (with properties, yay!) because structs are so ugly to  
declare.


I note that Cocoa itself uses all these techniques, but maybe they  
lean toward structs with a few specialized functions for working with  
them, for constructs that will be used often like NSRange. On the  
other hand there's NSIndexPath; since it's a class, UITableView can  
create a category on it that provides properties.  Very nice.



On Jul 2, 2008, at 11:48 AM, James Montgomerie wrote:

Say I have a method that needs to return two equally important  
values (in my case, a string and an offset into it).  I am  
overthinking how to do it, and I though it would be interesting to  
see what others have done.


I see these opportunities (my use of 'object' and 'value' is blurred  
below, since I'm thinking of the abstract case - assume that both  
values could be objects):


1) Just return the first value, and have the caller supply an  
argument that the second value gets written into (akin to how  
NSError is customarily used).  This seems a bit unclean, since one  
value is not more important than the other, and both are necessarily  
returned.
2) Define a custom C struct (like NSRect, but with e.g. 'string' and  
'offset' members) and return objects in it.  Just like any other  
returned objects, the caller would be expected to retain them  
individually if it needed to keep them around.
3) Define a custom Obj-C class with two properties [e.g. 'string'  
and 'offset'] and return an object of that class (with properties  
appropriately set).
4) Create a 'Pair' C struct with two ids in it.  Use it like the  
custom struct in (2).  This struct is more reusable than the one in  
(2), so this solution seems less 'heavyweight', but it is less  
descriptive.
5) Define a 'Pair' Obj-C class with 'first' and 'second' properties,  
use as (3).  Again, more reusable, less 'heavy' seeming than (3),  
but less descriptive.
6) Return an NSArray with two items in it (this seems the least  
descriptive option, from the point of view of someone reading the  
header).
7) Return an NSDictionary with two items in it, keyed by their  
property names.  This seems a bit wasteful, since the dynamicisim of  
a dictionary is not required, and is also not so descriptive from a  
header-reading perspective.


Oh, and there's also 8) Rename the file .mm, and use a C++  
std::pairid, id class. (Only joking :-)


How would you do this?  Are there other, better options?

Jamie.
___

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

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

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

This email sent to [EMAIL PROTECTED]


___

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

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

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

This email sent to [EMAIL PROTECTED]


Changing views from within another view

2008-07-03 Thread Wayne Pascoe

Hi all,

I think I've hacked myself into a corner and I could use some advice /  
clarity in getting out of it.


I am trying to build a tool that uses multiple views inside one window  
as well as additional windows when appropriate.


The code for changing between views (changeViewController and  
displayViewController) lives in the App Delegate class. This class has  
the outlet to the window that all the views are shown in. This class  
is also the delegate for the File's Owner in my main menu nib.


I then have NIBs for each different view. Each NIB has a corresponding  
viewcontroller class which is the class for the File's Owner of that  
NIB.


When the application launches an initial view is loaded and displayed  
in the window from within the App Delegate class. The problem I then  
have is that I can't work out how to change to another view. Any  
methods I try and use are sent to the viewcontroller class for that  
view and not the App Delegate.


The examples that I started out from all used a control outside of the  
view. For example, the view was loaded into a box in the window, and  
outside that box was an NSPopUp that you could use to switch views. I  
understand how this works, as this control sends messages to the App  
Delegate. This then has the code to change the view, and it also has  
the outlet to the window and the box, so it can update these.


Is there a way for the viewcontroller class to receive the change view  
request from the user and forward that to the App delegate class? Or  
is this the wrong way to do it?


Any pointers to reading on the correct way to do this would be greatly  
appreciated!


Thanks,
--
Wayne Pascoe(gpg --keyserver www.co.uk.pgp.net --recv-keys 79A7C870)
Hanlon's Razor:
Never attribute to malice that which is adequately
explained by stupidity

___

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

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

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

This email sent to [EMAIL PROTECTED]


Re: Crashes with no backtrace when printing

2008-07-03 Thread Jens Alfke


On 3 Jul '08, at 4:24 PM, Ben wrote:


Attaching to program: `/Path/goes/here', process 14859.
Cannot access memory at address 0x9ead7
Cannot access memory at address 0x9ead7


I've found that gdb-in-Xcode is more reliable at being able to get a  
backtrace if you launch the program with the debugger (i.e.  
breakpoints enabled), versus having it try to attach only when the  
process crashes. But it's still not 100%.


It's not clear that this is a problem with gdb, though. Some program  
bugs can corrupt the stack or other areas of memory sufficiently to  
confuse gdb. Those can be a pain to debug. The only thing I can  
suggest is to set a breakpoint as near the point of the crash as you  
can, and then start single-stepping. If you're lucky, at some  
consistent spot the debugger will go blooey as the stack gets wiped  
out; then you can try to figure out what's wrong with the code there.


—Jens___

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

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

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

This email sent to [EMAIL PROTECTED]