Re: Calling Methods From Custom UIImageView's initWithImage

2009-12-04 Thread Chunk 1978
thanks. :) On Sat, Dec 5, 2009 at 1:56 AM, Graham Cox wrote: > > On 05/12/2009, at 5:47 PM, Chunk 1978 wrote: > > > >> – >> #import >> >> @interface myUIImageViewClass : UIImageView > > >>       imageViewClass = [[UIImageView alloc] initWithImage:myImage]; > > > That should be: > >  imag

Re: Calling Methods From Custom UIImageView's initWithImage

2009-12-04 Thread Graham Cox
On 05/12/2009, at 5:47 PM, Chunk 1978 wrote: > – > #import > > @interface myUIImageViewClass : UIImageView > imageViewClass = [[UIImageView alloc] initWithImage:myImage]; That should be: imageViewClass = [[myUIImageViewClass alloc] initWithImage:myImage]; You defined a subcla

Calling Methods From Custom UIImageView's initWithImage

2009-12-04 Thread Chunk 1978
i'm trying to understand how to create my own UIImageView class with it's own custom methods that are fired from the initWithImage method, but i can't get it to work. i believe i'm missing something fundemental, which for some reason hasn't yet clicked in my head, so please help me understand what

Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions

2009-12-04 Thread Jim Correia
On Dec 4, 2009, at 10:54 PM, Grant Erickson wrote: > Thanks for the prompt reply. I forgot to mention one key element. The > subclass must support 10.4- and later so I cannot rely on 10.5- and later > APIs such as this. In that situation I’d probably write (and test!) if ([self respondsToSelect

Re: Is it possible to pass an object to a NIB

2009-12-04 Thread Chris Hanson
On Dec 4, 2009, at 7:47 PM, DeNigris Sean wrote: > I'm writing a RubyCocoa app, but my question is on the Cocoa API... > > I'm trying to unit test a view class. As it is very thin (just delegates all > work to the controller), all I want to check is that my connections (e.g. > outlets and acti

Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions

2009-12-04 Thread Grant Erickson
On 12/4/09 6:59 PM, Jim Correia wrote: > On Dec 4, 2009, at 1:52 PM, Grant Erickson wrote: > >> I have implemented a custom class that derives from NSTextFieldCell to draw >> status for an associated device (not unlike the network source list in the >> Network System Preferences) overriding only:

Is it possible to pass an object to a NIB

2009-12-04 Thread DeNigris Sean
Hi list! I'm writing a RubyCocoa app, but my question is on the Cocoa API... I'm trying to unit test a view class. As it is very thin (just delegates all work to the controller), all I want to check is that my connections (e.g. outlets and actions) are hooked up correctly. I've been trying to

Re: Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions

2009-12-04 Thread Jim Correia
On Dec 4, 2009, at 1:52 PM, Grant Erickson wrote: > I have implemented a custom class that derives from NSTextFieldCell to draw > status for an associated device (not unlike the network source list in the > Network System Preferences) overriding only: […] > The issue I am having is determining t

Re: NSAffineTransform scaleBy not scaling

2009-12-04 Thread Shane
> Yes, you are transforming the pointsPath 'in place'. That was it. > I thought I'd mentioned the need to do that in my previous message: "You'll > need to regenerate a new path for each plot though, as the path will be > permanently changed by the above." I guess it wasn't clear what I meant b

Re: NSToolbar problem in 10.6

2009-12-04 Thread Peter Ammon
On Dec 4, 2009, at 2:13 PM, John Mikros wrote: > Hello all, > > I have a window with an NSToolbar attached. The toolbar is created with > defaultItemIdentifiers being an empty NSArray, and then we add items via > insertItemWithItemIdentifier:atIndex: > > All the item identifiers that are add

Re: NSRuleEditor rows binding

2009-12-04 Thread Peter Ammon
On Dec 4, 2009, at 1:08 PM, Carter R. Harrison wrote: > Apple's documentation for NSRuleEditor indicates that it exposes a binding > named "rows". When I drag an NSRuleEditor onto my NSWindow in IB, I flip > over to the Bindings tab of the inspector and I don't see any bindings named > "rows"

Re: NSAffineTransform scaleBy not scaling

2009-12-04 Thread Graham Cox
On 05/12/2009, at 10:59 AM, Shane wrote: > Anyone see anything wrong that I'm doing? Yes, you are transforming the pointsPath 'in place'. You need to make a copy of the original path, apply the transform to it and draw the copy. Making a copy every time in drawRect: should be OK unless your p

Re: Best way to hook into the run loop?

2009-12-04 Thread Graham Cox
On 05/12/2009, at 5:02 AM, Quincey Morris wrote: >> However, what about the bug where opening and closing a group but doing >> nothing in between creates a bogus empty undo task? This comes into play >> when grouping things that occur over a series of events, for example mouse >> drags. It wo

Re: NSAffineTransform scaleBy not scaling

2009-12-04 Thread Greg Guerin
Shane wrote: So my thought is that somehow the transformations are not resetting to the identity matrix, but they are as far as I can tell. Maybe, I'm thinking, that the transforms are being added on top of each other as the view resizes. That's a fair description of what your code is doing.

Re: NSAffineTransform scaleBy not scaling

2009-12-04 Thread Shane
> That then just leaves you with the translation to deal with, for positioning > the scaled path where you want it. > I really hate to post this again, but I believe I'm doing it right, but there's obviously something I'm not understanding. By trying to figure out what's wrong w/ my scaling, I've

Re: NSRuleEditor rows binding

2009-12-04 Thread Jerry Krinock
On 2009 Dec 04, at 13:08, Carter R. Harrison wrote: > Apple's documentation for NSRuleEditor indicates that it exposes a binding > named "rows". When I drag an NSRuleEditor onto my NSWindow in IB, I flip > over to the Bindings tab of the inspector and I don't see any bindings named > "rows".

NSToolbar problem in 10.6

2009-12-04 Thread John Mikros
Hello all, I have a window with an NSToolbar attached. The toolbar is created with defaultItemIdentifiers being an empty NSArray, and then we add items via insertItemWithItemIdentifier:atIndex: All the item identifiers that are added to the toolbar are in the array returned by toolbarAllowedI

Re: [iphone] Libxml2 with a wrapper to NSArray

2009-12-04 Thread Philip Vallone
Good point - Thanks On Dec 4, 2009, at 1:32 PM, Alexander Spohr wrote: > > Am 04.12.2009 um 10:09 schrieb Philip Vallone: > >> Next I had a syntax error when declaring my NSArray and like you said it was >> pointing to an empty array: >> >> NSArray* result = [NSArray arrayWithArray:Per

NSRuleEditor rows binding

2009-12-04 Thread Carter R. Harrison
Apple's documentation for NSRuleEditor indicates that it exposes a binding named "rows". When I drag an NSRuleEditor onto my NSWindow in IB, I flip over to the Bindings tab of the inspector and I don't see any bindings named "rows". Anybody else manage to setup an NSRuleEditor with bindings?

Re: seg fault or not?

2009-12-04 Thread Kyle Sluder
On Fri, Dec 4, 2009 at 10:00 AM, Matt Neuburg wrote: > When I run my iPhone app on my device and quit it in the normal way (by > clicking the home button), the gdb console reports "Debugger stopped. > Program exited with status value:0.", which sounds fine. I believe gdb attaches to Springboard,

Getting Text Colors Right for Derived NSTextFieldCell under Various Conditions

2009-12-04 Thread Grant Erickson
I have implemented a custom class that derives from NSTextFieldCell to draw status for an associated device (not unlike the network source list in the Network System Preferences) overriding only: - (void) drawInteriorWithFrame: (NSRect)inFrame inView: (NSView *)inView; drawing the interior that i

Re: [iphone] Libxml2 with a wrapper to NSArray

2009-12-04 Thread Alexander Spohr
Am 04.12.2009 um 10:09 schrieb Philip Vallone: > Next I had a syntax error when declaring my NSArray and like you said it was > pointing to an empty array: > > NSArray* result = [NSArray arrayWithArray:PerformXMLXPathQuery(xmlData, > @"//mynode")]; Why are you putting the contents of th

Re: Why is "set" a class method of NSColor?

2009-12-04 Thread Matt Neuburg
On or about 12/4/09 10:07 AM, thus spake "Jens Alfke" : > In the newer CoreGraphics APIs (that replaced Display PostScript), > they switched to making context an explicit parameter of every drawing > call. Yes, I've noticed that, and it certainly makes it clearer what you're doing (at the price o

Re: Why is "set" a class method of NSColor?

2009-12-04 Thread Jens Alfke
On Dec 4, 2009, at 9:56 AM, Matt Neuburg wrote: I have a vague feeling that, once again, it's a nomenclature thing. It should really have a name that makes clear you're setting something about the graphics context (like setForContext or something)... In this context "set" means "set the r

seg fault or not?

2009-12-04 Thread Matt Neuburg
When I run my iPhone app on my device and quit it in the normal way (by clicking the home button), the gdb console reports "Debugger stopped. Program exited with status value:0.", which sounds fine. But at the same time, the Organizer console says (references to my app's name are expunged): Fri D

Re: Saving position in NSTextView

2009-12-04 Thread Douglas Davidson
On Dec 4, 2009, at 9:30 AM, Pascal Harris wrote: I am writing an application which, amongst other things, can be used to read text files. These text files are rather long (could be more than 1MB), which isn't convenient for anyone to read in one sitting. The text files are not editable.

Re: Best way to hook into the run loop?

2009-12-04 Thread Quincey Morris
On Dec 4, 2009, at 07:29, Graham Cox wrote: > On 05/12/2009, at 2:19 AM, Mike Abdullah wrote: > >> NSUndoManager works something like this: >> >> 1. The first time an action is registered, an undo group begins. >> >> 2. The group is scheduled to be closed using -[NSRunLoop >> performSelector:t

Re: Why is "set" a class method of NSColor?

2009-12-04 Thread Matt Neuburg
On Thu, 3 Dec 2009 18:54:19 -0800, Jack Boyce said: >Argh, never mind. I overlooked an important section of the Cocoa Drawing >Guide. > >On Thu, Dec 3, 2009 at 6:46 PM, Jack Boyce wrote: > >> I'm learning Cocoa, trying to understand certain "magical" features where >> it isn't obvious how things

Re: A hillegass challenge

2009-12-04 Thread Greg Guerin
Michael de Haan wrote: My question pertains to knowingly setting an object to NULL and then knowingly sending it a message as an acceptable technique. (If this is not done, drawRect will simply show the oval as if it was still being actively drawn). Also see: http://en.wikipedia.org/wik

Re: applicationShouldTerminate problem

2009-12-04 Thread Jens Alfke
On Dec 3, 2009, at 12:25 AM, proger proger wrote: int ret = NSRunAlertPanel(@"Save the work?", @"Do you want save the work?", A modal alert is the wrong UI here. It should be a sheet on the window. I used Interface Builder to delegate NSApplication with my delegate controller. But don't se

Saving position in NSTextView

2009-12-04 Thread Pascal Harris
I am writing an application which, amongst other things, can be used to read text files. These text files are rather long (could be more than 1MB), which isn't convenient for anyone to read in one sitting. The text files are not editable. I would like to be able to save the position in the te

Re: NSTextView & Horizontal Scrollbar bug

2009-12-04 Thread Ross Carter
On Dec 4, 2009, at 9:29 AM, Eric Gorr wrote: > I've got a sample application at > http://ericgorr.net/cocoadev/TextViewNoWrap.zip which demonstrates the > problem I am seeing. > > Basically, there is just a text view on a window with a horizontal scrollbar > which appears only when needed. >

Re: Best way to hook into the run loop?

2009-12-04 Thread Markus Spoettl
On Dec 4, 2009, at 4:29 PM, Graham Cox wrote: > However, what about the bug where opening and closing a group but doing > nothing in between creates a bogus empty undo task? This comes into play > when grouping things that occur over a series of events, for example mouse > drags. It would be ni

Re: NSSlider's setAltIncrementValue: broken?

2009-12-04 Thread Sean McBride
On 12/3/09 5:39 PM, Matt Neuburg said: >>The docs for NSSlider's setAltIncrementValue: say "Sets the amount by >>which the receiver modifies its value when the knob is Option-dragged". >>It does not. > >Isn't the problem just a documentation bug? Could be. I'm not in a position to know if the do

Re: Reboot? Slow First Run

2009-12-04 Thread gMail.com
Ok Jens, you are right. Sure my comment sounds naive. I am not an expert developer. All I wanted to say is that I would love to see a faster Finder and get a faster seek time. That's all. Regards -- Leonardo > Please don't make naive comments like this; it just makes you look > foolish. I know we

Re: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Micha Fuhrmann
Ok, thanks again, so far so good. Now as I drag an image or multiple images it creates a thumb of the dragged item(s), but as I drag to the desktop there's no plus sign badge on the dragged items and as a drop on the desktop it doesn't accept. I guess what I need to get is a - (NSArray *)name

Re: Outline View.

2009-12-04 Thread Dave DeLong
Here's one I created in about 10 minutes: Create a regular Cocoa app, drop an outline view into the window, and hook it up to the AppDelegate for its datasource and its delegate. The following four methods will allow you to walk your entire file hierarchy. Yes there's a memory leak, and this

Re: Best way to hook into the run loop?

2009-12-04 Thread Graham Cox
On 05/12/2009, at 2:19 AM, Mike Abdullah wrote: > NSUndoManager works something like this: > > 1. The first time an action is registered, an undo group begins. > > 2. The group is scheduled to be closed using -[NSRunLoop > performSelector:target:argument:order:modes:]. See the constants sectio

Re: Best way to hook into the run loop?

2009-12-04 Thread Mike Abdullah
NSUndoManager works something like this: 1. The first time an action is registered, an undo group begins. 2. The group is scheduled to be closed using -[NSRunLoop performSelector:target:argument:order:modes:]. See the constants section of NSUndoManager for a little more detail. As simple as th

Re: Outline View.

2009-12-04 Thread Clint Shryock
Try reading up on and using NSTreeController, specifically "Providing Providing Controller Content" in the Cocoa Bindings Programming topics: http://developer.apple.com/mac/library/documentation/cocoa/Conceptual/CocoaBindings/Concepts/CntrlContent.html#//apple_ref/doc/uid/TP40002147 otherwise Out

Re: Best way to hook into the run loop?

2009-12-04 Thread Jason Foreman
On Dec 4, 2009, at 7:18 AM, Graham Cox wrote: > I'm looking at the docs now, and for this use, it seems I would want > kCFRunLoopAfterWaiting to OPEN any undo groups, because that's just before > processing an event, but it's a little less clear when I should do the > automatic close. Presumab

Re: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Thomas Goossens
return NSDragOperationNone in the two methods below: - (NSDragOperation)draggingEntered:(id )sender - (NSDragOperation)draggingUpdated:(id )sender or invoke this during the setup of your IKImageBrowserView: registerForDraggedTypes:nil -- Thomas On Dec 4, 2009, at 3:44 PM, Micha Fuhrmann wrote:

Re: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Micha Fuhrmann
Ha yes, I'm doing a from only. Now I've filled the pasteboard with my NSData objects for NSFilesPromisePboardType. Which methods should I implement if I don't want any drops enabled within the image browser but only to the finder? Any direction appreciated. On 4 déc. 2009, at 14:48, Thomas Goo

Re: A hillegass challenge

2009-12-04 Thread Michael de Haan
On Dec 4, 2009, at 12:05 AM, Rob Keniger wrote: > > On 04/12/2009, at 5:55 PM, Seth Willits wrote: > >>> My question pertains to knowingly setting an object to NULL and then >>> knowingly sending it a message as an acceptable technique. >> >> As general answer: Yep. Happens all the time. > >

NSTextView & Horizontal Scrollbar bug

2009-12-04 Thread Eric Gorr
I've got a sample application at http://ericgorr.net/cocoadev/TextViewNoWrap.zip which demonstrates the problem I am seeing. Basically, there is just a text view on a window with a horizontal scrollbar which appears only when needed. I have set this text view up based on the instructions found

Re: NSHTTPCookieStorage to implement "Sign Out" functionality

2009-12-04 Thread Jerry Krinock
On 2009 Dec 01, at 15:29, Jesse Grosjean wrote: > Does anyone know how to consistently implement "log out" functionality > in an app that interacts with a web service? Just send a HTTP GET request to https://www.google.com/accounts/Logout Works for me. I believe we're talking about th

Re: Core Data modeling question

2009-12-04 Thread Jerry Krinock
On 2009 Dec 04, at 04:37, Mark Smith wrote: > However... when I do a unidirectional one to many relationship, the compiler > (rightly) complains as I do not have inverse relationships. However, it > makes no sense to me to clutter up my address object with pointers back to > "company" and "co

Re: beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector: on 10.6

2009-12-04 Thread Jerry Krinock
On 2009 Dec 03, at 22:40, Charles Burnstagger wrote: > What changes were made to NSSavePanel > beginSheetForDirectory:file:types:modalForWindow:modalDelegate:didEndSelector: Hidden in the Release Notes as usual :) Click this link and search its text for "NSSavePanel" http://developer.apple.co

Re: IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Thomas Goossens
Hi Micha, Are you trying to drag from the IKImageBrowserView or into the IKImageBrowserView ? if from: you need to fill the pasteboard by implementing the datasource method: - (NSUInteger) imageBrowser:(IKImageBrowserView *) aBrowser writeItemsAtIndexes:(NSIndexSet *) itemIndexes toPasteboard:(

IKImageBrowserView D&D with IKImageBrowserNSDataRepresentationType

2009-12-04 Thread Micha Fuhrmann
Dear All, Im using a IKImageBrowserView and trying to implement D&D. The image object I'm using is of IKImageBrowserNSDataRepresentationType. If I use IKImageBrowserPathRepresentationType D&D works fine. But with IKImageBrowserNSDataRepresentationType none of the delegates methods gets called:

Re: Best way to hook into the run loop?

2009-12-04 Thread Graham Cox
That looks perfect, thanks for the pointer. I'm looking at the docs now, and for this use, it seems I would want kCFRunLoopAfterWaiting to OPEN any undo groups, because that's just before processing an event, but it's a little less clear when I should do the automatic close. Presumably once the

Core Data modeling question

2009-12-04 Thread Mark Smith
Good morning, I am trying to figure out the best way to model a Core Data relationship. Essentially, I am trying to have an "Address" object that can be referenced by "Contacts" and "Companies." In other words, contact entities should have multiple addresses (one to many), and company entitie

_NSLayoutTreeSetOutsideDrawsUponLineFragmentAtGlyphIndex

2009-12-04 Thread Gerriet M. Denkmann
I have an app which contains 3 NSTextViews. Sometimes I get the following line: !!! _NSLayoutTreeSetOutsideDrawsUponLineFragmentAtGlyphIndex invalid glyph index 196 (the number varies. If I get this line, I get it a 3 times with the same number) Looking into Console.app I see that TextEdit also

Re: applicationShouldTerminate problem

2009-12-04 Thread proger proger
Thanks for point. Now I'm experimenting with document based cocoa application. I'm added NSTextView to my application interface, but after i load file i didn't see anything. My code: - (void)windowControllerDidLoadNib:(NSWindowController *) aController { [super windowControllerDidLoadNib:aCont

Re: MacResearch Tutorial on beginning a Cocoa/iPhone app.

2009-12-04 Thread Philip Vallone
Thanks Brian, This looks very useful. Regards, Phil On Dec 3, 2009, at 5:25 PM, Brian Dittmer wrote: > If you need graphing/charting on either iPhone or OSX then checkout > CorePlot, it's a rather impressive and mature library for generating > graphs and charts. > > http://code.google.com/p/c

Re: NSSpellChecker and checkSpellingOfString problems (solved... embarrassingly)

2009-12-04 Thread Keith Blount
Please ignore all previous messages about NSSpellChecker. I wish there were a way to withdraw mails after they've been sent, because it turns out I'm an idiot. This is actually a *feature* of Snow Leopard, not a bug. The misspelled words I was using and that my user had sent me were all fine in

Re: NSSpellChecker and checkSpellingOfString problems

2009-12-04 Thread Keith Blount
Just an update on this. It seems to be a Snow Leopard bug, as I can now reproduce it in TextEdit. If you try typing "accede" or "accademia" in an empty TextEdit window, then ctrl-click on them to get suggestions, you get nothing - they aren't caught as misspelled. If you do the same when the mis

Re: NSSpellChecker and checkSpellingOfString problems

2009-12-04 Thread Keith Blount
Hi, Sorry, I missed your e-mail yesterday and only just saw it. > Can't you simply use something like > NSMenu *theMenu = [super menuForEvent:theEvent]; > early in your code and let the system do the heavy lifting? Unfortunately it's not as simple as that as the only items I need are the spelli

Re: [iphone] Libxml2 with a wrapper to NSArray

2009-12-04 Thread Philip Vallone
Hi Thanks for the help. I did not receive any message from Sean, but your comments lead me in the right direction. First I changed xmlData to: NSData * xmlData = [NSData dataWithContentsOfFile: filePath]; Next I had a syntax error when declaring my NSArray and like you said it was poi

Re: How to get an italic font

2009-12-04 Thread Gerriet M. Denkmann
On 4 Dec 2009, at 14:44, mlist0...@gmail.com wrote: > Is there some reason you can't use -[NSFontManager convertFont:toHaveTrait:] ? No reason at all, except my ignorance of this method. > It "returns a font whose traits are the same as those of the given font, > except that the traits are cha

Re: A hillegass challenge

2009-12-04 Thread Rob Keniger
On 04/12/2009, at 5:55 PM, Seth Willits wrote: >> My question pertains to knowingly setting an object to NULL and then >> knowingly sending it a message as an acceptable technique. > > As general answer: Yep. Happens all the time. As Seth points out, this is perfectly normal. However, you sho