Re: 2 itunesconnect questions

2011-11-12 Thread Quincey Morris
On Nov 11, 2011, at 16:59 , April wrote: That's why the meaningless name in my email even though by and large I do not use a pseudonym anywhere else in the world. AFAIK, there is not and never has been any standard of etiquette for this list that forbids or even frowns upon the use of

capturing self is likely to lead to a retain cycle ..

2011-11-12 Thread Roland King
I have a UIViewController which is presented modally, it has a textfield which allows editing and a model object, call it foo, on which it can attempt to set the 'topicName' property. Because I'm dealing with UIDocument(s) and trying to be nicely iCloud compatible and the topic name change does

Re: How to determine if there is an internet connection available?

2011-11-12 Thread Jean-Daniel Dupas
Le 12 nov. 2011 à 04:41, Conrad Shultz a écrit : On 11/11/11 6:39 PM, Vojtěch Meluzín wrote: Hi, I'm using BSD sockets for some internet access, it works fine. But if there is no connection available, it waits for say 30 seconds completely stopping the application. Is there a way to

Re: Calling a Cocoa library from C

2011-11-12 Thread Jean-Daniel Dupas
Le 12 nov. 2011 à 03:34, Charles Srstka a écrit : On Nov 11, 2011, at 8:22 PM, Wim Lewis wrote: On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote: Newb question. I need to create an OS X Cocoa library that is going to be called from a C program. The C program's interface will be simple,

Re: capturing self is likely to lead to a retain cycle ..

2011-11-12 Thread Jeff Kelley
ARC doesn’t know in the context of that method what will happen to the block. Each method lives in a vacuum with retain counts being consistent at the beginning and end. So, even though you know that the block will be released, that’s not clear in the context of the method. I would recommend the

Re: How to determine if there is an internet connection available?

2011-11-12 Thread Jens Alfke
On Nov 11, 2011, at 6:39 PM, Vojtěch Meluzín wrote: I'm using BSD sockets for some internet access, it works fine. But if there is no connection available, it waits for say 30 seconds completely stopping the application. Is there a way to determine if there is actually an internet

Re: Calling a Cocoa library from C

2011-11-12 Thread Nathan Sims
On Nov 11, 2011, at 6:22 PM, Wim Lewis wrote: int get_float_data(float *result1, float *result2) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @try { [objcCode call]; *result1 = [more stuff]; etc.; } @catch { fprintf(stderr, omg doomed!\n); etc.; } @finally {

Re: Calling a Cocoa library from C

2011-11-12 Thread Thomas Davie
On 12 Nov 2011, at 18:45, Nathan Sims wrote: On Nov 11, 2011, at 6:22 PM, Wim Lewis wrote: int get_float_data(float *result1, float *result2) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; @try { [objcCode call]; *result1 = [more stuff]; etc.; } @catch {

Re: Calling a Cocoa library from C

2011-11-12 Thread Jens Alfke
On Nov 12, 2011, at 10:45 AM, Nathan Sims wrote: Okay, does this mean that an object instantiated by a C function has persistence across C function calls? Yes. Think of Objective-C references as pointers to opaque structs, and treat them like any other generic pointer variable. You can

Re: Calling a Cocoa library from C

2011-11-12 Thread Michael Babin
On Nov 11, 2011, at 8:34 PM, Charles Srstka wrote: On Nov 11, 2011, at 8:22 PM, Wim Lewis wrote: On Nov 11, 2011, at 5:49 PM, Nathan Sims wrote: (OSX 10.6.8, Xcode 3.2.6) int get_float_data(float *result1, float *result2) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

Re: Calling a Cocoa library from C

2011-11-12 Thread Nathan Sims
On 12 Nov 2011, at 18:45, Nathan Sims wrote: On Nov 12, 2011, at 10:56 AM, Thomas Davie wrote: Okay, does this mean that an object instantiated by a C function has persistence across C function calls? In the example above you have: [objcCode call]; I'm guessing I would have to have:

Re: Calling a Cocoa library from C

2011-11-12 Thread Jens Alfke
On Nov 12, 2011, at 12:01 PM, Nathan Sims wrote: Hmm, if not a global, where would the declaration go? The C function certainly shouldn't return it, so if it is to remain persistent across calls, wouldn't the logical (the only?) place for it be as a global in the library's .m file? Not

NSBitmapImageRep and alpha channel

2011-11-12 Thread James Merkel
The document for NSBitmapImageRep says the following: Alpha Premultiplication If a coverage (alpha) plane exists, a bitmap’s color components are premultiplied with it. If you modify the contents of the bitmap, you are therefore responsible for premultiplying the data. For this reason, though,

Re: Calling a Cocoa library from C

2011-11-12 Thread Greg Guerin
Nathan Sims wrote: Hmm, if not a global, where would the declaration go? The C function certainly shouldn't return it, so if it is to remain persistent across calls, wouldn't the logical (the only?) place for it be as a global in the library's .m file? Why shouldn't the C function

Re: Calling a Cocoa library from C

2011-11-12 Thread Thomas Davie
Note that of course you can take this one step further and use a typedef to mask that you're passing back an untyped pointer: typedef OCObjcCodeRef void * OCObjcCodeRef OCCreateObjcCode(void) { return (ObjcCodeRef)[[ObjcCode alloc] init] } int OCGetFloatData(OCObjcCodeRef objcCodeRef,

Re: NSBitmapImageRep and alpha channel

2011-11-12 Thread Quincey Morris
On Nov 12, 2011, at 14:01 , James Merkel wrote: d' = a * s + (1 - a) * d All premultiplication does is precalculate a * s. First question -- what is d' in that equation? It's the result of compositing the source (your image) onto the destination (the background). I read images from files

Re: NSBitmapImageRep and alpha channel

2011-11-12 Thread James Merkel
On Nov 12, 2011, at 3:29 PM, Quincey Morris wrote: On Nov 12, 2011, at 14:01 , James Merkel wrote: d' = a * s + (1 - a) * d All premultiplication does is precalculate a * s. First question -- what is d' in that equation? It's the result of compositing the source (your image) onto the

App store receipt checking - getting a new receipt

2011-11-12 Thread Gideon King
Hi, I have implemented app store receipt checking, and it all seemed to be going OK, but I needed to change the bundle version number and check a new version, but when I run the application, it seems to download the previously generated receipt from the app store, which of course has the old

About iVars declaration and property

2011-11-12 Thread ico
I am surprise that I just know we do not need to declare instance variables explicitly when we declare the property and use @synthesize. That is we do not need a instance variable to be declared that is corresponds to the property declaration. look at this blog:

Re: About iVars declaration and property

2011-11-12 Thread Charles Srstka
On Nov 13, 2011, at 1:16 AM, ico wrote: I am surprise that I just know we do not need to declare instance variables explicitly when we declare the property and use @synthesize. That is we do not need a instance variable to be declared that is corresponds to the property declaration.