Booleans

2009-05-28 Thread John Ku
I am trying to set an object's boolean, everything works but I get a warning of 'pointer from integer without a cast'. *// Here is the Main Class:* [theObject setActivated: YES]; *// Here is the Object Class:* @property(readwrite, assign) BOOL *activated; @synthesize activated; -

Re: Booleans

2009-05-28 Thread Roland King
BOOL isn't an object. you want BOOL not BOOL* John Ku wrote: I am trying to set an object's boolean, everything works but I get a warning of 'pointer from integer without a cast'. *// Here is the Main Class:* [theObject setActivated: YES]; *// Here is the Object Class:*

Re: Booleans

2009-05-28 Thread John Ku
Thank you all, a newb mistake. :PIm going crazy trying to put pointer on everything. Btw, BOOL is not, is Boolean a pointer type? Thanks! On Wed, May 27, 2009 at 11:46 PM, Roland King r...@rols.org wrote: BOOL isn't an object. you want BOOL not BOOL* John Ku wrote: I am trying to set an

Re: Booleans

2009-05-28 Thread Joel Norvell
John, I believe the problem is that you're treating the boolean as a pointer. HTH, Joel ___ 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

Laying out superscripted text

2009-05-28 Thread Graham Cox
I have code that lays out text on a path. It essentially boils down to the technique given in the Text Layout Programming Guide example code (Circle text) of setting up a transform before letting the layout manager get on with its normal work, done by calling -[NSLayoutManager

Bluetooth serial examples

2009-05-28 Thread Allen Curtis
Hello, I can not find any Bluetooth examples on the developer website. There was a link but it was broken. I have two problems that I am trying to solve: 1. The correct way to communicate with a Bluetooth serial port. The documentation indicated that there is a new method that provides

Clarification on the purpose of NSUserDefaults (newbie)

2009-05-28 Thread Diego Rey Mendez
Hello everyone, I'm new to development on the iPhone. I have been reading for a while now the official docs, and some tutorials and posts online explaining the use of NSUserDefaults. My questions: 1) It sounds to me as if this is the preferred class for storing the user preferences for my

Opening a NSPanel in the current virtual desktop instead of the one the app is in

2009-05-28 Thread Stefan Balu
Hey all, I am trying to open a NSPanel in the current virtual desktop, however, it moves me to the virtual desktop where the main NSWindow resides. How can I force a NSPanel to open in the current virtual desktop? -- Ștefan BĂLU Tel: +40726 252 799

Re: Opening a NSPanel in the current virtual desktop instead of the one the app is in

2009-05-28 Thread Stefan Balu
Fixed. [NSApp activateIgnoringOtherApps:YES]; [panel setCollectionBehavior:NSWindowCollectionBehaviorDefault|NSWindowCollectionBehaviorMoveToActiveSpace]; [panel makeKeyAndOrderFront:self]; On Wed, May 27, 2009 at 3:16 PM, Stefan Balu baluste...@gmail.com wrote: Hey

Re: Opening a NSPanel in the current virtual desktop instead of the one the app is in

2009-05-28 Thread Stefan Balu
Actually it didn't fix everything. If I close (and not release) the pannel, go to a different space, when the panel is to be displayed it will move me to where it previously was. So, the code below only unties the panel from the main window, however, if my panel is to be closed, when i call

New Reporting Tool Now in Beta

2009-05-28 Thread Etchasoft Incorporated
NOTE: Prior notice of this submission was provided to the list administrator. To comply with the administrator’s request, please do not respond to this post via the email list. We have instead established a special email for this beta test as follows:

SQLite/MySQL BLOB-creator application needed.

2009-05-28 Thread Frederick C . Lee
Greetings: I'm working within the Cocoa/iPhone environment using SQLite as my persistent storage means (albeit, MySQL would be adequate as well). I want to create a digital library that stores images as BLOBs to be incorporated into an SQLite table. So I need a simple OS X application

How to make our application as default for particular type of file.

2009-05-28 Thread Nikhil Khandelwal
Hi, I want to make my application as default for file of particular extension programmatically. Please reply as soon as possible. Thanks, Nikhil DISCLAIMER == This e-mail may contain privileged and confidential information which is the property of Persistent Systems Ltd. It is

Re: Traversing an NSXML subtree

2009-05-28 Thread Graham Cox
On 28/05/2009, at 10:10 PM, McLaughlin, Michael P. wrote: Yes. I looked at that but 1. My tree is quite small (about 3 pages) and Xpath seemed like overkill. 2. Different objects will seek out information in different parts of the tree. That is, each will do a subtraversal once their

Re: Laying out superscripted text

2009-05-28 Thread Graham Cox
On 28/05/2009, at 5:19 PM, Graham Cox wrote: I have code that lays out text on a path. It essentially boils down to the technique given in the Text Layout Programming Guide example code (Circle text) of setting up a transform before letting the layout manager get on with its normal work,

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

2009-05-28 Thread McLaughlin, Michael P.
On 5/27/09 6:42 PM, Greg Guerin glgue...@amug.org wrote: In reviewing the NSXML documents, I found no really simple way to traverse a subtree of an NSXMLDocument. That is, traverse from the root until you hit the node with the right name then pretend that that node is the root of a

Re: How determine if file is in Trash, given Path or Alias

2009-05-28 Thread Sean McBride
Jerry Krinock (je...@ieee.org) on 2009-05-27 1:04 AM said: At first I thought these FS functions were in Carbon, but the docs say that they are in CoreServices, so I guess this is OK for the 64-bit future. It's another example of 'Carbon' being a term with many meanings. These APIs have their

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

2009-05-28 Thread Graham Cox
On 28/05/2009, at 10:45 PM, McLaughlin, Michael P. wrote: I'm familiar with recursion; that is what prompted my query. However, the tree-traversal documentation at http://devworld.apple.com/documentation/Cocoa/Conceptual/NSXML_Concepts/Arti

Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to the core data store with no problem (they are read back correctly etc). Instance variables of

Re: Traversing an NSXML subtree

2009-05-28 Thread Graham Cox
On 28/05/2009, at 11:56 PM, McLaughlin, Michael P. wrote: Hello, I think you’re correct in what you show below. I was expecting that, since an XML document is already a tree, it would already have an equivalent to what you describe. I’ve reinvented the wheel too many times and now try

Re: Core data, bindings and multiple view NIB

2009-05-28 Thread Keary Suska
On May 27, 2009, at 10:07 PM, Tomaž Kragelj wrote: Thanks Keary, this works, however it requires that the same binding is repeated in each nib where the same list should be handled (some views may only need to show it while others can also modify it). I was thinking of creating a master

Re: Traversing an NSXML subtree

2009-05-28 Thread Graham Cox
On 29/05/2009, at 12:21 AM, Graham Cox wrote: makeObjectPerformSelector makeObjectsPerformSelector: ^ --G. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Regarding SavePanel in NSDocument

2009-05-28 Thread Sourabh Sahu
Hi All, I created NSDocument which has inbuilt SavePanel, what I want is the reference of SavePanel in my class. I tried NSSavePanel *panel = [NSDocument savePanel] But the code crashes. Any help will be appreciated. -Sourabh DISCLAIMER == This e-mail may contain privileged and

Re: Find default application for file of particular extension

2009-05-28 Thread Filip van der Meeren
On 28 May 2009, at 16:36, Nikhil Khandelwal wrote: Hi all, I want to find out which application is the default one for .x extension file in my application and to make my application the default one for that extension. For finding out who is owning an extention you should use the Launch

Spotlight importer default plugins?

2009-05-28 Thread Michael Domino
Hi all, I know this is off-topic, but I posted to the Spotlight list and got no replies, and I thought someone here might know this. Can anyone list the default set of mdimporter filters shipped with Mac OS X 10.4? I can figure this out by doing a clean install, but I am hoping to avoid

Re: Regarding SavePanel in NSDocument

2009-05-28 Thread Graham Cox
On 29/05/2009, at 12:47 AM, Sourabh Sahu wrote: I created NSDocument which has inbuilt SavePanel, what I want is the reference of SavePanel in my class. What's an inbuilt save panel? Because there isn't one in a normal NSDocument I tried NSSavePanel *panel = [NSDocument savePanel] But

Re: NSString initWithFormat and stringWith

2009-05-28 Thread Bill Bumgarner
On May 28, 2009, at 7:52 AM, Andy Lee wrote: On Wednesday, May 27, 2009, at 11:23PM, Bill Bumgarner b...@mac.com wrote: If you find something that is causing a bundle with Objective-C code to be unloaded, please file a bug via http://bugreport.apple.com/. It isn't supported and the number of

Re: NSString initWithFormat and stringWith

2009-05-28 Thread Jesper Storm Bache
Does your latest statement mean that the following (from http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Tasks/loading.html#/ /apple_ref/doc/uid/20001127-124675) is incorrect/obsolete information: You can unload the contents of a CFBundle object using

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

2009-05-28 Thread Greg Guerin
Mike McLaughlin. wrote: I'm familiar with recursion; that is what prompted my query. However, the tree-traversal documentation at http://devworld.apple.com/documentation/Cocoa/Conceptual/ NSXML_Concepts/Arti cles/TraversingTree.html#//apple_ref/doc/uid/TP40001257 seems to indicate that

performSelectorOnMainThread problem

2009-05-28 Thread Ben Einstein
Does anyone know of any issue that would cause performSelectorOnMainThread to not actually perform the selector but not report any kind of error? I use threads very often and have never had a problem like this, but when I call: [aControllerObject

Creating strings in a loop - Efficiency Question

2009-05-28 Thread Reza Farhad
Hi I have a situation where I need to create a new string as I go through a loop. What will be the most efficient way of doing this each time the call goes through the loop. 1. To create an auto releasing string. 2. To create a non auto-releasing string at the start of the loop and

Re: Creating strings in a loop - Efficiency Question

2009-05-28 Thread Dave Carrigan
On May 28, 2009, at 9:20 AM, Reza Farhad wrote: I have a situation where I need to create a new string as I go through a loop. What will be the most efficient way of doing this each time the call goes through the loop. 1. To create an auto releasing string. 2. To create a non

Re: performSelectorOnMainThread problem

2009-05-28 Thread Nick Zitzmann
On May 28, 2009, at 10:11 AM, Ben Einstein wrote: Does anyone know of any issue that would cause performSelectorOnMainThread to not actually perform the selector but not report any kind of error? Are you sure the main thread isn't busy and is running a run loop in its default mode?

Re: Creating strings in a loop - Efficiency Question

2009-05-28 Thread Roland King
well .. it's hard to say until you actually try it and profile your code however .. I try to stick to something like 2. whenever it doesn't cause me to bend the code around too much. I use alloc/init .. use variable .. release whenever I can. Absolutely nothing guarantees that anything in

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
On 28-May-09, at 10:39 AM, Keary Suska wrote: On May 28, 2009, at 7:03 AM, Rick Hoge wrote: I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to

Re: performSelectorOnMainThread problem

2009-05-28 Thread Jeff Johnson
Three general possibilities: (1) aControllerObject is nil. (2) The main run loop is not running for some reason. (3) The main run loop is not running in one of NSRunLoopCommonModes. Assuming you've eliminated (1), I'd look at (3). -Jeff On May 28, 2009, at 11:11 AM, Ben Einstein wrote:

Re: performSelectorOnMainThread problem

2009-05-28 Thread Ben Einstein
On May 28, 2009, at 12:36 PM, Jeff Johnson wrote: Three general possibilities: (1) aControllerObject is nil. Definitely not the problem because it works when calling performSelector: without the mainThread part. (2) The main run loop is not running for some reason. The main run loop

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Dave Fernandes
When the instance variable changes in your custom class, you can call willChangeValueForKey: and didChangeValueForKey: for the entity that contains your custom class. I haven't ever had to do this, but it is the first thing I would try. Dave On May 28, 2009, at 12:34 PM, Rick Hoge wrote:

Re: performSelectorOnMainThread problem

2009-05-28 Thread Corbin Dunn
On May 28, 2009, at 9:46 AM, Ben Einstein wrote: On May 28, 2009, at 12:36 PM, Jeff Johnson wrote: Three general possibilities: (1) aControllerObject is nil. Definitely not the problem because it works when calling performSelector: without the mainThread part. (2) The main run loop

Re: performSelectorOnMainThread problem SOLVED

2009-05-28 Thread Ben Einstein
Thanks for the advice, I had actually tried that as well to no avail. After playing around a bit, I'm fairly certain I've solved it, although I'm not really sure why it was a problem. At the top of the worker method, I was locking the NSManagedObjectContext and unlocking it just before

RE: SQLite/MySQL BLOB-creator application needed.

2009-05-28 Thread Kirk Kerekes
So I need a simple OS X application (either an existing desktop application, or a simple command-line application) that can serialize a PNG image into a BLOB (keeping all metadata, etc.) for access by a SQLite (or any SQL-type DB) engine (used within a Cocoa/iPhone application). AFAIK a SQLite3

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
On 28-May-09, at 12:56 PM, Dave Fernandes wrote: When the instance variable changes in your custom class, you can call willChangeValueForKey: and didChangeValueForKey: for the entity that contains your custom class. I haven't ever had to do this, but it is the first thing I would try.

Re: performSelectorOnMainThread problem SOLVED

2009-05-28 Thread Jason Foreman
On May 28, 2009, at 12:13 PM, Ben Einstein wrote: Thanks for the advice, I had actually tried that as well to no avail. After playing around a bit, I'm fairly certain I've solved it, although I'm not really sure why it was a problem. At the top of the worker method, I was locking the

Binding to two values

2009-05-28 Thread Kelvin Chung
I'm not sure the best way to do this, but suppose I have two NSArrayControllers, tableView1Controller and tableView2Controller. Now suppose I have an NSArrayController, table3Controller. What I am trying to do is to have it so that table3Controller's Content Array binding depend on both

Re: performSelectorOnMainThread problem

2009-05-28 Thread Shawn Erickson
On Thu, May 28, 2009 at 9:46 AM, Ben Einstein beinst...@me.com wrote: (2) The main run loop is not running for some reason. The main run loop is waiting to hear back from the completion of the worker What do you mean by waiting? Is it blocked on something? -Shawn

Re: performSelectorOnMainThread problem

2009-05-28 Thread Ben Einstein
Well at the time I wrote that, I thought it was sitting completely idle, but it seems the NSManagedObjectContext lock was blocking the main thread, even my application is specifically designed to not do that. It's working okay now... Thanks, Ben On May 28, 2009, at 1:51 PM, Shawn Erickson

Re: NSString initWithFormat and stringWith

2009-05-28 Thread Bill Bumgarner
On May 28, 2009, at 8:39 AM, Jesper Storm Bache wrote: Does your latest statement mean that the following (from http://developer.apple.com/documentation/CoreFoundation/Conceptual/CFBundles/Tasks/loading.html#//apple_ref/doc/uid/20001127-124675 ) is incorrect/obsolete information: You can

How to get the selected popupmenu item with core data

2009-05-28 Thread Michael Süssner
I have a table of objects (core data) which are used to fill the content of a NSPopupMenu. The user should be able to choose an abject. Afterwards the user should click on a button and the selected object should be added to another table. Now I have created a NSArrayController object and

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Quincey Morris
On May 28, 2009, at 06:03, Rick Hoge wrote: I have a core data (doc-based) app in which one of the entities includes a custom object as a persistent attribute. The custom object class implements NSCoding, and these objects are saved to the core data store with no problem (they are read

re: Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Ben Trumbull
Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify entries in this dictionary, and I would like this to cause the context to be flagged as dirty and to have

Possible to load window from nib in thread from Finder CM plugin

2009-05-28 Thread Aaron London
I'm working on a Finder CM plugin that needs a more complex UI for some menu item commands than CFUserNotificationCreate provides. All menu item commands for this CM perform work via an NSObject derived class on a thread so as not to block the Finder. Is it possible from that thread to

Re: Traversing an NSXML subtree

2009-05-28 Thread Justin Palmer
I had to do this recently. I needed to convert an NSXMLDocument to an NSDictionary. If you're interested, you can find the code on GitHub: http://github.com/Caged/aixmlserialize/blob/5322baec2f075d6f4f3bf9cab53b6a606c48ad76/src/AIXMLElementSerialize.m Justin Palmer http://alternateidea.com |

NSNotificationCenter CPU usage problem

2009-05-28 Thread Mike Crowe
Hi all, I'm running into a CPU usage problem with my Cocoa application. Basically once the app has been running for a few hours it starts, all of a sudden, to steadily consume an increasing amount of CPU. On further investigation with Instruments, it seems that object allocations seem to be the

issue porting resource files code from 10.4 to 10.5

2009-05-28 Thread Victor Bovio
Hello everyone, I'm porting an Application from 10.4 to 10.5 at 64 bit, and I have a problem with resource files, in the Tiger app I have this code to read some resource files: FSSpec spec; FSRef ref; CFURLRef url = (CFURLRef)[NSURL fileURLWithPath: myPathString]; if (CFURLGetFSRef(url,

multiple windows (dialogs) per nib (.xlib) file

2009-05-28 Thread John Yeh
How do I open a specific window in a nib file? I tried to use the following code, but it displays ALL the windows in that nib file. DialogController -[id]init { self = [super initWithWindowNibName:@MyNibName]; } DialogController *dialogController = [[DialogController alloc] init]; [NSApp

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Sean McBride
On 5/28/09 11:25 AM, Ben Trumbull said: Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify entries in this dictionary, and I would like this to cause the

Re: multiple windows (dialogs) per nib (.xlib) file

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 11:36 AM, John Yeh john...@adobe.com wrote: How do I open a specific window in a nib file? I tried to use the following code, but it displays ALL the windows in that nib file. Typically, you only have one window per nib file. There's usually a one-to-one correspondence

Re: How to get the selected popupmenu item with core data

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 11:16 AM, Michael Süssner michael.suess...@utanet.at wrote: Now I have the problem how I can read the index of the currently selected object of the popupmenu. This is typically indicative of a flawed design. You shouldn't be asking the UI for this; bind one of the

Re: Clarification on the purpose of NSUserDefaults (newbie)

2009-05-28 Thread Fritz Anderson
On 26 May 2009, at 6:34 PM, Diego Rey Mendez wrote: I'm new to development on the iPhone. I have been reading for a while now the official docs, and some tutorials and posts online explaining the use of NSUserDefaults. My questions: 1) It sounds to me as if this is the preferred class for

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
Ben, Quincey, Sean, thanks for the comments. Maybe there are some lower level design issues to rethink. This pattern is usually a flawed model design. If the properties are to be this independently mutable, then there should be a relationship, and/or the complex attribute should be

Re: Possible to load window from nib in thread from Finder CM plugin

2009-05-28 Thread Nick Zitzmann
On May 28, 2009, at 7:37 AM, Aaron London wrote: Is it possible from that thread to load a NSWindow from a nib and be able to have that window respond to UI events? No; it is a bad idea to load nibs in threads other than the main thread. You can't count on both the AppKit and

How to activate Find and Replace for Textview?

2009-05-28 Thread archana udupa
Hi lists Thanks in advance for those who can help me..:)I have subclass of textview. I want to add find and replace menu items.How can i do that? -- With Regards, - Archiez...:0)

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 11:59 AM, Rick Hoge rickho...@mac.com wrote:  The user can change the input parameters in the object's dictionary of inputs, and this should be reflected in the persistent store of corresponding to the custom attribute on disk.  I realize this is ugly, but I can't think

Re: Bindings and core data

2009-05-28 Thread Michael Süssner
Thanks for the hint Am 28.05.2009 um 01:23 schrieb Shlok Datye: The reason why IB complains is that the dot accessor only returns a regular set. You should therefore use IBOutlet NSSet *selParticipants instead. For the same reason, you cannot add a participant to selection.participants

remove object from one-to-many relationship

2009-05-28 Thread Michael Süssner
I have a master-detail view, where the detail contains another table with a one-to-many relationship. I have added a Remove Button which I have linked to the corresponding controller object. Although the list is not empty, I cannot remove any relationship. Then I have bound the canRemove

Re: How to get the selected popupmenu item with core data

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 12:36 PM, Michael Süssner michael.suess...@utanet.at wrote: I think that this implementation is according to the MCV-pattern, isn't it. Yes, that's correct. --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Re: How to activate Find and Replace for Textview?

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 12:11 PM, archana udupa udupachu...@gmail.com wrote:   Thanks in advance for those who can help me..:)I have subclass of textview. I want to add find and replace menu items.How can i do that? Look at the default Edit:Find:Find… menu item. It's wired up to First

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Rick Hoge
Just a follow-up. It's not perfect, and I'll revisit the design, but it does what I need for now. Specifically my entity has a 'transformable' attribute for which the values are a custom object class, and this object class has an ivar that is an NSMutableDictionary. The user can modify

Re: Send Keyboard Events

2009-05-28 Thread Dave Keck
Check out CGPostKeyboardEvent. ___ 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

Re: Send Keyboard Events

2009-05-28 Thread Dave DeLong
From the docs: This function is not recommended for general use because of undocumented special cases and undesirable side effects. The recommended replacement for this function is CGEventCreateKeyboardEvent, which allows you to create a keyboard event and customize the event before posting it

Hiding process list app icon for GUI apps

2009-05-28 Thread Erg Consultant
Is there a way to hide a GUI app's icon in the process/switch list as can be done for faceless background apps? I've tried several of the Info.plist settings but nothing seems to do this. Thanks, Erg ___ Cocoa-dev mailing list

CABasicAnimation leaking?

2009-05-28 Thread Mike Manzano
Hi all, I have some animation code that looks like this: CABasicAnimation *theAnimation = [CABasicAnimation animationWithKeyPath:@position.x] ; NSLog( @ANIMATION: started %x , theAnimation ) ; theAnimation.removedOnCompletion = YES ; theAnimation.duration = 0.125f ;

-init never gets sent

2009-05-28 Thread Erg Consultant
I have an object which I initialize like this: gReg = [ [ Registry alloc ] init ]; Problem is, my init method never receives any message. Does anyone know what can cause this? Thanks, Erg ___ Cocoa-dev mailing list

Re: -init never gets sent

2009-05-28 Thread David Blanton
what is the result of [ Registry alloc ] ? On May 28, 2009, at 5:34 PM, Erg Consultant wrote: I have an object which I initialize like this: gReg = [ [ Registry alloc ] init ]; Problem is, my init method never receives any message. Does anyone know what can cause this? Thanks, Erg

Re: -init never gets sent

2009-05-28 Thread Erg Consultant
Oddly, the object returned is non-nil. I should mention that the pointer being returned is a hack global declared at the top of the file like this: static Registry *gReg = nil; but that shouldn't matter. And I've checked that that global is never set to nil or created twice anywhere else in

Re: performSelectorOnMainThread problem

2009-05-28 Thread Erg Consultant
Either your main thread doesn't implement the selector requested, or else it's an issue with the runloop never processing the request. If you have code that alters the runloop or modifies its input sources, check that code first. Erg From: Ben Einstein

Performance, Efficiency - Coding practice

2009-05-28 Thread John Ku
I have this original class with the following method: - (void) update { NSString *title = [[NSString alloc] init]; title = @TEST; NSPoint drawAtOrigin; drawAtOrigin.x = 0; drawAtOrigin.y = 10; [title drawAtPoint: drawAtOrigin withAttributes: nil]; } Here, I updated it trying to be efficient:

Re: -init never gets sent

2009-05-28 Thread David Blanton
what does the declaration of init look like? On May 28, 2009, at 5:46 PM, Erg Consultant wrote: Oddly, the object returned is non-nil. I should mention that the pointer being returned is a hack global declared at the top of the file like this: static Registry *gReg = nil; but that

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Graham Cox
On 29/05/2009, at 9:57 AM, John Ku wrote: I have this original class with the following method: - (void) update { NSString *title = [[NSString alloc] init]; title = @TEST; This is incorrect for a start. You are leaking an empty string. You allocate and initialise it, then reassign its

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Andrew Farmer
On 28 May 2009, at 16:57, John Ku wrote: snip Is this a more efficient way to code? Which coding practice is better in terms of efficiency, memory, performance? The update method will get called often. So Im thinking there is no need to create 'NSPoint drawAtOrigin' everytime. Your

Re: performSelectorOnMainThread problem

2009-05-28 Thread Kyle Sluder
On Thu, May 28, 2009 at 4:53 PM, Erg Consultant erg_consult...@yahoo.com wrote: Either your main thread doesn't implement the selector requested, or else it's an issue with the runloop never processing the request. If you have code that alters the runloop or modifies its input sources, check

Re: -init never gets sent

2009-05-28 Thread Mike Manzano
How is your init defined? Mike Manzano Sent while mobile On May 28, 2009, at 4:34 PM, Erg Consultant erg_consult...@yahoo.com wrote: I have an object which I initialize like this: gReg = [ [ Registry alloc ] init ]; Problem is, my init method never receives any message. Does anyone

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread John Ku
Thank you all for the explanation. After reading over and experiment, I kind of get what you all are saying.I've probably confused myself too much with the dot syntax to use title = @fdsfd. So if i have: NSMutableString *title = [[NSString alloc] init]; [title setString: @test]; That would be

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Shawn Erickson
On Thu, May 28, 2009 at 4:57 PM, John Ku john.c...@gmail.com wrote: I have this original class with the following method: - (void) update { NSString *title = [[NSString alloc] init]; You create an empty string instance in the above and make title point at it. title = @TEST; You then make

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Graham Cox
On 29/05/2009, at 10:42 AM, John Ku wrote: NSMutableString *title = [[NSString alloc] init]; [title setString: @test]; That would be correct and safe? Yes, but pointless. If the string is a constant, use a constant. NSString* string = @whatever; --Graham

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Shawn Erickson
On Thu, May 28, 2009 at 5:42 PM, John Ku john.c...@gmail.com wrote: Thank you all for the explanation. After reading over and experiment, I kind of get what you all are saying.I've probably confused myself too much with the dot syntax to use title = @fdsfd. So if i have: NSMutableString

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread John Ku
Yeah sorry everyone, in the original example i am using a constant.My working app is actually using a mutable string. So I've got both mixed up. And yeah, NSMutableString will be initialized else where and released later. *hits myself in the head* Im not processing correctly today.. Thanks,

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Roland King
So if i have: NSMutableString *title = [[NSString alloc] init]; [title setString: @test]; That would be correct and safe? Thank!! John No. I hope it would emit warnings on compilation too. That would set title to an NSString instance, then you go calling setString: on it and that's an

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread Graham Cox
On 29/05/2009, at 10:56 AM, Andrew Farmer wrote: Nope, that'd be assigning a NSString instance to a NSMutableString variable oops, missed that ;-) --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin

Re: -init never gets sent

2009-05-28 Thread Greg Guerin
Erg Consultant wrote: Oddly, the object returned is non-nil. I should mention that the pointer being returned is a hack global declared at the top of the file like this: static Registry *gReg = nil; but that shouldn't matter. Post your code for alloc and -init. Your question can only

Re: Performance, Efficiency - Coding practice

2009-05-28 Thread John Ku
Better than making mistake one after another. But good lesson for me. Cheers, John On Thu, May 28, 2009 at 6:01 PM, Graham Cox graham@bigpond.com wrote: On 29/05/2009, at 10:56 AM, Andrew Farmer wrote: Nope, that'd be assigning a NSString instance to a NSMutableString variable

Re: -init never gets sent

2009-05-28 Thread Erg Consultant
The object's -init looks like this: - (id)init { if( !gReg ) { if( ( self = [ super init ] ) ) { // Zero out members... keys = nil; lastFlushTime = nil; } } return self; } Oddly, I just ran

Re: Hiding process list app icon for GUI apps

2009-05-28 Thread Peter Ammon
On May 28, 2009, at 1:57 PM, Erg Consultant wrote: Is there a way to hide a GUI app's icon in the process/switch list as can be done for faceless background apps? I've tried several of the Info.plist settings but nothing seems to do this. Thanks, Erg Hi Erg, The LSUIElement key

Re: -init never gets sent

2009-05-28 Thread Graham Cox
On 29/05/2009, at 11:19 AM, Erg Consultant wrote: - (id)init { if( !gReg ) { if( ( self = [ super init ] ) ) { // Zero out members... keys = nil; lastFlushTime = nil; } } return self; } This is a little broken. -init must

Re: Hiding process list app icon for GUI apps

2009-05-28 Thread Erg Consultant
That is exactly what I want - my app is a standard Cocoa app with a few windows and a menu bar but it's used to launch other apps - so I don't want it showing up in the Command-Tab switch list, the Dock, or the Force Quit window. Mainly, I need my windows and menubar to still be visible.

Re: Triggering change notifications when modifying custom object ivars in core data app

2009-05-28 Thread Dave Fernandes
On May 28, 2009, at 2:16 PM, Quincey Morris wrote: Well, yeah. The problem is that you're using something with the behavior of an entity (your custom object) as an attribute. That is, you want your object graph to include your custom objects (for the purpose of monitoring their changes),

Re: Regarding SavePanel in NSDocument

2009-05-28 Thread Andy Lee
On May 28, 2009, at 11:08 AM, Graham Cox wrote: On 29/05/2009, at 12:47 AM, Sourabh Sahu wrote: I created NSDocument which has inbuilt SavePanel, what I want is the reference of SavePanel in my class. What's an inbuilt save panel? Because there isn't one in a normal NSDocument I tried

Re: Regarding SavePanel in NSDocument

2009-05-28 Thread Graham Cox
On 29/05/2009, at 1:10 PM, Andy Lee wrote: In what way? Show the stack trace. Show your code. Show something. Yes. Don't expect people to guess what you're doing. SHOW US what you're doing and tell us what happened. And to that list I could have added show some initiative! --Graham

Re: Send Keyboard Events

2009-05-28 Thread Mr. Gecko
Seems to be what I needed. Thanks, Mr. Gecko On May 28, 2009, at 3:27 PM, Dave Keck wrote: Check out CGPostKeyboardEvent. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list.

Re: NSNotificationCenter CPU usage problem

2009-05-28 Thread Ken Thomases
On May 28, 2009, at 9:51 AM, Mike Crowe wrote: I'm running into a CPU usage problem with my Cocoa application. Basically once the app has been running for a few hours it starts, all of a sudden, to steadily consume an increasing amount of CPU. On further investigation with Instruments, it

  1   2   >