Using @selector()

2008-08-09 Thread Christian Giordano
Hi guys, I'm a newbie and I'm reading a book which shows the two different option to link programmatically a control to an action: SEL mySelector; mySelector = @selector(methodName:); [myButton setAction:mySelector]; OR SEL mySelector; mySelector = NSSelectorFromString(@methodName:); [myButton

Re: Using @selector()

2008-08-09 Thread Christian Giordano
:34, Christian Giordano a écrit : Hi guys, I'm a newbie and I'm reading a book which shows the two different option to link programmatically a control to an action: SEL mySelector; mySelector = @selector(methodName:); [myButton setAction:mySelector]; OR SEL mySelector; mySelector

Creating Interface

2008-08-28 Thread Christian Giordano
Hi guys, I would like to create an Interface which will be eventually implemented by some classes. I am a bit confused here, in objective-c the .h files are basically already interfaces. Ok, but how could a .m file implements more than one? I couldn't find any document explaining how to implements

Re: Creating Interface

2008-08-28 Thread Christian Giordano
Schonder [EMAIL PROTECTED] wrote: You may read this: http://developer.apple.com/documentation/Cocoa/Conceptual/ObjectiveC/Articles/chapter_7_section_6.html#//apple_ref/doc/uid/TP30001163-CH15-TPXREF148 On 28.08.2008, at 12:14, Christian Giordano wrote: Hi guys, I would like to create an Interface

Checking for memory leaks with Instruments

2008-08-29 Thread Christian Giordano
Hi guys, I'm new to Objective-C and didn't have so much experience, in general, with manual managed memory. Despite I'm using Objective-C 2.0 I'm keen on not using the autorelease garbage collector. I'm try to understand if my application has memory leaks using Instruments. To check the total ram

Re: structs in Mutable containers

2008-09-16 Thread Christian Giordano
I didn't think about NSValue, thanks. Do you mean valueWithPointer? Cheers, chr On Tue, Sep 16, 2008 at 11:00 AM, Phil [EMAIL PROTECTED] wrote: On Tue, Sep 16, 2008 at 9:18 PM, Christian Giordano [EMAIL PROTECTED] wrote: Hi guys, I'm finding myself trying to add to mutable containers like

Re: structs in Mutable containers

2008-09-16 Thread Christian Giordano
I just realized valueWithPoint is not available on the iPhone SDK and, I can't understand why, it can't be discussed here. Both things of course suck! :) Thanks a lot, chr On Tue, Sep 16, 2008 at 11:24 AM, Graham Cox [EMAIL PROTECTED] wrote: On 16 Sep 2008, at 7:18 pm, Christian Giordano

Re: structs in Mutable containers

2008-09-16 Thread Christian Giordano
Yep, this should work as well. Thanks, chr On Tue, Sep 16, 2008 at 1:41 PM, Phil [EMAIL PROTECTED] wrote: On Tue, Sep 16, 2008 at 10:46 PM, Christian Giordano [EMAIL PROTECTED] wrote: I just realized valueWithPoint is not available on the iPhone SDK It's just a convenience method

Application frameworks for Objective-C?

2008-09-23 Thread Christian Giordano
Hi guys, I'm developing my first decent size application with Objective-C and I'm starting missing a framework I use for my applications when I do ActionScript, precisely PureMVC: http://puremvc.org/content/view/67/178/ It is basically a way to be able to send notifications across the

Re: Application frameworks for Objective-C?

2008-09-23 Thread Christian Giordano
Yep, that seems to be the way to go! Thanks a lot Graham. Best, chr On Tue, Sep 23, 2008 at 1:40 PM, Graham Cox [EMAIL PROTECTED] wrote: On 23 Sep 2008, at 10:33 pm, Christian Giordano wrote: It is basically a way to be able to send notifications across the application

Image processing in Cocoa

2008-09-24 Thread Christian Giordano
Hi guys, is there some good tutorial around about how to manipulate bitmaps in Cocoa? I would be interested on: - copy portion of image over another with a mask (this should be pretty straight forward with quartz2d) - apply threshold - apply effects like blur Not sure if some of this, like the

Re: Image processing in Cocoa

2008-09-24 Thread Christian Giordano
should happen in the view context? Should I extend the image view and handle the routing internally? Thanks, chr On Wed, Sep 24, 2008 at 11:08 AM, Mike Abdullah [EMAIL PROTECTED] wrote: On 24 Sep 2008, at 10:50, Christian Giordano wrote: Hi guys, is there some good tutorial around about how

Re: Image processing in Cocoa

2008-09-25 Thread Christian Giordano
]) Sao Paulo, Brazil Christian Giordano wrote: Thanks Mike, I can't use NSImage (guess why) but a subset. Btw, the problem I have is that I have a view which contains an image. I would like to draw in the image, not in the container view so I need to provide to the draw method the image

Re: Image processing in Cocoa

2008-09-25 Thread Christian Giordano
I think I found what to do. I need to create a bitmap context from the bitmap and drawing there. It makes sense that everything drawn is handled by contexts of course, I'm just a bit concerned about performances. Thanks, chr On Thu, Sep 25, 2008 at 7:35 AM, Christian Giordano [EMAIL PROTECTED

Mouse events with higher priority then repeating NSTimer

2008-09-29 Thread Christian Giordano
Hi guys, I'm trying to render the stage with a default interval. When the needed time to render the scene is higher than the interval itself, the application doesn't process anymore the mouse events. I'm setting the timer once with [NSTimer scheduledTimerWithTimeInterval]. I'm thinking of

Re: Mouse events with higher priority then repeating NSTimer

