Re: Rotation and translation of an image

2009-08-13 Thread Mohsan Khan
Google is your best friend, atleast mine. Your already said it image transformation, search for Cocoa image transformation. I find all the informtation I need to get started by searching Cocoa /Mohsan Khan On 2009-08-13, at 03:22, Agha Khan wrote: HI: Can someone point me the

[iPhone 3.0] -- UIImage imageFromContentsOfFile and animations

2009-08-13 Thread John Michael Zorko
Hello, all ... The source of my problem seems to be using UIImage -imageNamed to load my array of PNGs to be animated, since imageNamed caches the data in case I ask for it again. However, though replacing imageNamed with imageFromContentsOfFile works wherever I set a UIImageView's

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

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

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,

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

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

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 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

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: 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 blueComponent],

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,

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: 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

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 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], [foo

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: 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: 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

Re: Trouble with NSColor

2009-08-13 Thread Daniel Furrer
On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride s...@rogue-research.comwrote: Did you read the docs for 'redComponent'? This method works only with objects representing colors in the NSCalibratedRGBColorSpace or NSDeviceRGBColorSpace color space Use

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. I believe

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

Re: Trouble with NSColor

2009-08-13 Thread Sherm Pendley
On Thu, Aug 13, 2009 at 1:29 PM, Daniel Furrerdaniel.fur...@gmail.com wrote: On Thu, Aug 13, 2009 at 6:51 PM, Sean McBride s...@rogue-research.comwrote: Did you read the docs for 'redComponent'? This method works only with objects representing colors in the NSCalibratedRGBColorSpace or

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

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

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: FE. 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

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: FE. 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 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

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

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

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

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

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

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: 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: 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: 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: 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 time

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

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

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

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: 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 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

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

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 m...@davecotter.com 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

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

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

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

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