Re: Disabled controls don't update their visual appearance

2009-08-13 Thread Christopher Jensen
Sorry to bump my own post, but I am curious if anyone has any suggestions? Just get in touch if you need to see more code to help me figure out the issue :) Thanks, Chris ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin re

[Moderator] Re: scroll view is now disabled after switching to snowleopard

2009-08-13 Thread Scott Anguish
Remember folks, SnowLeopard is still covered by non-disclosure. Forums for NDA discussion are available at devforums.apple.com scott [moderator] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator co

Re: Cocoa window in Carbon app and [NSApp postEvent]

2009-08-13 Thread Ken Ferry
Hi, It sounds to me like you are interested in -[NSObject performSelectorOnMainThread:withObject:waitUntilDone:modes:]. -Ken On Thu, Aug 13, 2009 at 12:38 PM, Frederik Slijkerman < frede...@ultrafractal.com> wrote: > Hi, > > I'm working on a Photoshop plugin that uses a Cocoa UI, while of course

Re: File's owner, outlets and methods

2009-08-13 Thread Michael de Haan
On Aug 13, 2009, at 8:26 PM, Ken Thomases wrote: I think I finally get "File's owner" :-) So, if I understand you correctly, having set File's owner to the appropriate class ( in this case AppController) I set the appropriate **proxy** outlet of File's owner to the object ( in this ca

Re: detect "left mouse button clicked in menu bar"

2009-08-13 Thread David M. Cotter
sorry, bad choice of words on my part. i meant i want to call a function. anyway i learned about "NSMenuDidBeginTrackingNotification" which does exactly the trick i was looking for On Aug 13, 2009, at 8:09 PM, Michael Watson wrote: On Aug 13, 2009, at 16:56, "David M. Cotter" wrote:

Re: Document file read, but -readFromData:(etc) has error.

2009-08-13 Thread John Velman
On Thu, Aug 13, 2009 at 08:50:06PM -0500, Ken Thomases wrote: > On Aug 13, 2009, at 4:07 PM, John Velman wrote: > >> - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName >> error:(NSError **)outError >> { >>NSLog(@"readFromData has been called, typeName is: %...@\n", typeName); >> >

Re: File's owner, outlets and methods

2009-08-13 Thread Ken Thomases
On Aug 13, 2009, at 9:32 PM, Michael de Haan wrote: On Aug 13, 2009, at 6:36 PM, Ken Thomases wrote: An outlet is a property of an object. It's often backed by an instance variable as its implementation. Once you connect an outlet to an object in the nib, this connection is recorded as d

Cocoa window in Carbon app and [NSApp postEvent]

2009-08-13 Thread Frederik Slijkerman
Hi, I'm working on a Photoshop plugin that uses a Cocoa UI, while of course Photoshop is still Carbon currently. The plugin runs as a modal window pretty much all the time. Now I've run into a problem: when I post a custom event to the main event queue using [NSApp postEvent], it is never pr

Re: Arbitrary length ints from NSData

2009-08-13 Thread Chase Meadors
On Aug 13, 2009, at 1:50 PM, Quincey Morris wrote: On Aug 13, 2009, at 11:25, Chase Meadors wrote: I'm afraid you'll have to explain the multiply-by-256-and-add technique. I mean something like this (untested): unsigned char *bytes = [self bytes]; int byteIndex = [self le

Re: detect "left mouse button clicked in menu bar"

2009-08-13 Thread Michael Watson
On Aug 13, 2009, at 16:56, "David M. Cotter" wrote: i know i can detect when a particular menu is about to be shown, but what I want is to run a quick process before any menus from the menu bar are shown Launching a process is by no means a "quick" operation. It is imperative that menus

Re: Can I tell [NSAppleScript executeAppleEvent] to wait for script to complete?

2009-08-13 Thread Jerry Krinock
On 2009 Aug 13, at 15:45, DeNigris Sean wrote: When I use [NSAppleScript executeAppleEvent] to call handlers in a compiled script, it returns immediately. Is there a way to get it to block until the script is finished? Maybe there a notification I can listen for? H, my NSAppleScript

Re: File's owner, outlets and methods

2009-08-13 Thread Michael de Haan
On Aug 13, 2009, at 6:36 PM, Ken Thomases wrote: On Aug 13, 2009, at 4:24 PM, Michael de Haan wrote: [ **Very** briefly, the set up is as follows. AppController has an outlet (IBOutlet NSPanel *aboutWindow) and a method (-(IBAction) showPanel: (id) sender;) snip. One is that th

Re: Document file read, but -readFromData:(etc) has error.

2009-08-13 Thread Ken Thomases
On Aug 13, 2009, at 4:07 PM, John Velman wrote: - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { NSLog(@"readFromData has been called, typeName is: %...@\n", typeName); if ( outError != NULL ) { NSLog(@"outError is not null");

Re: File's owner, outlets and methods

2009-08-13 Thread Ken Thomases
On Aug 13, 2009, at 4:24 PM, Michael de Haan wrote: [ **Very** briefly, the set up is as follows. AppController has an outlet (IBOutlet NSPanel *aboutWindow) and a method (-(IBAction) showPanel: (id) sender;) ] So, there are really 2 things happening here? One is that the About Window's

Re: detect "left mouse button clicked in menu bar"

2009-08-13 Thread Peter Ammon
On Aug 13, 2009, at 2:56 PM, David M. Cotter wrote: i know i can detect when a particular menu is about to be shown, but what I want is to run a quick process before any menus from the menu bar are shown, and not run it again all the while the user is browsing the menus in the menu bar h

Can I tell [NSAppleScript executeAppleEvent] to wait for script to complete?

2009-08-13 Thread DeNigris Sean
When I use [NSAppleScript executeAppleEvent] to call handlers in a compiled script, it returns immediately. Is there a way to get it to block until the script is finished? Maybe there a notification I can listen for? Thanks! Sean DeNigris s...@clipperadams.com _

detect "left mouse button clicked in menu bar"

2009-08-13 Thread David M. Cotter
i know i can detect when a particular menu is about to be shown, but what I want is to run a quick process before any menus from the menu bar are shown, and not run it again all the while the user is browsing the menus in the menu bar how do i do this? apparently there is no "mouseDown" e

Re: Document file read, but -readFromData:(etc) has error.

2009-08-13 Thread John Velman
On Thu, Aug 13, 2009 at 05:21:06PM -0400, I. Savant wrote: > > Have you provided the complete implementation for this method? If so, you > seriously need to re-read this: > > http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Documents.html# Thanks. I did read it, but some tim

Re: Releasing ivars in -didTurnIntoFault. Should set to nil?

2009-08-13 Thread Quincey Morris
On Aug 13, 2009, at 13:33, Georg C. Brückmann wrote: Well, is there any disadvantage when autoreleasing? (I’m not talking about tight loops here – that’s another topic.) Generally speaking, releasing a delegating object, when it notifies its delegate that it’s finished, should be fine from

Re: iPhone: detect if docked?

2009-08-13 Thread David Duncan
On Aug 13, 2009, at 2:12 PM, Eric E. Dolecki wrote: Is there a way to tell if the device is currently docked? Probably the closest thing would be to use the Battery API to determine if the battery is being charged. See UIDevice for details. -- David Duncan Apple DTS Animation and Printing

Re: File's owner, outlets and methods

2009-08-13 Thread Michael de Haan
On Aug 13, 2009, at 1:59 PM, Dave Carrigan wrote: On Aug 13, 2009, at 1:32 PM, Michael de Haan wrote: The inspector of File's owner in the "Custom" xib shows, as expected an outlet ( which is connected) as well as the method "showPanel" which is *not* connected. In fact, I am unable to

Re: Document file read, but -readFromData:(etc) has error.

2009-08-13 Thread I. Savant
- (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { NSLog(@"readFromData has been called, typeName is: %...@\n", typeName); if ( outError != NULL ) { NSLog(@"outError is not null"); NSLog(@"Going to call NSError\n");

Re: scroll view is now disabled after switching to snowleopard

2009-08-13 Thread Jean-Daniel Dupas
Le 13 août 2009 à 21:46, Stephane Huaulme a écrit : this is an app with a couple of scrollviews, and after upgrading to snowleopard and recompiling, one of the 2 scrollviews is disabled. it's content is getting updated but it's grey'd out and i can't focus it. when i compare that view us

iPhone: detect if docked?

2009-08-13 Thread Eric E. Dolecki
I am looking into disabling the idle timer when the thing is docked and running my application. UIApplication* application = [UIApplication sharedApplication]; application.idleTimerDisabled = YES; Is there a way to tell if the device is currently docked so that the app doesn't get smacked down by

Document file read, but -readFromData:(etc) has error.

2009-08-13 Thread John Velman
I'm writing a simple throw away program to transform data format from a text file to a text file. I decided to use a Cocoa Document class for practice, instead of (for example) perl. Using -readFromData:ofType:Error: storing the data as a string, and then converting the string works fine (except

Re: File's owner, outlets and methods

2009-08-13 Thread Dave Carrigan
On Aug 13, 2009, at 1:32 PM, Michael de Haan wrote: The inspector of File's owner in the "Custom" xib shows, as expected an outlet ( which is connected) as well as the method "showPanel" which is *not* connected. In fact, I am unable to "connect" ( if that is the correct terminology) the "

Re: NSPredicate & Editor questions

2009-08-13 Thread Peter Ammon
On Aug 12, 2009, at 3:20 PM, Dave DeLong wrote: Thanks for the info! I spent some time at NSCoder Night last night poking around with attempting to convert an NSPredicate into an NSCompoundPredicate using the TODParseKit and the BNF definition of NSPredicate grammar in the docs, then even

Re: Releasing ivars in -didTurnIntoFault. Should set to nil?

2009-08-13 Thread Georg C. Brückmann
In fact, relinquishing ownership of the connection during this method is simply a bug. If you're its owner, you're responsible for preventing it from being deallocated while it's still alive -- and it's still alive. In this case, you're pretty sure that autoreleasing it keeps it from bein

File's owner, outlets and methods

2009-08-13 Thread Michael de Haan
Hi all, I wonder if I could get some clarity on this issue. Hillegass asks, ( challenge chapter 12) to create a custom About Panel. I have ( surprisingly) done this quite easily :-)...but I am left with this one puzzle. **Very** briefly, the set up is as follows. AppController has an outlet

[Meet]: Reminder LA CocoaHeads tonight 7:30pm

2009-08-13 Thread Rob Ross
Greetings LA CocoaHeads. Tonight Niilo Tippler will be showing some graphic experiments that he built in Flash - stuff that demonstrates some physics, springing, gravity, etc. - and ported over to the iPhone, explaining how they work and the differences he found between the two platforms in the

scroll view is now disabled after switching to snowleopard

2009-08-13 Thread Stephane Huaulme
this is an app with a couple of scrollviews, and after upgrading to snowleopard and recompiling, one of the 2 scrollviews is disabled. it's content is getting updated but it's grey'd out and i can't focus it. when i compare that view using the inspector with the other almost identical vie

Re: Arbitrary length ints from NSData

2009-08-13 Thread Quincey Morris
On Aug 13, 2009, at 11:25, Chase Meadors wrote: I'm afraid you'll have to explain the multiply-by-256-and-add technique. I mean something like this (untested): unsigned char *bytes = [self bytes]; int byteIndex = [self length]; int result = 0; BOOL firstByte

Re: Arbitrary length ints from NSData

2009-08-13 Thread Alastair Houghton
On 13 Aug 2009, at 19:25, Chase Meadors wrote: I'm a hobby programmer, and my first experience with programming was the currency converter w/ interface builder example. As such, I guess I'm learning "from the top down." I'm not very familiar with straight C as I am with Objective-C. I'm afr

Re: Arbitrary length ints from NSData

2009-08-13 Thread Chase Meadors
On Aug 13, 2009, at 1:17 PM, Quincey Morris wrote: On Aug 13, 2009, at 10:34, Chase Meadors wrote: In other words, I might read one piece of data that is one byte: . I would want this to be read as -2. However, the current method would make the string "0xFE", then scan it to 0x00FE,

Re: Arbitrary length ints from NSData

2009-08-13 Thread Quincey Morris
On Aug 13, 2009, at 10:34, Chase Meadors wrote: In other words, I might read one piece of data that is one byte: . I would want this to be read as -2. However, the current method would make the string "0xFE", then scan it to 0x00FE, which is completely different. I might then read a p

Re: Trouble with NSColor

2009-08-13 Thread Andy Lee
On Aug 13, 2009, at 1:27 PM, Daniel Furrer wrote: Is "foo" itself nil? No, foo is fine! =) Are you sure? I stuck your code in a button's action method and when I click the button foo is nil. I tried both your exact code and the correction Sherm pointed out. I think David Duncan has t

re: Core Data Crash on MOC Release

2009-08-13 Thread Ben Trumbull
I have a iPhone 3.0 application that is using core data in an NSOperation to perform some updates. It is using it's own NSManagedObjectContext connected to a common (with the main thread) persistent store coordinator. Everything works great until the NSOperation ends and is releasing the managed

Re: Trouble with NSColor

2009-08-13 Thread Sherm Pendley
On Thu, Aug 13, 2009 at 1:29 PM, Daniel Furrer wrote: > On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride wrote: > >> Did you read the docs for 'redComponent'? >> >> "This method works only with objects representing colors in the >> NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" >> >>

Arbitrary length ints from NSData

2009-08-13 Thread Chase Meadors
Hi All, I'm having a problem reading numbers from some raw data I need to read. The data encodes numbers in little-endian format. I am defining a category on NSData to accomplish this. - (NSNumber *)interpretAsSingleNumber { NSMutableString *hexString = [NSMutableString str

Re: Trouble with NSColor

2009-08-13 Thread Sean McBride
On 8/13/09 7:29 PM, Daniel Furrer said: >> Did you read the docs for 'redComponent'? >> >> "This method works only with objects representing colors in the >> NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" >> >> Use colorUsingColorSpaceName:NSCalibratedRGBColorSpace to convert. > >

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride wrote: > Did you read the docs for 'redComponent'? > > "This method works only with objects representing colors in the > NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space" > > Use colorUsingColorSpaceName:NSCalibratedRGBColorSpace to conve

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
> Which system color? Many system colors are patterns and thus do not have > real RGB values. > In this case I tried it with [NSColor controlColor]. It appears to be a regular color in the color panel. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.c

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
> Is "foo" itself nil? > No, foo is fine! =) ___ 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/Upd

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
> When/where are you trying to do this? I tried running this in main.m, > before calling NSApplicationMain(), and got nil returned from +controlColor. > > I moved it into an -awakeFromNib call, and +controlColor returned a valid > object. That leads me to believe that some connection needs to be

Re: Core Data Crash on MOC Release

2009-08-13 Thread Kyle Sluder
On Thu, Aug 13, 2009 at 10:03 AM, Volker in Lists wrote: > Why don't you call > self.persistentStoreCoordinator = nil; > instead of releasing the persistentStoreCoordinator ? -dealloc should always access instance variables directly; it should not call accessor methods. Currently this is impossib

Re: Releasing ivars in -didTurnIntoFault. Should set to nil?

2009-08-13 Thread Quincey Morris
On Aug 13, 2009, at 03:45, Georg C. Brückmann wrote: Consider NSURLConnection’s -connectionDidFinishLoading: delegate method: - (void)connectionDidFinishLoading:(NSURLConnection *)connection { // Do stuff [myReferenceToTheConnection release];

Re: Core Data Crash on MOC Release

2009-08-13 Thread Volker in Lists
Hi, do you have any observers or such on objects inside the moc (speak on entities)? I had a hard to trace down crash similar to yours and in my case I just needed some cleanup work on -didTurnToFault for the entity. Are there relationships established and not "destroyed" again completely

Re: Trouble with NSColor

2009-08-13 Thread Sean McBride
On 8/13/09 6:24 PM, Daniel Furrer said: >I'm trying to get the RGB components of a system color. Here's what I've >been trying: > >NSColor* foo = [[NSColor controlColor] colorUsingColorSpaceName: >@"NSCalibratedRGBColorSpace"]; >NSLog(@"%f, %f, %f", [foo redComponent], [foo blueComponent],

Core Data Crash on MOC Release

2009-08-13 Thread Greg Reichow
Long time lurker, first time to post. I have a iPhone 3.0 application that is using core data in an NSOperation to perform some updates. It is using it's own NSManagedObjectContext connected to a common (with the main thread) persistent store coordinator. Everything works great until the

Re: Trouble with NSColor

2009-08-13 Thread Randall Meadows
On Aug 13, 2009, at 10:33 AM, Daniel Furrer wrote: You are right. (But why?) When/where are you trying to do this? I tried running this in main.m, before calling NSApplicationMain(), and got nil returned from +controlColor. I moved it into an -awakeFromNib call, and +controlColor return

Re: Trouble with NSColor

2009-08-13 Thread David Duncan
On Aug 13, 2009, at 9:24 AM, Daniel Furrer wrote: I'm trying to get the RGB components of a system color. Which system color? Many system colors are patterns and thus do not have real RGB values. -- David Duncan Apple DTS Animation and Printing

Re: [iPhone 3.0] -- UIImage imageFromContentsOfFile and animations

2009-08-13 Thread David Duncan
On Aug 12, 2009, at 11:03 PM, John Michael Zorko wrote: However, though replacing imageNamed with imageFromContentsOfFile works wherever I set a UIImageView's image property, doing so to load the PNG images into my animation array results in the animation being invisible on the device, thou

Re: Trouble with NSColor

2009-08-13 Thread Alastair Houghton
On 13 Aug 2009, at 17:24, Daniel Furrer wrote: I'm trying to get the RGB components of a system color. Here's what I've been trying: NSColor* foo = [[NSColor controlColor] colorUsingColorSpaceName: @"NSCalibratedRGBColorSpace"]; NSLog(@"%f, %f, %f", [foo redComponent], [foo blueComponen

Trouble with NSColor

2009-08-13 Thread Daniel Furrer
I'm trying to get the RGB components of a system color. Here's what I've been trying: NSColor* foo = [[NSColor controlColor] colorUsingColorSpaceName: @"NSCalibratedRGBColorSpace"]; NSLog(@"%f, %f, %f", [foo redComponent], [foo blueComponent], [foo greenComponent]); but all I ever get is

Re: UITableView updating problem

2009-08-13 Thread glenn andreas
On Aug 13, 2009, at 8:44 AM, Brian Slick wrote: On Aug 13, 2009, at 8:31 AM, glenn andreas wrote: You're using a sledge hammer (reloadData) when you need a small screwdriver. From UITableView.h: - (void)reloadData; // reloads everything from scratch. redisplays visible

Re: UITableView updating problem

2009-08-13 Thread Brian Slick
On Aug 13, 2009, at 8:31 AM, glenn andreas wrote: You're using a sledge hammer (reloadData) when you need a small screwdriver. From UITableView.h: - (void)reloadData; // reloads everything from scratch. redisplays visible rows. --> because we only keep info about visible

Re: UITableView updating problem

2009-08-13 Thread glenn andreas
On Aug 12, 2009, at 9:15 PM, DKJ wrote: I've got a UITableView where the colour of the row text can change depending on its place in the table. For example, a row may change colour if it's moved from the bottom to the top of the table; and sometimes its colour may change if another row is

NSArrayController - compound values vs Select Inserted Objects

2009-08-13 Thread Jonathan del Strother
Heya, I'm struggling a bit with an NSArrayController with content bound to NSUserDefaultsController. The NSArrayController manages dictionaries, and so it appears that I need to select 'Handles Content as Compound Value'. Without this, changes made to the array through an NSTableView don't seem t

Re: Releasing ivars in -didTurnIntoFault. Should set to nil?

2009-08-13 Thread Georg C. Brückmann
Quincey – In practice, the delegate is often -- independently of its role as delegate -- the *owner* of the referencing object (e.g. a window controller that is a delegate of a table view loaded from a nib file is the owner of the nib file's contents, including, directly or indirectly, th

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

2009-08-13 Thread Steve
Sent from my iPod On 12 Aug 2009, at 20:04, cocoa-dev-requ...@lists.apple.com wrote: Send Cocoa-dev mailing list submissions to cocoa-dev@lists.apple.com To subscribe or unsubscribe via the World Wide Web, visit http://lists.apple.com/mailman/listinfo/cocoa-dev or, via email, send a me

Does NSPrintOperation retain the NSWindow passed in runOperationModalForWindow

2009-08-13 Thread Renzil D'Souza
Hi, I'm using an NSPrintOperation to print an image which I display in a temporary window. I also use setCanSpawnSeparateThread as YES, so my NSPrintOperation is running in a separate thread. The issue is, I've allocated a temp. window before calling runOperationModalForWindow and I don't know whe