2008-09-29 Thread Christian Giordano
It seems my problem was that I was putting as interval 1/10 not 0.1 or 1.0/10, this presumebly was as putting interval 0. That's why the continuous loop :) Thanks, chr On Mon, Sep 29, 2008 at 11:22 AM, Christian Giordano [EMAIL PROTECTED] wrote: Hi guys, I'm trying to render the stage

Re: iPhone NDA dropped

2008-10-02 Thread Christian Giordano
This is a great news! I hope is not because Apple got too scared of Android :D chr On Wed, Oct 1, 2008 at 4:45 PM, Marc Stibane [EMAIL PROTECTED] wrote: http://developer.apple.com/iphone/program/ Will there be an iPhone list or can we post questions here? -- In a world without walls

External C function and duplicate symbol

2008-10-03 Thread Christian Giordano
Hi guys, I've few functions that I'm keeping on an external .h file. If the header is included in more than a class I get duplicate symbol error. I tried using #ifndef which I use on my C++ classes but didn't bring any luck. I had a look to the various headers in the framework and I saw they use

Create CGImageRef with transparency

2008-10-05 Thread Christian Giordano
I'm trying to create a CGImageRef with CGImageCreate from a generated byte array (RGBA) but it doesn't seem to handle the transparency, so all the pixels are visible when some should not. As color space I'm using CGColorSpaceCreateDeviceRGB(), as CGColorRenderingIntent I'm using

Re: Create CGImageRef with transparency

2008-10-05 Thread Christian Giordano
Yep, that worked perfectly, thanks a lot! chr On Sun, Oct 5, 2008 at 6:45 PM, Adam R. Maxwell [EMAIL PROTECTED] wrote: On Oct 5, 2008, at 10:28 AM, Christian Giordano wrote: I'm trying to create a CGImageRef with CGImageCreate from a generated byte array (RGBA) but it doesn't seem

Optimized pixel manipulation

2008-10-08 Thread Christian Giordano
I'm modifying frequently the pixels of the images, the way I found is creating a copy of the data (CGDataProviderCopyData(CGImageGetDataProvider(image));) modify the pixels and then create a new one. I'm facing performance issues and I fear that all this allocating and deallocating is not helping.

Re: Optimized pixel manipulation

2008-10-08 Thread Christian Giordano
, 2008 at 4:25 PM, Jean-Daniel Dupas [EMAIL PROTECTED] wrote: CGImage does not provide an efficient way to update , but maybe CGImage is not what you want. Where your image come from, why do you need a CGImageRef and what are you trying to do with it ? Le 8 oct. 08 à 17:01, Christian Giordano

Re: Optimized pixel manipulation

2008-10-08 Thread Christian Giordano
At the moment I'm starting creating a context and drawing basic shapes, is there another way to draw basic shapes on a bitmap? Cheers, chr On Wed, Oct 8, 2008 at 4:32 PM, Christian Giordano [EMAIL PROTECTED] wrote: I started questioning myself if maybe I need something else, but clearly I

Re: Optimized pixel manipulation

2008-10-08 Thread Christian Giordano
8, 2008, at 11:02 AM, Christian Giordano wrote: After drawing the shapes, I do pixel operations, of course. Are these pixel operations not something which can be accomplished by changing the way you draw, for example using compositing modes? Alternatively, do you have access to Core Image

Re: Optimized pixel manipulation

2008-10-09 Thread Christian Giordano
, Christian Giordano a écrit : If you've created a bitmap context, then you should already own the backing bitmap data buffer. You can just manipulate it directly without making a copy (via a CGImage). How could I access its buffer? Cheers, chr On Wed, Oct 8, 2008 at 5:21 PM, Ken Thomases

Get text width outside a view

2008-10-22 Thread Christian Giordano
I'm trying to calculate the width of a text and the same code I used in the past in a drawRect routine in a view to its UIGraphicsGetCurrentContext() isn't working. The main difference of course is the context, in this case I created a bitmap context and the code is basically this:

Re: Get text width outside a view

2008-10-22 Thread Christian Giordano
Probably my method was working but sizeWithFont is definitely the one to be used. Thanks a lot! chr On Wed, Oct 22, 2008 at 7:27 PM, Marco Masser [EMAIL PROTECTED] wrote: I'm trying to calculate the width of a text Cocoa: NSAttributedString(AppKitAdditions) implements a method named -size

Protocol + Delegate = conflict types

2009-01-16 Thread Christian Giordano
Hi guys, I'm trying to implement the Delegate pattern and I would like a delegate that works like NSURLConnection where any method of the delegate returns itself. The problem I have is that if I specify its type in the methods parameters instead of id: // RemoteLoader.h @protocol

Re: Protocol + Delegate = conflict types

2009-01-16 Thread Christian Giordano
Yep, that made the trick! Thanks a lot, chr On Fri, Jan 16, 2009 at 9:07 AM, Quincey Morris quinceymor...@earthlink.net wrote: On Jan 16, 2009, at 00:38, Christian Giordano wrote: // RemoteLoader.h @protocol RemoteLoaderDelegate -(void) onLoadingFail:(RemoteLoader *)loader; -(void

release static pointers

2009-01-26 Thread Christian Giordano
Hi guys, I'm using sqlite3 library and a common technique is to cache the statement. In some examples I found the statement is set as static in the model which gets instantiated lazily. I'm wondering if and how the pointer to the statement will be released. In the code samples I saw there is no

Re: release static pointers

2009-01-26 Thread Christian Giordano
It looked like a good tutorial :) Thanks, I'll check better the Apple way. Cheers, chr On Mon, Jan 26, 2009 at 1:59 PM, Peter Blazejewicz peter.blazejew...@gmail.com wrote: hi Christian, On Jan 26, 2009, at 11:25 AM, Christian Giordano wrote: I'm wondering if and how the pointer