Re: Input Managers perspective

2008-11-19 Thread Charles Srstka
On Nov 18, 2008, at 12:42 PM, Donnie Lee wrote: I plan to use Input Managers hack to add functionality to closed-source software. I know that these hacks are not a good programming technics, but there is no other way except using it. I have only one question: will Input Managers be available in

Re: release and reference counting query

2008-11-19 Thread Marc Stibane
Am 18.11.2008 um 20:05 schrieb Andy Lee: On Nov 18, 2008, at 1:33 PM, Marc Stibane wrote: Am 07.11.2008 um 13:17 schrieb Roland King: On Nov 7, 2008, at 7:59 PM, Calum Robertson wrote: Below is a snippet of code from the Creating an iPhone Application document from the iPhone DevCenter. -

Re: Opening Ports in Leopard

2008-11-19 Thread Kyle Sluder
On Wed, Nov 19, 2008 at 12:08 AM, Gerriet M. Denkmann [EMAIL PROTECTED] wrote: In an other programm (doing Distributed Objects between computers) I found out that int y = bind( newSocket, (struct sockaddr *)serverAddress, sizeof(serverAddress) ); wants to have the data in truct

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread mmalcolm crawford
On Nov 17, 2008, at 9:33 PM, Jeff Laing wrote: How about: http://developer.apple.com/samplecode/CacheInfo-MacOSX/listing1.html (for example) which has the IBOutlet tag on the instance variables rather than the properties; I'll bet its different because properties and instance vars have the

Re: release and reference counting query

2008-11-19 Thread mmalcolm crawford
On Nov 18, 2008, at 10:33 AM, Marc Stibane wrote: Lets forget for a moment that the dealloc never get's called at all on the iPhone This is simply untrue. viewController = [[UIViewController alloc] initWithNibName:@MoveMeView bundle:[NSBundle mainBundle]]; since

Re: Binding a CoreData string value to an NSTextView

2008-11-19 Thread mmalcolm crawford
On Nov 18, 2008, at 8:42 PM, John Joyce wrote: Has anyone had any success Binding a CoreData string value to an NSTextView? Everything I try seems to be flumoxed by the NSAttributedString of the NSTextStorage backing store.

Re: Noobie Question: NSTableView and XML-RPC

2008-11-19 Thread Kyle Sluder
On Tue, Nov 18, 2008 at 1:42 PM, Kennard Smith [EMAIL PROTECTED] wrote: I'd imagine just setting a dataSource then querying the XML-RPC server for data when tableView:objectValueForTableColumn:row: is called. The documentation tells you this is a very bad idea: Note:

Re: Window title bar accessory view

2008-11-19 Thread Houdah - ML Pierre Bernard
Hi Andrew, No I am not talking about the toolbar. I am referring to the lock icon and the new green certificate information text displayed by Safari in the window's title bar. iCal displays a pop-up menu where one can pick the time zone. Pierre On 19 Nov 2008, at 03:52, Andrew Merenbach

Re: Window title bar accessory view

2008-11-19 Thread Houdah - ML Pierre Bernard
Hi Kyle! Thanks a lot. This sounds like a great idea. I will give it a try ASAP. Pierre On 19 Nov 2008, at 04:03, Kyle Sluder wrote: On Tue, Nov 18, 2008 at 9:26 PM, Houdah - ML Pierre Bernard [EMAIL PROTECTED] wrote: I would like to replicate the accessory views found in the top right of

Re: Opening Ports in Leopard

