Re: iPhone Generating and displaying images using Bitmap

2009-05-19 Thread Shraddha Karwan
Hi, I get the following errors while displaying the JPEG buffered image. Error: Corrupt JPEG data: 584 extraneous bytes before marker 0xc0 Error: Quantization table 0x00 was not defined Error: Corrupt JPEG data: 446 extraneous bytes before marker 0xdb Error: Bogus marker length Error:

Re: Capturing key events in a menu

2009-05-19 Thread Adam Warski
Hello, ...but I first need to ask the standard question: waht are you trying to achieve? Adding: mention the scope too - do you want to do this for your app or all apps and maybe even the Apple menu too? What about context menus? NSPopUpButton menus and the like? I want to do this for one

re: Programatically set file URL of Core Data Document?

2009-05-19 Thread Ben Trumbull
I'm trying to programatically set the initial file url (path, filename) of an Core Data NSPersistentDocument, or if that is not possible, at least populate the Save panel with an initial filename. This is more an NSDocument / UI problem. Pushing this down into the model layer will make Core

iPhone text on UIImage not getting displayed on device.

2009-05-19 Thread Shraddha Karwan
I used the following function to add text on UIImage. I can display the text on iPhone Simulator but its not getting displayed on the actual device. What can be the cause? CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); CGContextRef context = CGBitmapContextCreate(NULL, w, h, 8, 4 *

Is there two streams with CFReadStreamRead happend in two threads?

2009-05-19 Thread Chris Gardner
Hi, Now I have created two threads and want to download files through the method below in each thread: 1. Create the stream using CFReadStreamCreateWithFTPURL() 2. Set up my callbacks wiht CFReadStreamSetClient() 3. Add it to the run-loop wiht CFReadStreamScheduleWithRunLoop() 4. Open

Re: Is there two streams with CFReadStreamRead happend in two threads?

2009-05-19 Thread Jean-Daniel Dupas
Le 19 mai 09 à 09:27, Chris Gardner a écrit : Hi, Now I have created two threads and want to download files through the method below in each thread: 1. Create the stream using CFReadStreamCreateWithFTPURL() 2. Set up my callbacks wiht CFReadStreamSetClient() 3. Add it to the

Re: Slow scrolling after NSPopup implementation

2009-05-19 Thread Steven Hamilton
Ok. I'm still struggling with this. My NSTableColumn is bound to an NSArrayController for content and content values. This works great. My custom controller has the following code in it to set the popup selection to display for each row. - (void)tableView:(NSTableView *)aTableView

[ANN] KNAppGuide - an open source in-app tutorial framework

2009-05-19 Thread Daniel Kennett
I'm pleased to announce the first release of KNAppGuide - an in-app tutorial framework inspired by Apple Guide of the System 7 era. The framework was written because, well, Apple Guide was awesome. The ability to guide your users through specific tasks in your application actually *IN*

Re: [ANN] KNAppGuide - an open source in-app tutorial framework

2009-05-19 Thread Mic Pringle
Hi Daniel, This looks like a great idea. Having perused the page on your site (I can't test the framework at the moment as I'm away from my Mac) it's not quite clear how the UI is highlighted (is it done by actually drawing a red circle as shown in the screenshots ?) I feel it would be much

Distinguish Pending Text from Committed Text

2009-05-19 Thread Dong Feng
When using an non-English input method, such as Japanese or Chinese, the entered characters are first in a pending status (i.e. with an underscore). Pressing the space key make those pending text converted to the actual non-English characters. Pressing the Enter key make the underscore beneath the

Re: Capturing key events in a menu

2009-05-19 Thread Benjamin Stiglitz
When a menu is open the Menu Manager in HIToolbox handles incoming events on its own. You be able to capture the events with an embedded NSView, but I first need to ask the standard question: what are you trying to achieve? Well, I want to know what the user typed when a menu is open, so

[NSApp presentError:error] Custom Icon ...

2009-05-19 Thread Mic Pringle
Hi, Is it possible to use an icon other than the applications when using [NSApp presentError:error] ? I'm open to all suggestions. Thanks -Mic ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: [ANN] KNAppGuide - an open source in-app tutorial framework

2009-05-19 Thread Daniel Kennett
Hi Mic, Thanks for your feedback. The framework does indeed highlight the UI with an animated red circle. I've gone ahead and put up a demo video on the framework's page so you can get a better feel for that it's like. I have been wondering about how to add styled content to guides, and I

Re: Capturing key events in a menu

2009-05-19 Thread Adam Warski
Hello, On May 19, 2009, at 4:28 PM, Benjamin Stiglitz wrote: When a menu is open the Menu Manager in HIToolbox handles incoming events on its own. You be able to capture the events with an embedded NSView, but I first need to ask the standard question: what are you trying to achieve?

Re: [ANN] KNAppGuide - an open source in-app tutorial framework

2009-05-19 Thread Mic Pringle
Hi Daniel, The video is a great aid as it really shows what the framework is about. I definitely think a web view is the way to go. You could even require that anyone using the framework create their documentation using the standard plug in/bundle format so that you could just provide the name

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Michael Ash
On Tue, May 19, 2009 at 9:48 AM, Dong Feng middle.fengd...@gmail.com wrote: When using an non-English input method, such as Japanese or Chinese, the entered characters are first in a pending status (i.e. with an underscore). Pressing the space key make those pending text converted to the

When init returns nil does it cause a leak

2009-05-19 Thread Reza Farhad
Hi all we have an object that gets initialized like most other objects -(id)init { self = [ super init ]; if ( self ){ ...do something; } return self; } if [ super init ] returns nil does this cause a leak, as the memory has already been

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Gideon King
You can use the markedRange method and then remove it from the text range you are dealing with to get only the committed text. Gideon On Tue, May 19, 2009 at 9:48 AM, Dong Feng middle.fengd...@gmail.com wrote: When using an non-English input method, such as Japanese or Chinese, the

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jesper Storm Bache
Apple's take on this is that when an initializer fails, then it should call release on itself and return nil. See: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/ocAllocInit.html#/ /apple_ref/doc/uid/TP30001163-CH22-SW13 This means that if super returns nil,

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jean-Daniel Dupas
Le 19 mai 09 à 18:24, Reza Farhad a écrit : Hi all we have an object that gets initialized like most other objects -(id)init { self = [ super init ]; if ( self ){ ...do something; } return self; } if [ super init ] returns nil does this cause

NSToolBar : Unable to add a seperator item in the toolBar

2009-05-19 Thread Arun
Hi, I have an application in which i added 2 buttons and one search view in the too bar. I need to insert a seperator in between search view and 2 buttons. I have tried the following in my code. and it is not working. Any idea? - (NSArray *) toolbarAllowedItemIdentifiers: (NSToolbar *) toolbar {

Tools in App Bundles

2009-05-19 Thread Kevin LaCoste
Hey guys, quick question about storing a helper tool in an application bundle. Currently I have a tool that is launched via NSTask stored in the Contents/MacOS folder of my bundle. When reading up on code signing I saw this in the Code Signing Release Notes for Mac OS X v10.5 document: Do not put

Re: iPhone text on UIImage not getting displayed on device.

2009-05-19 Thread Luke the Hiesterman
Is this just a function you wrote? I'm guessing that's the problem. All drawing on iPhone should be done in the drawRect: method (declared in UIView.h). To put text in an image, you should either add another view on top of the image (a UILabel perhaps) or subclass UIImageView and add your

Cocoa event handling in fullscreen

2009-05-19 Thread Christopher Hansen
Hello, I'm writing a fullscreen game using Cocoa. I need to intercept mouse and key events for my game's usage, but I'd also like to forward them on appropriately if my game code doesn't handle them specifically (e.g., adjusting volume, screen brightness, opening the CD/DVD ROM drive,

Re: When init returns nil does it cause a leak

2009-05-19 Thread Quincey Morris
On May 19, 2009, at 09:32, Jesper Storm Bache wrote: I personally disagree with the Apple recommendation, and I vote for calling [super dealloc] when initialization fails - because this will invoke dealloc only in the base classes where init succeeded. First of all, in general, it can't

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jesper Storm Bache
On May 19, 2009, at 10:58 AM, Quincey Morris wrote: On May 19, 2009, at 09:32, Jesper Storm Bache wrote: I personally disagree with the Apple recommendation, and I vote for calling [super dealloc] when initialization fails - because this will invoke dealloc only in the base classes where init

Re: iPhone Generating and displaying images using Bitmap

2009-05-19 Thread David Duncan
On May 18, 2009, at 11:06 PM, Shraddha Karwan wrote: Hi, I get the following errors while displaying the JPEG buffered image. Error: Corrupt JPEG data: 584 extraneous bytes before marker 0xc0 Error: Quantization table 0x00 was not defined Error: Corrupt JPEG data: 446 extraneous bytes before

Re: iPhone text on UIImage not getting displayed on device.

2009-05-19 Thread David Duncan
On May 18, 2009, at 11:43 PM, Shraddha Karwan wrote: CGContextSetRGBFillColor(context, 255, 255, 255, 1); It may not be related to what is going wrong, but Quartz always uses normalized colors when specifying components, so this should really be 1.0, 1.0, 1.0 instead of 255, 255, 255.

Re: When init returns nil does it cause a leak

2009-05-19 Thread Gwynne Raskind
On May 19, 2009, at 2:15 PM, Jesper Storm Bache wrote: In the obj-c world we then have to implement classes to be able to handle a dealloc call before the initializer has completely executed. My 2 cents... If we aren't implementing our classes this way to begin with, then we're not

Re: NSToolBar : Unable to add a seperator item in the toolBar

2009-05-19 Thread Peter Ammon
This code is correct. You may have customized the toolbar as a user, so that toolbarDefaultItemIdentifiers is not called. In that case, you can throw away the preferences file for testing. Otherwise, you'll have to explain what you mean by not working. On May 19, 2009, at 10:26 AM,

TableView TextFieldCell question...

2009-05-19 Thread Richard Nichols
Hello list, I have an application the contains a single NSTableView with 2 columns that are the default NSTextFieldCell. Everything is done through delegates, there is no binding. I use NSMutableAttributedString to format the text and URL data to display in the second column. This works

Re: When init returns nil does it cause a leak

2009-05-19 Thread Michael Ash
On Tue, May 19, 2009 at 2:24 PM, Gwynne Raskind gwy...@darkrainfall.org wrote: On May 19, 2009, at 2:15 PM, Jesper Storm Bache wrote: In the obj-c world we then have to implement classes to be able to handle a dealloc call before the initializer has completely executed. My 2 cents... If we

Re: Cancelling an animation in a UITableViewCell was Re: UITableViewCell instances

2009-05-19 Thread Luke the Hiesterman
On May 18, 2009, at 4:16 PM, Mike Manzano wrote: First, let me say thanks for your reply. I think I was able to implement a similar algorithm for detecting when a cell has gone off- screen by overriding the table view's -willRemoveSubview:. That's great if this works, but it's making a

[OT] Anyone have the a DIRECT phone number for a real person at Apple Legal???

2009-05-19 Thread Karan, Cem (Civ, ARL/CISD)
Various people here at work have been trying to get in contact with someone at Apple on the Legal team about the iPhone Enterprise agreement paperwork, but we've just been getting the run around. Does anyone have a DIRECT number (not just the info at http://www.apple.com/legal/contacts.html I

Re: [OT] Anyone have the a DIRECT phone number for a real person at Apple Legal???

2009-05-19 Thread I. Savant
On Tue, May 19, 2009 at 4:27 PM, Karan, Cem (Civ, ARL/CISD) cka...@arl.army.mil wrote: Various people here at work have been trying to get in contact with someone at Apple on the Legal team about the iPhone Enterprise agreement paperwork, but we've just been getting the run around. Does

Re: iPhone text on UIImage not getting displayed on device.

2009-05-19 Thread Alexander Spohr
Nope. Shraddha is creating a CGBitmapContext and draws into it. That is fine. Shraddha, did you check the heighton the sim and device? I mean h. CGContextShowTextAtPoint(context, 4, 130, text, strlen(text)); could go wrong, if the image is smaller than 130 pixels. Is text non-NULL? I use

Bindings and KVO of View objects

2009-05-19 Thread Stuart Malin
As my understanding of Bindings is that they implement using KVO and KVC, then is it safe to assume that if an object has a bindable property, then that property should be observable with KVO, yes? My specific concern is with NSSegmentedControl, which has a bindable property selectedIndex.

[off topic] Re: [OT] Anyone have the a DIRECT phone number for a real person at Apple Legal???

2009-05-19 Thread Scott Anguish
Please don't post off-topic messages. These go to 8000+ messages. You can contact Apple legal (or indeed any aspect of the company) through the main switchboard 408 996-1010 On 19-May-09, at 4:27 PM, Karan, Cem (Civ, ARL/CISD) wrote: Various people here at work have been trying to get in

Re: [OT] Anyone have the a DIRECT phone number for a real person at Apple Legal???

2009-05-19 Thread Kyle Sluder
Have you tried applefede...@apple.com ? Got that from here: http://www.apple.com/business/solutions/it/government.html --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the

Re: When init returns nil does it cause a leak

2009-05-19 Thread Nathan Vander Wilt
On May 19, 2009, at 9:37 AM, Jean-Daniel Dupas wrote: Le 19 mai 09 à 18:24, Reza Farhad a écrit : Hi all we have an object that gets initialized like most other objects -(id)init { self = [ super init ]; if ( self ){ ...do something; } return

Re: Cocoa event handling in fullscreen

2009-05-19 Thread Christopher Hansen
Is there a way that I can do this without a window? I'm writing a platform independent game, so I want to alter the structure as little as possible. The behavior that we want is to simply start up in full screen, and I'd like to avoid starting up with a blank window before going to

Re: When init returns nil does it cause a leak

2009-05-19 Thread Jesper Storm Bache
I did talk to an Apple engineer about this and when I argued for [super dealloc] I was told that it would be fine. I then logged a radar against the seemingly incorrect documentation, I got a reply stating that [self release] is the recommended approach by the AppKit team. My radar was

Re: Bindings and KVO of View objects

2009-05-19 Thread Quincey Morris
On May 19, 2009, at 14:18, Stuart Malin wrote: As my understanding of Bindings is that they implement using KVO and KVC, then is it safe to assume that if an object has a bindable property, then that property should be observable with KVO, yes? No. The name of the binding is *not* the same

Re: Bindings and KVO of View objects

2009-05-19 Thread Kyle Sluder
On Tue, May 19, 2009 at 7:01 PM, Quincey Morris quinceymor...@earthlink.net wrote: On May 19, 2009, at 14:18, Stuart Malin wrote: No. The name of the binding is *not* the same as the name of any property of the bound object. For example, most controls have a value binding, but controls don't

Better to chain key path dependencies, or list explicitly?

2009-05-19 Thread Rick Mann
I have some key paths dependent on other paths. I'm using +keypathsForValuesAffectingFoo to set up the dependency. Now I have a chain of dependencies: A - B - C. Is it better to just have B depend on C, and A depend on B, or should A explicitly depend on B and C? TIA, -- Rick

Re: Programatically set file URL of Core Data Document?

2009-05-19 Thread Jerry Krinock
Thanks, Ben. With the background you provided, after a couple hours of trial and error I finally devised a method that seems to work, shown below in -[NSPersistentDocument saveMoveToNewPath:error_p:]. Indeed, it is necessary to jump through quite a few hoops, and to do so in just the

Synthesized properties for scalars not KVO compliant

2009-05-19 Thread Kiel Gillard
Hi all, I have a few scalar (NSUInteger, CGRect etc) ivars in my model objects. I have declared identically named properties for these scalars and instructed the compiler to synthesize accessor methods for them. My controller objects add themselves to the model objects as observers with

Re: Cocoa event handling in fullscreen

2009-05-19 Thread douglas welton
Nothing stops you from starting up in full screen mode when you are using a window. In IB, create a borderless window. Size it appropriately. Uncheck the visible at Launch switch. In your awakeFromNib:, you can hide the main menubar. Finally, -makeKeyAndOrderFront: the window when you

Re: Synthesized properties for scalars not KVO compliant

2009-05-19 Thread Kiel Gillard
I should also mention I am not assigning a value to the scalar directly. On 20/05/2009, at 9:52 AM, Kiel Gillard wrote: Hi all, I have a few scalar (NSUInteger, CGRect etc) ivars in my model objects. I have declared identically named properties for these scalars and instructed the

Re: Bindings and KVO of View objects

2009-05-19 Thread Stuart Malin
On May 19, 2009, at 1:44 PM, Kyle Sluder wrote: On Tue, May 19, 2009 at 7:01 PM, Quincey Morris quinceymor...@earthlink.net wrote: On May 19, 2009, at 14:18, Stuart Malin wrote: No. The name of the binding is *not* the same as the name of any property of the bound object. For example, most

Re: Bindings and KVO of View objects

2009-05-19 Thread Stuart Malin
On May 19, 2009, at 1:44 PM, Quincey Morris wrote: On May 19, 2009, at 14:18, Stuart Malin wrote: snip My specific concern is with NSSegmentedControl, which has a bindable property selectedIndex. I am trying to add an observer for this property (using -addObserver: on an instance). Alas, I

Re: Tools in App Bundles

2009-05-19 Thread Chris Suter
Hi Kevin, On Tue, May 19, 2009 at 8:04 PM, Kevin LaCoste klaco...@zenvilla.com wrote: [snip] If I understand that correctly, my tool is in the correct place but I'm not confident. Should it be in Contents/MacOS Yes. or should I add a Contents/Executable folder? No. Bonus question. Is the

Re: Synthesized properties for scalars not KVO compliant

2009-05-19 Thread Jerry Krinock
On 2009 May 19, at 16:52, Kiel Gillard wrote: I feel I may be missing something very simple but I have no idea what. Never tried it with structs like CGRect but I just bound some integers like this yesterday and they KVO works. The title of your message says not KVO compliant. Please

Re: Cocoa event handling in fullscreen

2009-05-19 Thread Christopher Hansen
Thanks, Douglas. That helps. Christopher From: douglas welton douglas_wel...@earthlink.net To: Christopher Hansen christopher.han...@yahoo.com Cc: Alexander Spohr a...@freeport.de; cocoa-dev@lists.apple.com Sent: Tuesday, May 19, 2009 5:59:33 PM Subject: Re:

Re: Tools in App Bundles

2009-05-19 Thread Kevin LaCoste
Hey Chris, thanks for the reply. Some further follow up. I found some sample code that includes a helper tool and yes, it's in the Contents/MacOS folder. Also, when opening the inspector window for a Copy Files build phase, I noticed there is a popup menu with what I would guess are the

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Dong Feng
Thanks Michael and Gideon's reply. [NSTextInput markedRange] works. A minor question is that [NSWindow fieldEditor] returns an NSText*, rather than an NSTextView*. I think that's because of historical reason and it should be safe to always cast a returned NSText point to an NSTextView. Is it

Re: Distinguish Pending Text from Committed Text

2009-05-19 Thread Gwynne Raskind
On May 19, 2009, at 10:35 PM, Dong Feng wrote: Thanks Michael and Gideon's reply. [NSTextInput markedRange] works. A minor question is that [NSWindow fieldEditor] returns an NSText*, rather than an NSTextView*. I think that's because of historical reason and it should be safe to always cast a

Only One Reason to ever use Transient Properties in Core Data

2009-05-19 Thread Jerry Krinock
After working through another issue caused by my use of a transient property, I just searched the whole Core Data Programming Guide for transient. I found four disadvantages of using transient properties vs. one advantage. The advantage is not having to write custom accessor methods to

Re: Better to chain key path dependencies, or list explicitly?

2009-05-19 Thread Ken Thomases
On May 19, 2009, at 6:24 PM, Rick Mann wrote: I have some key paths dependent on other paths. I'm using +keypathsForValuesAffectingFoo to set up the dependency. Now I have a chain of dependencies: A - B - C. Is it better to just have B depend on C, and A depend on B, or should A explicitly

Re: Better to chain key path dependencies, or list explicitly?

2009-05-19 Thread Rick Mann
On May 19, 2009, at 20:39:12, Ken Thomases wrote: On May 19, 2009, at 6:24 PM, Rick Mann wrote: I have some key paths dependent on other paths. I'm using +keypathsForValuesAffectingFoo to set up the dependency. Now I have a chain of dependencies: A - B - C. Is it better to just have B

Clarification on custom NSFormatter

2009-05-19 Thread Erg Consultant
I have my own objects I store in an NSOutlineView. Each object has a name property. When I implement my custom NSFormatter to tell the table how to draw cells, do I create a separate subclass of NSFormatter, or can I make my existing data class subclass from NSFormatter and then use the data

Debugging ineffective binding?

2009-05-19 Thread Rick Mann
I have what I think is a very straightforward binding, but I can't verify that it's actually working. I created a property foo (of type NSCellStateValue, an NSInteger), and bound a checkbox's value to it in IB. To verify that the binding is changing the value, I implemented the

Re: Clarification on custom NSFormatter

2009-05-19 Thread Graham Cox
On 20/05/2009, at 1:43 PM, Erg Consultant wrote: I have my own objects I store in an NSOutlineView. Each object has a name property. When I implement my custom NSFormatter to tell the table how to draw cells, This is not what NSFormatter does. How a cell is drawn is defined by the

Re: Synthesized properties for scalars not KVO compliant

2009-05-19 Thread Andy Lee
On May 19, 2009, at 7:52 PM, Kiel Gillard wrote: I have a few scalar (NSUInteger, CGRect etc) ivars in my model objects. I have declared identically named properties for these scalars and instructed the compiler to synthesize accessor methods for them. My controller objects add themselves

Re: Debugging ineffective binding?

2009-05-19 Thread Ken Thomases
On May 19, 2009, at 10:44 PM, Rick Mann wrote: I have what I think is a very straightforward binding, but I can't verify that it's actually working. I created a property foo (of type NSCellStateValue, an NSInteger), and bound a checkbox's value to it in IB. To verify that the binding is

Re: Tools in App Bundles

2009-05-19 Thread Jerry Krinock
On 2009 May 19, at 18:21, Kevin LaCoste wrote: I found some sample code that includes a helper tool and yes, it's in the Contents/MacOS folder. Yes, but there are issues with this. Read: http://www.cocoabuilder.com/archive/message/cocoa/2009/3/26/233141 My privileged helper tool is in

Re: Debugging ineffective binding?

2009-05-19 Thread Rick Mann
On May 19, 2009, at 21:19:24, Ken Thomases wrote: On May 19, 2009, at 10:44 PM, Rick Mann wrote: I have what I think is a very straightforward binding, but I can't verify that it's actually working. I created a property foo (of type NSCellStateValue, an NSInteger), and bound a