NSStatusBar

2011-04-04 Thread Dean Krueger
Hello, I am developing a finder Menubar app, and am having one mysterious crash. I build the standard menu options when the app launches. Then in a NSOperationQueue I make a network connection and get some data to build out the dynamic data in the menu. If the user clicks on the menubar and disp

Re: Book for expert programmer about cocoa and Objective-C

2011-04-04 Thread Saurabh Garg
Sorry if this is tangential to the topic at hand, but I was wondering if there are any recommendations for an 'expert' level reference for graphics programming on both AppKit and UIKit. So far I have tried Bill Dudney's and Marcus Zarra's Core Animation books, but feel that there's more to it th

Textfield in navigation controller not responding to user taps

2011-04-04 Thread Symadept
Hi, I am having a strange problem in implementing UITextField as a part of leftBarItem of NavigationController. my leftBarItem customview, UIView has UIButton and UITextFields as subViews. { UIButton *theButton = [UIButton buttonWithType:UIButtonTypeCustom]; [theButton setImage:

[MEET] Toronto Cocoaheads / tacow - April 12

2011-04-04 Thread Karl Moskowski
tacow's next quarterly meeting is scheduled for 6:30 PM on Tuesday, April 12, 2011 in meeting room 304 of Metro Hall - click for agenda and location info. Note that this meeting marks tacow's 5th anniversary. Additional details can be found at .

Re: NSStatusBar

2011-04-04 Thread Nick Zitzmann
On Apr 2, 2011, at 8:04 AM, Dean Krueger wrote: > Hello, > I am developing a finder Menubar app, and am having one mysterious crash. I > build the standard menu options when the app launches. Then in a > NSOperationQueue I make a network connection and get some data to build out > the dynamic

Trying to subclass UISwitch

2011-04-04 Thread Philip Ershler
Hi, After beating my head against the wall trying to subclass UISwitch, so that I might change the "text" for the two states, I finally noticed that there is a statement in the docs that UISwitch cannot be subclassed. (Please no wise cracks that I should have seen that straight away, I g

Re: Trying to subclass UISwitch

2011-04-04 Thread Roger Dalal
Phil: Try http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and Robert Chin. It is well done. Roger Dalal Assembled Apps On Apr 4, 2011, at 12:20 PM, Philip Ershler wrote: > Hi, > After beating my head against the wall trying to subclass UISwitch, so > that I might change th

Re: Trying to subclass UISwitch

2011-04-04 Thread Philip Ershler
Outstanding, thank you very much! Phil On Apr 4, 2011, at 10:28 AM, Roger Dalal wrote: > Phil: > > Try http://osiris.laya.com/projects/rcswitch/ by Sascha Hoehne and Robert > Chin. It is well done. > > Roger Dalal > Assembled Apps > > > > > On Apr 4, 2011, at 12:20 PM, Philip Ershler wrot

Odd NSCache Eviction Behaviour

2011-04-04 Thread Dalmazio Brisinda
Hi all, I've been using an NSCache to store items that should be cached for performance reasons, since they are rather expensive to recreate. Understanding NSCache behaviour is giving me some headaches though. I initialize my NSCache as follows: _cellCache = [[NSCache alloc] init];

Re: Trying to subclass UISwitch

2011-04-04 Thread WT
On Apr 4, 2011, at 1:20 PM, Philip Ershler wrote: > Hi, > After beating my head against the wall trying to subclass UISwitch, so > that I might change the "text" for the two states, I finally noticed that > there is a statement in the docs that UISwitch cannot be subclassed. (Please > no

textField - setIntegerValue

2011-04-04 Thread JAMES ROGERS
I am feeling really stupid. I have a simple textField set up in IB, nothing else, just a window with a textField. I have connected the textField to the outlet. In appdelegate,h IBOutlet NSTextField *textField; in appdelegate.m [textField setIntegerValue:10] Nothing is display

Re: Odd NSCache Eviction Behaviour

2011-04-04 Thread Ken Thomases
On Apr 4, 2011, at 11:34 AM, Dalmazio Brisinda wrote: > 2) The larger issue. The documentation states: > > "By default, NSDiscardableContent objects in the cache are automatically > removed from the cache if their content is discarded, although this automatic > removal policy can be changed. If

Programming Context Menu

2011-04-04 Thread Bing Li
Dear all, I am now learning programming on Cocoa following the book, Cocoa Programming Developers Handbook. When programming Context Menus (Page 237), I got a problem. Although the context menu can be shown, it is weird that all of the items in the context menu are disabled. However, when running

Re: Trying to subclass UISwitch

2011-04-04 Thread Philip Ershler
On Apr 4, 2011, at 12:29 PM, WT wrote: > On Apr 4, 2011, at 1:20 PM, Philip Ershler wrote: > >> Hi, >> After beating my head against the wall trying to subclass UISwitch, so >> that I might change the "text" for the two states, I finally noticed that >> there is a statement in the docs th

Re: textField - setIntegerValue

2011-04-04 Thread Fritz Anderson
On 4 Apr 2011, at 1:53 PM, JAMES ROGERS wrote: > I have a simple textField set up in IB, nothing else, just a window with a > textField. I have connected the textField to the outlet. > > In appdelegate,h > IBOutlet NSTextField *textField; > > in appdelegate.m > > [textField setInte

Re: textField - setIntegerValue

2011-04-04 Thread Carlos Eduardo Mello
On Apr 4, 2011, at 3:53 PM, JAMES ROGERS wrote: I am feeling really stupid. I have a simple textField set up in IB, nothing else, just a window with a textField. I have connected the textField to the outlet. I am new to this but, (just in case...) have you, by any chance, named a functio

Re: Trying to subclass UISwitch

2011-04-04 Thread Jeffrey Walton
On Mon, Apr 4, 2011 at 12:20 PM, Philip Ershler wrote: > Hi, >        After beating my head against the wall trying to subclass UISwitch, so > that I might change the "text" for the two states, I finally noticed that > there is a statement in the docs that UISwitch cannot be subclassed. (Please

Re: Trying to subclass UISwitch

2011-04-04 Thread Luke the Hiesterman
"The UISwitch class is not customizable." And what he really wanted to do was customize the appearance. Luke On Apr 4, 2011, at 3:02 PM, Jeffrey Walton wrote: > On Mon, Apr 4, 2011 at 12:20 PM, Philip Ershler > wrote: >> Hi, >>After beating my head against the wall trying to subclass

Re: textField - setIntegerValue

2011-04-04 Thread Kyle Sluder
On Mon, Apr 4, 2011 at 2:26 PM, Carlos Eduardo Mello wrote: > I am new to this but, (just in case...) have you, by any chance, named a > function in your delegate as a setter for your outlet (setTextField:)? I > fell into that trap a little while ago:  -awakeFromNib is called before the > outlet i

Re: applicationWillTerminate not received

2011-04-04 Thread Jeffrey Walton
On Sat, Apr 2, 2011 at 9:53 PM, Quincey Morris wrote: > On Apr 2, 2011, at 18:01, Jeffrey Walton wrote: > >> I planned on saving some state when the applicationWillTerminate was >> invoked. Are things working as expected? Should I abandon my plans to >> save state during termination? > > No, you s

Re: Trying to subclass UISwitch

2011-04-04 Thread Laurent Daudelin
I think there is a difference between "customizable" and "not subclassable". The question I guess would be: did he try to subclass? -Laurent. -- Laurent Daudelin AIM/iChat/Skype:LaurentDaudelin http://www.nemesys-soft.com/ Logiciels Nemesys Software

Re: textField - setIntegerValue

2011-04-04 Thread Graham Cox
On 05/04/2011, at 7:26 AM, Carlos Eduardo Mello wrote: > I am new to this but, (just in case...) have you, by any chance, named a > function in your delegate as a setter for your outlet (setTextField:)? I fell > into that trap a little while ago: -awakeFromNib is called before the outlet > is

Re: textField - setIntegerValue

2011-04-04 Thread Carlos Eduardo Mello
On Apr 4, 2011, at 7:09 PM, Kyle Sluder wrote: On Mon, Apr 4, 2011 at 2:26 PM, Carlos Eduardo Mello wrote: I am new to this but, (just in case...) have you, by any chance, named a function in your delegate as a setter for your outlet (setTextField:)? I fell into that trap a little while ag

Re: textField - setIntegerValue

2011-04-04 Thread Graham Cox
On 05/04/2011, at 10:48 AM, Carlos Eduardo Mello wrote: > Still, if you look at this little test app (public link to Google Docs), > you'll see what I mean. There is an AppController class, (which was made the > window's delegate) with an outlet connected to a text field and a button in > the

Re: Trying to subclass UISwitch

2011-04-04 Thread Philip Ershler
The first thing I tried to do was to subclass the UISwitch. But when one looks at the docs for the UISwitch there are no Properties or Instance Methods that one can override to change the "text" on the switch. And when one looks at the origins of the UISwitch, there is nothing to be overridden t

NSString, stringByAppendingPathComponent, and Canonicalization

2011-04-04 Thread Jeffrey Walton
Hi All, I need to accept a filename from the user. Given the user supplied filename, I form a fully qualified name: NSString* pathName = [NSHomeDirectory(), stringByAppendingPathComponent:@"Documents"]; NSString* fullPathName = [pathName stringByAppendingPathComponent:filename]; How do I canoni

Re: NSString, stringByAppendingPathComponent, and Canonicalization

2011-04-04 Thread Stephen J. Butler
On Mon, Apr 4, 2011 at 10:08 PM, Jeffrey Walton wrote: > I need to accept a filename from the user. Given the user supplied > filename, I form a fully qualified name: > > NSString* pathName = [NSHomeDirectory(), > stringByAppendingPathComponent:@"Documents"]; > NSString* fullPathName = [pathName  

Re: NSString, stringByAppendingPathComponent, and Canonicalization

2011-04-04 Thread Ken Thomases
On Apr 4, 2011, at 10:08 PM, Jeffrey Walton wrote: > I need to accept a filename from the user. Given the user supplied > filename, I form a fully qualified name: > > NSString* pathName = [NSHomeDirectory(), > stringByAppendingPathComponent:@"Documents"]; > NSString* fullPathName = [pathName str

Re: Programming Context Menu

2011-04-04 Thread Bing Li
Dear Volker, I noticed that no IBAction/IBOutlet is available for the items in the code. Should I make some connections for them? I just connect the context menu with the class of ContextMenuView and connect the NSView in the Window with ContextMenuView. Thanks, LB On Tue, Apr 5, 2011 at 4:06

Re: Adding a 'usro' resource

2011-04-04 Thread Gerriet M. Denkmann
On 4 Apr 2011, at 23:38, "Gerriet M. Denkmann" wrote: > I want to make certain files to be opended by default by my own editor. > These files might contain all sort of file extentions. > In Finder.app I could do: File â∫‚ Always open with..., but I want to do this > programmatically. > > I gue

Re: Programming Context Menu

2011-04-04 Thread Chris Hanson
On Apr 4, 2011, at 12:38 PM, Bing Li wrote: >if (nil == defaultMenu) >{ >@synchronized(self) >{ >if (nil == defaultMenu) Don't do this. I don't mean just in Cocoa either, I mean don't do it ever. It's an anti-pattern called

Re: Programming Context Menu

2011-04-04 Thread Stephen J. Butler
On Tue, Apr 5, 2011 at 12:10 AM, Chris Hanson wrote: > On Apr 4, 2011, at 12:38 PM, Bing Li wrote: > >>        if (nil == defaultMenu) >>        { >>                @synchronized(self) >>                { >>                        if (nil == defaultMenu) > > Don't do this. I don't mean just in Co

Re: Programming Context Menu

2011-04-04 Thread Eli Bach
On Apr 4, 2011, at 1:38 PM, Bing Li wrote: > - (NSMenu*)menuForEvent: (NSEvent*)theEvent > { >NSPoint click = [self convertPoint: [theEvent locationInWindow] > fromView: nil]; > >NSMenuItem *locationMenuItem = >[[NS

Re: Programming Context Menu

2011-04-04 Thread Graham Cox
On 05/04/2011, at 1:37 PM, Bing Li wrote: > I noticed that no IBAction/IBOutlet is available for the items in the code. > Should I make some connections for them? Yes, but the outlets aren't visible to code because 'IBOutlet' is an IB thing. You need to call -setTarget: on the menu items with t

Passing an object to a custom sheet

2011-04-04 Thread Torsten Geise
I successfully created a dialog by following the custom sheet examples. But I still have trouble passing arguments to the dialog. I'll explain my problem based on a simple test app: - Main.xib contains a window and a button "show dialog". - AppDelegate has an IBAction for the "show dialog butto