2008-11-19 Thread Gerriet M. Denkmann
On 19 Nov 2008, at 15:59, Kyle Sluder wrote: On Wed, Nov 19, 2008 at 12:08 AM, Gerriet M. Denkmann [EMAIL PROTECTED] wrote: In an other programm (doing Distributed Objects between computers) I found out that int y = bind( newSocket, (struct sockaddr *)serverAddress,

Binding to managedObjectContexts using dictionary hangs

2008-11-19 Thread Arthur C.
I have a Core Data application with a double Core Data implementation, that is, there are two managedObjectModels, persistentStoreCoordinators and managedObjectContexts. These are referenced by the following methods: // appDelegate.h - (NSPersistentStoreCoordinator *)

[MyClass class] returning superclass's class

2008-11-19 Thread Ken Tozier
Hi I wrote a subclass of NSCharacterSet and at runtime, when I do [MyClass class] it returns the superclass's class rather than the class value. I suspect this is normal but was wondering if there is a way to get my subclass's class rather than it's superclass.

Re: Writing a more usable AppleEvent logger

2008-11-19 Thread Ken Tozier
On Nov 17, 2008, at 3:51 AM, Jean-Daniel Dupas wrote: Le 17 nov. 08 à 08:06, Ken Tozier a écrit : What do you mean by this tool ? export is used to set an environment variable. I guess that system functions that send and receive event just check if the env var is set and log

Re: OpenGL + NSTextView/NSTextContainer?

2008-11-19 Thread Karan, Cem (Civ, ARL/CISD)
On Tue, 18 Nov 2008 12:26:04 -0800 (PST) Erik Buck wrote: Open GL has no built-in capability for drawing text. Open GL provides lower level primitives like lines and curves and meshes. Open GL also provides texture compositing. There are some free and some open text drawing/font

editWithFrame:inView:editor:delegate:event: in mouseDown:

2008-11-19 Thread Alexander Spohr
Hi list, I am trying to make a subclass of NSControl that is capable of showing variable width (and maybe height) content. Something like a one-row NSTableView without a header. Or like an NSMatrix with variable cell sizes. I tried to do it with only one cell to draw the content which

Changing Services HotKey at Runtime

2008-11-19 Thread Xavier Snark
Greetings, In my application I would like to change the Services Hotkey combination at runtime. So far, the only Apple documentation that I have found states that the hotkey is configured via the Info.plist file in the application bundle.

Re: [MyClass class] returning superclass's class

2008-11-19 Thread Jean-Daniel Dupas
Le 19 nov. 08 à 13:32, Ken Tozier a écrit : Hi I wrote a subclass of NSCharacterSet and at runtime, when I do [MyClass class] it returns the superclass's class rather than the class value. I suspect this is normal What make you think this is normal ? How do you create your instance ?

Re: [MyClass class] returning superclass's class

2008-11-19 Thread Andy Lee
On Nov 19, 2008, at 7:32 AM, Ken Tozier wrote: I wrote a subclass of NSCharacterSet and at runtime, when I do [MyClass class] it returns the superclass's class rather than the class value. I suspect this is normal but was wondering if there is a way to get my subclass's class rather than

RE: Core data save error with multiple persistent stores [SOLVED]

2008-11-19 Thread Arthur C.
A solution is to have 2 persistentStoreCoordinators and 2 managedObjectContexts, with the Coordinators each having one single persistent store. It is clear that there can be no reassignment problems anymore. However, I don't understand why this seems to be required; that is, why can't I have two

InputManagers in Leopard

2008-11-19 Thread Gerriet M. Denkmann
I know that InputManagers are now officially unsupported. And also that this functionality is likely to be disabled in a future release. But while it is still possible I would like to continue using them. So I copied my thing into the /Library/InputManagers folder. Then did sudo chown -R

NSNumberFormatter problem with percentage

2008-11-19 Thread Graham Cox
I'm a bit puzzled by NSNumberFormatter when trying to use it to display values from 0-1 as 0-100% in a text field. In IB, I'm simply choosing the 'Percent' preset from the menu, and using it with floats from 0 to 1, but the field ends up displaying everything 100x too big, i.e. input is

Re: Writing a more usable AppleEvent logger

2008-11-19 Thread Jean-Daniel Dupas
Le 19 nov. 08 à 13:36, Ken Tozier a écrit : On Nov 17, 2008, at 3:51 AM, Jean-Daniel Dupas wrote: Le 17 nov. 08 à 08:06, Ken Tozier a écrit : What do you mean by this tool ? export is used to set an environment variable. I guess that system functions that send and receive event just

Re: OpenGL + NSTextView/NSTextContainer?

2008-11-19 Thread Jean-Daniel Dupas
Le 19 nov. 08 à 13:39, Karan, Cem (Civ, ARL/CISD) a écrit : On Tue, 18 Nov 2008 12:26:04 -0800 (PST) Erik Buck wrote: Open GL has no built-in capability for drawing text. Open GL provides lower level primitives like lines and curves and meshes. Open GL also provides texture compositing.

Re: Writing a more usable AppleEvent logger

2008-11-19 Thread Ken Tozier
On Nov 19, 2008, at 8:52 AM, Jean-Daniel Dupas wrote: The logging is performed by the application itself (I guess this is done in AESendMessage or a lower level private function for send events and in AEDecodeMessage or a lower level private function for received event). I guess the

placing a window in the top left corner

2008-11-19 Thread Nick Rogers
Hi, whenever my app opens a second preview window, I want it to be positioned at the top left corner of the desktop screen. I have come across two methods in NSWindow, they are: – setFrameTopLeftPoint: and – cascadeTopLeftFromPoint: But these require a point as input. How do I calculate this

Re: placing a window in the top left corner

2008-11-19 Thread Joseph Crawford
Wouldn't the point just be 0, 0 in that case? I'm a beginner so I am not positive. On Nov 19, 2008, at 9:47 AM, Nick Rogers wrote: Hi, whenever my app opens a second preview window, I want it to be positioned at the top left corner of the desktop screen. I have come across two methods in

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Brian Stern
On Nov 19, 2008, at 3:59 AM, mmalcolm crawford wrote: On Nov 18, 2008, at 10:01 AM, Brian Stern wrote: OK Erik, I'll bite. What you describe above is correct as far as it goes. However, when you say all the memory management is handled in one place, of course it's two. The object has

display callbacks

2008-11-19 Thread Alexander Cohen
Hi, Is there a callback available when the display profile is changed by the user or programmatically? Also, is there a calllabck available when the user drags a window between different screens? thx AC ___ Cocoa-dev mailing list

RE: placing a window in the top left corner

2008-11-19 Thread Etienne Guérard
Did you look at -[NSScreen visibleFrame]? The returned rectangle is always based on the current user-interface settings and does not include the area currently occupied by the dock and menu bar. Because it is based on the current user -interface settings, the returned rectangle can change

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Greg Titus
On Nov 19, 2008, at 7:00 AM, Brian Stern wrote: This leaves us for now with two solutions: (a) Greg's (override setView:) which is more future-proof but is in many respects academically unsatisfying. (b) For non-top-level-object, specify an assign attribute for the property -- and risk

Re: Writing a more usable AppleEvent logger

2008-11-19 Thread Jean-Daniel Dupas
Le 19 nov. 08 à 15:43, Ken Tozier a écrit : On Nov 19, 2008, at 8:52 AM, Jean-Daniel Dupas wrote: The logging is performed by the application itself (I guess this is done in AESendMessage or a lower level private function for send events and in AEDecodeMessage or a lower level private

Re: display callbacks

2008-11-19 Thread Alexander Cohen
Excellent. I did read the docs but i guess i stopped reading before the end of the page. thx AC On Nov 19, 2008, at 10:24 AM, Etienne Guérard wrote: Did you read the documentation reference for NSWindow? NSWindowDidChangeScreenNotification Posted whenever a portion of an NSWindow object's

-(BOOL)handleEvent:(NSEvent*)event client:(id)sender doesn't work

2008-11-19 Thread BirdSong
Hi all,As the documents said, there are three ways to receive input from the client.one of them is keybinding(-(BOOL)inputText:(NSString*)string client:(id)sender;) which works in the sample code.another is -(BOOL) handleEvent:(NSEvent*)event client:(id)sender;I tried to use this one instead

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Brian Stern
On Nov 19, 2008, at 10:29 AM, Greg Titus wrote: On Nov 19, 2008, at 7:00 AM, Brian Stern wrote: This leaves us for now with two solutions: (a) Greg's (override setView:) which is more future-proof but is in many respects academically unsatisfying. (b) For non-top-level-object, specify an

RE: OpenGL + NSTextView/NSTextContainer?

2008-11-19 Thread Karan, Cem (Civ, ARL/CISD)
On Wednesday, November 19, 2008 9:04 AM Jean-Daniel Dupas wrote: Do you need text editing capability, or just text drawing ? If this is text drawing, I don't see what NSTextView provide that is not possible with NSAttributedString, and so, with the GLString class that convert an

UITextView textViewDidBeginEditing issue

2008-11-19 Thread Bob Sabiston
Hi, I've got a UITextView and I am trying to add a save button to the top bar when the user clicks it to start editing. The UIView which contains the textview is a delegate for the TextView, so I have a textViewDidBeginEditing function something like this: -

Re: OpenGL + NSTextView/NSTextContainer?

2008-11-19 Thread Jean-Daniel Dupas
Le 19 nov. 08 à 17:16, Karan, Cem (Civ, ARL/CISD) a écrit : On Wednesday, November 19, 2008 9:04 AM Jean-Daniel Dupas wrote: Do you need text editing capability, or just text drawing ? If this is text drawing, I don't see what NSTextView provide that is not possible with NSAttributedString,

Re: Passing TableView information into a new dialog

2008-11-19 Thread Corbin Dunn
Le Nov 18, 2008 à 1:22 PM, Luis a écrit : Hello My objective is to when a user right-clicks on a row in a TableView and selects from the context menu an option, to show a new dialog that handles that option. How would I go to let the new dialog to know the information that was present in

Cocoa apps protection software

2008-11-19 Thread Donnie Lee
Hi! Does anybody know software protection systems for Cocoa apps and bundles? Like in Windows ASProtect, Themida, etc. Donnie. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: editWithFrame:inView:editor:delegate:event: in mouseDown:

2008-11-19 Thread Kyle Sluder
On Wed, Nov 19, 2008 at 7:51 AM, Alexander Spohr [EMAIL PROTECTED] wrote: I am trying to make a subclass of NSControl that is capable of showing variable width (and maybe height) content. Not entirely sure what you're trying to describe here. It almost sounds like you just want to embed your

Simple single file renaming application ...

2008-11-19 Thread vince
Thanks for the help ... I want to build a simple single file re-namer. Just a window and a textField that displays the current filename, and a text Field and Save option for the edit. So right click a file/open with ... the app runs and loads up the current file name prepared for the edit.

Re: Input Managers perspective

2008-11-19 Thread Charles Srstka
On Nov 19, 2008, at 10:06 AM, Donnie Lee wrote: 3. Since there's already an Input Methods folder in Leopard that replaces the (supported) functionality of input managers and which developers are encouraged to use instead of input managers, since Apple clearly disapproves of this sort of

Re: How to get notification of rerun application

2008-11-19 Thread Macarov Anatoli
No. The program starts up automatically upon system logon, and the icon appears in the system tray (near clock). A user may not notice the icon , thus he/she starts the program manually, and then pops up program's main window. Вы

Programmatic NSTableView selection changes

2008-11-19 Thread Brent Burton
Hi, I think I have this figured out, but I wanted to bounce it off the list to see if there's a better way. I wrote a small app that reads in a text file containing a chat log, which contains lines in the format Speaker: something they said, like a script. The application allows you to select

Decomposing an interface into separate nibs

2008-11-19 Thread Frank Wilson
I'm a newbie to cocoa development and this is my first post to this list, so please bear with me! :) What I want to do is be able to decompose a particular interface into several nibs. Sometimes this feels right to me because I feel that one component on the interface can be reused separately.

NSButton ical Like

2008-11-19 Thread Emmanuel Pinault
How do I make a button like the mini calendar in ical (the one that show the days and when one is selected , it shows the day with a blue gradient)? I looked at the NSButton and NSButtonCell and nothing can set the background directly nor having an image and text on top... My

Re: Cocoa apps protection software

2008-11-19 Thread Robert Černý
2008/11/19 Nick Zitzmann [EMAIL PROTECTED]: On Nov 19, 2008, at 9:53 AM, Donnie Lee wrote: Does anybody know software protection systems for Cocoa apps and bundles? Like in Windows ASProtect, Themida, etc. You're best off making your own. The only one I know of that's out there is

Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
I have an app that generates a bunch of images... the process can be long so I wanted to start it in a separate thread so that the UI can be responsive etc... basically the only thing I did was: [NSThread detachNewThreadSelector:@selector(doLongProcess) toTarget:self withObject:nil];

Re: NSButton ical Like

2008-11-19 Thread Nick Zitzmann
On Nov 19, 2008, at 12:37 PM, Emmanuel Pinault wrote: How do I make a button like the mini calendar in ical (the one that show the days and when one is selected , it shows the day with a blue gradient)? You've got to write one yourself and do all of the drawing, calendrical

Re: How to get notification of rerun application

2008-11-19 Thread Kyle Sluder
On Wed, Nov 19, 2008 at 5:49 AM, Macarov Anatoli [EMAIL PROTECTED] wrote: No. The program starts up automatically upon system logon, and the icon appears in the system tray (near clock). A user may not notice the icon , thus he/she starts the program manually, and then pops up program's main

Re: NSButton ical Like

2008-11-19 Thread Emmanuel Pinault
On Nov 19, 2008, at 1:01 PM, Nick Zitzmann wrote: On Nov 19, 2008, at 12:37 PM, Emmanuel Pinault wrote: How do I make a button like the mini calendar in ical (the one that show the days and when one is selected , it shows the day with a blue gradient)? You've got to write one yourself

Re: Changing Services HotKey at Runtime

2008-11-19 Thread Peter Ammon
On Nov 19, 2008, at 4:49 AM, Xavier Snark wrote: Greetings, In my application I would like to change the Services Hotkey combination at runtime. So far, the only Apple documentation that I have found states that the hotkey is configured via the Info.plist file in the application bundle.

Re: Simple single file renaming application ...

2008-11-19 Thread Iceberg-Dev
On Nov 19, 2008, at 8:09 PM, vince wrote: Thanks for the help ... I want to build a simple single file re-namer. Just a window and a textField that displays the current filename, and a text Field and Save option for the edit. So right click a file/open with ... the app runs and loads

Re: Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
Mmm I see Well, right now I would say my worker thread is pretty much just reading values (size of image to generate etc)... but it's not modifying anything... it doesn't change any variables etc... just reads the info it needs to generate the images and ...well, generates the

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Ricky Sharp
On Nov 19, 2008, at 10:13 AM, Brian Stern wrote: I think that you're probably right and that it's redundant. Needless to say, mmalc's best practice has the outlets being released in dealloc. That's why I had that code there in the first place. FWIW, I don't think that UIViewController

NSComboBox beep

2008-11-19 Thread James Walker
If I use the Return key to select an item from the list of a non-editable combo box, there is a beep and the action message is not sent. This does not happen if the mouse is used to select an item. Is this a bug, or am I missing something? The reason I want to use an uneditable NSComboBox

RE: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Jeff Laing
But if your dealloc is like this... - (void)dealloc { self.thisProp = nil; self.thatProp = nil; ... } then you'll be calling the accessors and the right thing will happen (i.e. release if necessary). This is what I currently do for all dev work (iPhone or Mac OS X).

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Brian Stern
On Nov 19, 2008, at 4:41 PM, Ricky Sharp wrote: From Apple's template code, didReceiveMemoryWarning does have these code comments generated: [super didReceiveMemoryWarning]; // Releases the view if it doesn't have a superview // Release anything that's not essential, such as cached

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread mmalcolm crawford
On Nov 19, 2008, at 7:00 AM, Brian Stern wrote: There are competing issues. Following this best practice forces me to add public properties for all my outlets that my code never uses. This violates encapsulation and seems wasteful and error-prone. No, it's not. The nib-loading

Re: Cocoa apps protection software

2008-11-19 Thread Michael Ash
On Wed, Nov 19, 2008 at 12:11 PM, Nick Zitzmann [EMAIL PROTECTED] wrote: On Nov 19, 2008, at 9:53 AM, Donnie Lee wrote: Does anybody know software protection systems for Cocoa apps and bundles? Like in Windows ASProtect, Themida, etc. You're best off making your own. The only one I know of

Re: Question about NSThread?

2008-11-19 Thread Kai
It depends... You may well just be lucky that it seems to work (or unlucky, this again depends...). If your worker thread is only reading any data shared with other threads, it will indeed never disturb these other threads (probably just the main thread in your case). But if the main

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread j o a r
On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote: My understanding (and I'm a noob in this) is that best practices recommend that you shouldn't start sending additional messages to an object from inside its dealloc. That is indeed correct. The official guideline is, AFAIK, to not call

Re: Changing Services HotKey at Runtime

2008-11-19 Thread Jean-Daniel Dupas
Le 19 nov. 08 à 22:30, Peter Ammon a écrit : On Nov 19, 2008, at 4:49 AM, Xavier Snark wrote: Greetings, In my application I would like to change the Services Hotkey combination at runtime. So far, the only Apple documentation that I have found states that the hotkey is configured via

Re: Question about NSThread?

2008-11-19 Thread Jean-Daniel Dupas
Yes, as long as you do not access directly your UI from the background thread (you can do it, but using you should use the performOnMainThread: method). Note that you may want to release and recreate your auto release pool from time to time (between each image for example), else your

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread mmalcolm crawford
On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote: My understanding (and I'm a noob in this) is that best practices recommend that you shouldn't start sending additional messages to an object from inside its dealloc. Correct. (This is the one thing I hate the *most* about properties - they

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Brian Stern
On Nov 19, 2008, at 5:11 PM, j o a r wrote: On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote: My understanding (and I'm a noob in this) is that best practices recommend that you shouldn't start sending additional messages to an object from inside its dealloc. That is indeed correct. The

Re: Question about NSThread?

2008-11-19 Thread Michael Ash
On Wed, Nov 19, 2008 at 3:57 PM, Jean-Nicolas Jolivet [EMAIL PROTECTED] wrote: I have an app that generates a bunch of images... the process can be long so I wanted to start it in a separate thread so that the UI can be responsive etc... basically the only thing I did was: [NSThread

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Michael Ash
On Wed, Nov 19, 2008 at 5:18 PM, mmalcolm crawford [EMAIL PROTECTED] wrote: On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote: (This is the one thing I hate the *most* about properties - they really feel glued on, at this point, rather than being a language feature that the whole compiler knows

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread j o a r
On Nov 19, 2008, at 2:22 PM, Brian Stern wrote: That is indeed correct. The official guideline is, AFAIK, to not call through your properties in init / dealloc. For whatever reason UIViewController sets its view property to nil from its dealloc method. Greg's override of setView is based

Autorelease Question

2008-11-19 Thread Carmen Cerino Jr.
I am not sure the best way to phrase this question into words, so I will phrase it using example code. - (NSString*)foo { NSString blah = [NSString string]; . //Now do I do: return blah; //Or: return [[blah retain] autorelease]]; }

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread mmalcolm crawford
On Nov 19, 2008, at 2:29 PM, Michael Ash wrote: On Wed, Nov 19, 2008 at 5:18 PM, mmalcolm crawford [EMAIL PROTECTED] wrote: On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote: (This is the one thing I hate the *most* about properties - they really feel glued on, at this point, rather than

Re: Autorelease Question

2008-11-19 Thread Joseph Crawford
I believe that would better be done like this - (NSString *)foo { NSString blah = [[[NSString alloc] init] autorelease] ... return blah; } I might not be correct as I am a newbie too.. Thanks, Joseph Crawford On Nov 19, 2008, at 5:37 PM, Carmen Cerino Jr.

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread mmalcolm crawford
On Nov 19, 2008, at 1:57 PM, Brian Stern wrote: I'm starting to think that maybe using the assign properties is the better way to handle this. That's certainly one approach, and one that was considered. The problem is that you then have to think through every outlet declaration to make

Re: Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
Thanks for all the reply! By digging a little deeper I can see that everything isn't working quite as smoothly as I thought it was...! All the info is quite welcomed! Jean-Nicolas Jolivet On 19-Nov-08, at 3:57 PM, Jean-Nicolas Jolivet wrote: I have an app that generates a bunch of

Re: Autorelease Question

2008-11-19 Thread Luke the Hiesterman
This is really an objective-c question (and there is an obj-c list). Anyway, whenever you call a convenience class method +[NSString stringWithString:] as opposed to doing an alloc/init you're getting back an autoreleased object. So, if you're returning that value, it would make sense to

Re: Autorelease Question

2008-11-19 Thread Filip van der Meeren
Just one little addition to my previous mail; it is: NSString *blah = [NSString string]; You forgot the star ;-) Filip van der Meeren http://www.sourceforge.net/projects/xlinterpreter On 19 Nov 2008, at 23:47, Filip van der Meeren wrote: As long as you do not contain the blah in a

Re: Autorelease Question

2008-11-19 Thread Filip van der Meeren
It will not be contained in a NSAutoreleasePool per-se. Lets say you create a console application, then you would have to make the choice, will I use the NSAutoreleasePool, or try it without (most likely you will, or you wouldn't be able to use autorelease or use any methods that use this

Re: Autorelease Question

2008-11-19 Thread Shawn Erickson
On Wed, Nov 19, 2008 at 2:45 PM, Luke the Hiesterman [EMAIL PROTECTED] wrote: This is really an objective-c question Actually Cocoa memory management isn't and objective-c topic (unless you are using GC then you get more toward a language level concept)... retain/release/autorelease is a Cocoa

Re: Autorelease Question

2008-11-19 Thread Shawn Erickson
On Wed, Nov 19, 2008 at 2:37 PM, Carmen Cerino Jr. [EMAIL PROTECTED] wrote: I am not sure the best way to phrase this question into words, so I will phrase it using example code. - (NSString*)foo { NSString blah = [NSString string]; . //Now do I do: return blah;

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Ricky Sharp
On Nov 19, 2008, at 4:11 PM, j o a r wrote: On Nov 19, 2008, at 1:57 PM, Jeff Laing wrote: My understanding (and I'm a noob in this) is that best practices recommend that you shouldn't start sending additional messages to an object from inside its dealloc. That is indeed correct. The

Re: Autorelease Question

2008-11-19 Thread Filip van der Meeren
I disagree, the retain, autorelease and release are all defined within the Foundation framework. And that is something that belongs together with the Objective-C language (according to me); I know it does not need it to exist as a language, but Objective-C is kind of useless without the

Re: Autorelease Question

2008-11-19 Thread DKJ
If you've done this: NSString *str = [NSString string]; then you can simply do this: return str; Whoever is getting the returned value should retain it, and then release it when they're done. If you'd done this instead: NSString *str = [[NSString alloc] init];

Re: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread j o a r
On Nov 19, 2008, at 3:05 PM, Ricky Sharp wrote: Now, when you say call through your properties in init/dealloc, is that explicitly for things set up with @property? Or, has what I've been doing all these years with calls to accessors in init/dealloc really bad? There's no difference

Re: Autorelease Question

2008-11-19 Thread Luke the Hiesterman
Agreed. libc can be considered a part of C, so Foundation is a part of Objective-C. Luke On Nov 19, 2008, at 3:06 PM, Filip van der Meeren wrote: I disagree, the retain, autorelease and release are all defined within the Foundation framework. And that is something that belongs together

Re: NSButton ical Like

2008-11-19 Thread Andre Masse
I've not used it but this may worth taking a look at: http://code.google.com/p/calendarcontrol/ Andre Masse On Nov 19, 2008, at 14:37, Emmanuel Pinault wrote: How do I make a button like the mini calendar in ical (the one that show the days and when one is selected , it shows the day with

Re: Autorelease Question

2008-11-19 Thread Filip van der Meeren
I feel the need to express one concern about this topic: If you already know you will autorelease the object and return it, then you should call the autorelease at the same moment you create the object. NSString *str = [[[NSString alloc] init] autorelease]; If you wait until the end of

Re: Autorelease Question

2008-11-19 Thread Kyle Sluder
Read this document: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/2043-BEHDEDDB Then read this one: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html If you are just

Re: core-data crash on save. [SOLVED]

2008-11-19 Thread John Clayton
For all that answered me - a huge thanks. I've solved my particular flavour of this problem now. Partly, its a problem of the documentation - and partly my particular configuration. Here, for future reference at the 'facts' I collected along my learning experience - which led me finally

Re: NSButton ical Like

2008-11-19 Thread Ken Ferry
I can see they use some image that somehow but be stretched to fit. but have no idea how to do it. ... how would I create a background using a strectched image? I'm not following what art exactly you're talking about drawing, but it sounds like you might be interested in NSDrawThreePartImage

Re: Autorelease Question

2008-11-19 Thread Kyle Sluder
On Wed, Nov 19, 2008 at 6:17 PM, Filip van der Meeren [EMAIL PROTECTED] wrote: If you wait until the end of your method to autorelease the object, you are leaving a whole range of possible memoryleaks open, since every call you make between the allocation and release is a call that might throw

Re: Autorelease Question

2008-11-19 Thread Carmen Cerino Jr.
I guess I should also have included what spawned this question in the first place. I have read in a handful of places that you can guarantee, in the example case, that blah will exist until the end of function, and that sometime after the end of the scope of the function blah will be released. So

Re: SOLVED Re: NSAttributedString rendering bugs when rendered with Cocoa Text (rdar://6379047)

2008-11-19 Thread Aki Inoue
Or, you could create an NSView subclass instance with -isFlipped overridden shared among non-flipped views. You can add the flipped view to your view inside -drawRect: and - lockFocus to it temporarily. Depending on your rendering needs, this approach is preferable performance-wise than

Re: Question about NSThread?

2008-11-19 Thread Jean-Nicolas Jolivet
One question... you wrote: So when dealing with unknown objects whose thread safety is not documented, you cannot access them from multiple threads without synchronization just because they present an immutable interface. When you talk about accessing these objects, do you also mean

Re: Autorelease Question

2008-11-19 Thread DKJ
On 19-Nov-08, at 15:17 , Filip van der Meeren wrote: If you already know you will autorelease the object and return it, then you should call the autorelease at the same moment you create the object. NSString *str = [[[NSString alloc] init] autorelease]; Good point.

Re: NSButton ical Like

2008-11-19 Thread Kyle Sluder
On Wed, Nov 19, 2008 at 2:37 PM, Emmanuel Pinault [EMAIL PROTECTED] wrote: How do I make a button like the mini calendar in ical (the one that show the days and when one is selected , it shows the day with a blue gradient)? Subclass NSButtonCell and put your subclass in an NSMatrix. There's no

Re: Autorelease Question

2008-11-19 Thread Kyle Sluder
On Wed, Nov 19, 2008 at 6:32 PM, Carmen Cerino Jr. [EMAIL PROTECTED] wrote: I guess I should also have included what spawned this question in the first place. I have read in a handful of places that you can guarantee, in the example case, that blah will exist until the end of function, and

RE: Outlets / IBOutlet declarations (was Re: Interface Builder Wiring Objects)

2008-11-19 Thread Jeff Laing
On Nov 19, 2008, at 2:29 PM, mmalcolm crawford wrote: You send a release message to instance variables for which there is a corresponding retain or copy property. which is why I originally said: (This is the one thing I hate the *most* about properties - they really feel glued on, at this

RE: Outlets / IBOutlet declarations (was Re: InterfaceBuilder Wiring Objects)

2008-11-19 Thread Jeff Laing
There's no difference between setting through a property, and setting through a plain old setter method. That said, it's up to you to decide if you want to go with the official recommendation or not. If you think that you have enough control over the implementation of your accessor methods,

Re: Autorelease Question

2008-11-19 Thread Luke the Hiesterman
It's simply not true that you have no idea when an object will be autoreleased. If you're on the main thread, you know that it will be released at the end of the runloop, and you know that your current method will return to its caller within the current runloop. Furthermore, you know that

Plist to tableview

2008-11-19 Thread Richard S. French
Newbie question: How does one import an array of values from a dictionary (plist) and display on a window? It seems that the plist has to be translated to XML data and every byte read into an array. How does one then select just certain members where the plist contains an array under a key? I am

  1   2   >