Re: Read jpeg comments from file?

2008-04-03 Thread Jean-Daniel Dupas
If you just need to display the image, use an NSImage (initWithContentsOfFile). If you need a greater control over metadata, use the ImageIO API (search CGImageSource in doc and sample codes). Le 2 avr. 08 à 22:50, Trygve Inda a écrit : I have a jpeg file which has a comment added as meta d

Re: activate my application while dragging on other application window

2008-04-03 Thread Apparao Mulpuri
Basically my application is a monitor based application, which will divide the monitor into grids(it will divide it like .. quad, triplet,hexa. One status bar item is provided for user grid selection). Now, if user drags any other application window -- i have to highlight the grid and make the dra

Re: Read jpeg comments from file?

2008-04-03 Thread Trygve Inda
> If you just need to display the image, use an NSImage > (initWithContentsOfFile). > If you need a greater control over metadata, use the ImageIO API > (search CGImageSource in doc and sample codes). This doesn't work: CGImageSourceRef source = CGImageSourceCreateWithURL ((CFURLRef) [NSURL fileU

Re: How to store NSRect as Core Data attribute?

2008-04-03 Thread Daniel Thorpe
Thanks for the feedback on this. I have gone with using a ...AsString attribute and using NSRectFromString. Seems to work okay, although I've got no idea if it's the most efficient method. I think Core Data seems a little limited in that you can't store an NSValue object as an attribute, I'

Re: Alternating Button

2008-04-03 Thread Gerriet M. Denkmann
On 2 Apr 2008, at 19:59, douglas a. welton wrote: Gerriet, Check out the documentation on User Interface Validation: This should get you going in the right direction. Alternately, you can l

KVC - how to get properties into a common form?

2008-04-03 Thread Graham Cox
Using -valueForKeyPath, returning an id. Is there an easy way to convert whatever is into a common form (a string, in my case), or do I have to have a huge switch statement that checks the class and calls different code for each kind to convert to a string? (or similar, like an NSObject ca

Re: KVC - how to get properties into a common form?

2008-04-03 Thread Matt Gough
On 3 Apr 2008, at 13:29, Graham Cox wrote: Using -valueForKeyPath, returning an id. Is there an easy way to convert whatever is into a common form (a string, in my case), or do I have to have a huge switch statement that checks the class and calls different code for each kind to convert

Propagate changes/insertions in main context

2008-04-03 Thread malcom malcom
Dear List, I'm working with CoreData. I need to insert lots of objects and make relationship with these and I've decided to perform this operation deteaching a new thread that pool an NSArray where data is placed. This thread make the object and insert it in a second managed object context,

More fun with C++

2008-04-03 Thread Brad Peterson
Hi, Seems like I'm once again behind the "mixing Obj-C with C++" 8-ball. :( This time, I'm getting compile errors in the .h file of my C++ class. Specifically, just this much code: using namespace std; class CXLSWriter { Generates 3 errors, and one warning: error: syntax error befor

Re: More fun with C++

2008-04-03 Thread Paul Thomas
On 3 Apr 2008, at 13:48, Brad Peterson wrote: Hi, Seems like I'm once again behind the "mixing Obj-C with C++" 8-ball. :( This time, I'm getting compile errors in the .h file of my C++ class. Specifically, just this much code: using namespace std; class CXLSWriter { Generates 3 errors,

Re: Cocoa-dev Digest, Vol 5, Issue 533

2008-04-03 Thread Daniel Child
evLanguageAsString is a function defined in a file called DataTypes.h. Both DataDescription.h and Step1_SourceTypeController.h import DataTypes.h. I thought #import would take care of the possibility of duplication. Are you suggesting I need to separate the declaration of the function fro

Re: Alternating Button

2008-04-03 Thread douglas a. welton
Gerriet, Check out the function GetCurrentEventKeyModifiers() in the Carbon Event Manager reference: rega

Re: KVC - how to get properties into a common form?

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 5:19 AM, Matt Gough wrote: Is there an easy way to convert whatever is into a common form (a string, in my case), or do I have to have a huge switch statement that checks the class and calls different code for each kind to convert to a string? (or similar, like an NSObjec

Re: activate my application while dragging on other application window

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 1:57 AM, Apparao Mulpuri wrote: Now, if user drags any other application window -- i have to highlight the grid and make the dragging window to transparent. By "any other application window", do you mean a window belonging to a _different_ application other than your own?

Re: Cocoa-dev Digest, Vol 5, Issue 533

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 7:08 AM, Daniel Child wrote: I thought #import would take care of the possibility of duplication. All "#" declarations are handled by the preprocessor, which is just a dumb macro engine that feeds its output into the compiler. The compiler itself just parses a single cont

Re: KVC - how to get properties into a common form?

2008-04-03 Thread Andy Lee
Right, it depends on your requirements for the "common form." Rather than do a huge switch statement, you could add your own - myDescription method in a category of NSObject. It could call - description by default, and you could override it in categories of other classes you care about where

Re: Read jpeg comments from file?

2008-04-03 Thread Steve Christensen
On Apr 3, 2008, at 2:13 AM, Trygve Inda wrote: If you just need to display the image, use an NSImage (initWithContentsOfFile). If you need a greater control over metadata, use the ImageIO API (search CGImageSource in doc and sample codes). This works and retrieves the user text that was embedde

Seph K sent you a special gift

2008-04-03 Thread Seph Knows
Seph gave you a gift, find out what you got by joining BluBet. https://www.blubet.com/invitepath/g2/6081cb3d019111ddbaad02bf453b928c/1 --- This email was sent to you by BluBet user Seph K ([EMAIL PROTECTED]). This email is never sent unsolicited. If you believe you have received this in error,

Re: Resorting normal field editor behaviour

2008-04-03 Thread Nate Weaver
I think what you probably want is to not use a custom field editor, but instead set your controller to the NSTableView's delegate (which it probably already is) and use the @"NSFieldEditor" key of the notification's userInfo dictionary to access the field editor. (Hopefully NSTableView isn'

Re: More fun with C++

2008-04-03 Thread Herb Petschauer
# ifdef __cplusplus extern "C" { # endif C++ stuff # ifdef __cplusplus } # endif It's in the Cocoa Dev archives (probably a subject search containing "C++"). Cheers, -H. On 03/04/2008, Paul Thomas <[EMAIL PROTECTED]> wrote: > > On 3 Apr 2008, at 13:48, Brad Peterson wrote: > > > > Hi, > >

Re: Southern California Coders?

2008-04-03 Thread Kenny Leung
At one point, a fair number of San Diego folks drove up for the Lake Forest meetings. The drive got to them about a year ago, and I have not heard whether they have started their own group. It's definitely pretty lonely being a Cocoa developer in San Diego. I would like to help start a gr

Re: Cocoa-dev Digest, Vol 5, Issue 533

2008-04-03 Thread Michael Ash
On Thu, Apr 3, 2008 at 10:08 AM, Daniel Child <[EMAIL PROTECTED]> wrote: > I thought #import would take care of the possibility of duplication. Are > you suggesting I need to separate the declaration of the function from the > implementation, placing the implementation into a different file? Then

Re: More fun with C++

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 9:05 AM, Herb Petschauer wrote: # ifdef __cplusplus extern "C" { # endif That won't help if the header is using C++-only syntax like namespaces and classes. You just can't #include that stuff from a C or Obj-C source file. —Jens smime.p7s Description: S/MIME cryptogr

Re: More fun with C++

2008-04-03 Thread Herb Petschauer
You know I actually gave the wrong example there :-) It's not the extern "C" it is just the #ifdef __cplusplus C++ stuff #endif I do this all the time (honest). This will compile when included from a ".m" file because _cplusplus won't be defined. Hopefully I've got it right this time (post

Objective-C Instance Variable Names

2008-04-03 Thread Richard Somers
There is a common practice of prefixing instance variable names with "_", a single underscore character. If Objective-C 2.0 properties are used this would result in dots followed by underscores when invoking accessor methods with the dot syntax. Not a desirable situation. It appears that

Re: Objective-C Instance Variable Names

2008-04-03 Thread Clark Cox
On Thu, Apr 3, 2008 at 9:29 AM, Richard Somers <[EMAIL PROTECTED]> wrote: > There is a common practice of prefixing instance variable names with "_", a > single underscore character. > > If Objective-C 2.0 properties are used this would result in dots followed > by underscores when invoking access

Re: Objective-C Instance Variable Names

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 9:29 AM, Richard Somers wrote: There is a common practice of prefixing instance variable names with "_", a single underscore character. And it's a very good idea to do so, IMHO. (The exact prefix isn't important, just as long as it's easy to distinguish ivars from local

Re: More fun with C++

2008-04-03 Thread Jean-Daniel Dupas
No but you include it in a Obj-C++ source file. Rename your obj-c file with a .mm extension. Le 3 avr. 08 à 18:23, Jens Alfke a écrit : On 3 Apr '08, at 9:05 AM, Herb Petschauer wrote: # ifdef __cplusplus extern "C" { # endif That won't help if the header is using C++-only syntax like

Re: More fun with C++

2008-04-03 Thread Herb Petschauer
There are some hits to using .mm rather than .m files (check the list archives). Nothing major enough to sound any dire warnings though ;-) And sometimes you are adding C++ to an existing Obj-C only project (and I hate renaming every .m file to a .mm file in version control plus the potential los

Bindings on Contextual Menu Items when to unbind:

2008-04-03 Thread Ben Lachman
I have a few contextual menus that have items that are generated dynamically and are bound in code to my model. I'm not sure if/when I should unbind them however. Is there a good place to do this? Do I even need to? Thanks, ->Ben -- Ben Lachman Acacia Tree Software http://acaciatreesoft

Re: [NSPipe pipe] returning nil (running out of filehandles?)

2008-04-03 Thread Martin Redington
Just thought I'd add some hard numbers to this thread. My original fixed NSTask based implementation ran in 8 minutes. Using the code below, with a 1k buffer size, runs in 6:15 minutes, so the speedup is about 25%. A 10k buffer took about the same. Boosting the buffer to 1MB actually ran

Re: Propagate changes/insertions in main context

2008-04-03 Thread Ben Lachman
There was quite an extensive conversation about this a couple days ago. Try to check the archives before posting... and following ->Ben -- Ben Lachman Acacia Tree Software http://acaciatreesoftware.com [EMAIL PROTECTED]

Re: 1 pixel bordered CALayer renders improperly

2008-04-03 Thread David Duncan
On Apr 2, 2008, at 10:26 PM, Martin wrote: It seems that a CALayer with a borderWidth of 1.0 renders improperly: all the border's pixels are good except the very top right pixel which has a different colour. Example: http://img34.picoodle.com/img/img34/4/4/2/f_CALayerm_6e43e20.png Is this

Why is actually kAuthorizationEnvironmentIcon often not working for 10.4?

2008-04-03 Thread Markus Hanauska
Hi everyone! Has anyone here ever found out why kAuthorizationEnvironmentIcon for authorization requests sometimes works and sometimes not? It's not the image format or anything. I thought it has to do with whether the path has spaces inside or not, but that's not it either. It seems to

Re: Read jpeg comments from file?

2008-04-03 Thread Trygve Inda
> On Apr 3, 2008, at 2:13 AM, Trygve Inda wrote: >>> If you just need to display the image, use an NSImage >>> (initWithContentsOfFile). >>> If you need a greater control over metadata, use the ImageIO API >>> (search CGImageSource in doc and sample codes). >> >> This works and retrieves the user

Re: Objective-C Instance Variable Names

2008-04-03 Thread Rob Napier
On Thu, Apr 3, 2008 at 12:45 PM, Jens Alfke <[EMAIL PROTECTED]> wrote: > > On 3 Apr '08, at 9:29 AM, Richard Somers wrote: > > There is a common practice of prefixing instance variable names with "_", > > a single underscore character. > > > > And it's a very good idea to do so, IMHO. (The exact

Re: Objective-C Instance Variable Names

2008-04-03 Thread Robert Claeson
On 3 Apr 2008, at 19:58, Rob Napier wrote: 2. Leading "m" makes you look like a C++ programmer and other ObjC programmers will laugh at you. You can take that for what it's worth, but it's worth keeping in mind if you're going to work on large projects with other programmers. "Other ObjC pr

Re: Objective-C Instance Variable Names

2008-04-03 Thread John Stiles
I'd never heard the Smalltalk conventions before, but I have to admit I really like the sound of them. I'd love to see a block of code written to these rules to see how it plays out in practice. (ObjC or C++, that is, not Smalltalk.) Robert Claeson wrote: On 3 Apr 2008, at 19:58, Rob Napier

Need Mac Developers

2008-04-03 Thread Kristan Kennedy
I desperately need to hire two Mid-Level Mac/Cocoa Developers...how should I go about tapping your resources...do I need to join to access some good resumes? Kristan Kennedy Manager/Technical/Marketing Talent Jivaro Professional Headhunters Southern California Division 310.649.2640 x 121 [EMA

Re: Objective-C Instance Variable Names

2008-04-03 Thread Hamish Allan
On Thu, Apr 3, 2008 at 7:08 PM, Robert Claeson <[EMAIL PROTECTED]> wrote: > C. Instance variables are usually named like "theName", "theAddress" or > something else that makes sense if there's the risk of mixup between ivars > and locals. Myself I use "myName" for instance variables and "theName

Re: Objective-C Instance Variable Names

2008-04-03 Thread glenn andreas
On Apr 3, 2008, at 1:29 PM, Hamish Allan wrote: On Thu, Apr 3, 2008 at 7:08 PM, Robert Claeson <[EMAIL PROTECTED] > wrote: C. Instance variables are usually named like "theName", "theAddress" or something else that makes sense if there's the risk of mixup between ivars and locals. Myse

desktop access

2008-04-03 Thread ilteris kaplan
Hello all, I was checking out this smart application from Troika. http://www.troika.uk.com/virus.htm Basically if you watch the video you will see that the software plays with the elements on users screen according to accelerometer using some physics. I am wondering if we have an access to

NSPopupButton Cell in NSTableView

2008-04-03 Thread Thomas Bartelmess
Hello CocoaDev Subscribers! I've spent a lot of time to find out to add a collum with NSPopupButtons, but it wasn't able to do this. Can PLEASE anyone help me? Thanks a lot Thomas __ Gesendet von Yahoo! Mail. Dem pfiffigeren

-[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread Jonathan del Strother
I have a CVPixelBufferRef, with a 2vuy pixel format. I'd like to display it in a CALayer. CALayer says that 'contents' is "typically a CGImageRef, but may be something else". I (optimistically) tried assigning the CVPixelBufferRef directly to the contents, but apparently that's not included in t

Re: Objective-C Instance Variable Names

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 10:58 AM, Rob Napier wrote: Apple reserves the use of leading underscores for it's own use: While they append the phrase "especially in methods," they do mean for everything, and you can collide with them if you name your own identifiers (including instance variables) with

Re: Problem with setting color in NSBitmapImageRep

2008-04-03 Thread Christian Kaiser
Thank to all those who tried to help me with my problem. My gradient color problem is just a simplified version of what I have to do. I need to do a scientific simulation where I have to set the color of random pixels to a given color which corresponds to a value inside a given range. So I rea

Re: desktop access

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 11:59 AM, ilteris kaplan wrote: Basically if you watch the video you will see that the software plays with the elements on users screen according to accelerometer using some physics. I am wondering if we have an access to the desktop just like that. I am curious to learn h

Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread David Duncan
On Apr 3, 2008, at 11:34 AM, Jonathan del Strother wrote: CALayer says that 'contents' is "typically a CGImageRef, but may be something else". I (optimistically) tried assigning the CVPixelBufferRef directly to the contents, but apparently that's not included in the mysterious 'something else'

Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread Jonathan del Strother
On Thu, Apr 3, 2008 at 8:23 PM, David Duncan <[EMAIL PROTECTED]> wrote: > On Apr 3, 2008, at 11:34 AM, Jonathan del Strother wrote: > > > > CALayer says that 'contents' is "typically a CGImageRef, but may be > > something else". I (optimistically) tried assigning the > > CVPixelBufferRef directly

WebDav Client Libraries in Cocoa

2008-04-03 Thread JanakiRam
Hi All, I'm porting a windows based application to Mac. My windows application makes webdav calls to the server to retrieve the information. Now i need to make similar calls from Cocoa Application. Are there any WEBDAV Client libraries available for Cocoa. If so please let me know t

Need some help

2008-04-03 Thread Christy Hoffman
I am a staffing manager in the Boston MA area. I am currently working on a 6 month contract in the Cambridge MA area. The client will hire off the phone and is looking for someone to start April 14th. Please let me know who you know that may be interested. Contact me at 781-530-3088 or [EMAIL P

Re: WebDav Client Libraries in Cocoa

2008-04-03 Thread Patrick Burleson
On Thu, Apr 3, 2008 at 2:32 PM, JanakiRam <[EMAIL PROTECTED]> wrote: > > Does SVNX Client application also uses WEBDAV protocol to retrieve > the > repository details ? > I believe SVNX is calling the svn executable directly and parsing the output. It's not actually linked against the subvers

Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread David Duncan
On Apr 3, 2008, at 12:28 PM, Jonathan del Strother wrote: If you have a CVPixelBufferRef, you can use the various functions defined for a CVPixelBuffer to access the base address, row bytes, width, height and other attributes to create a CGImageRef directly from it via CGImageCreate(). Even

Re: NSAssert and Unused Variable

2008-04-03 Thread Richard Somers
On Apr 2, 2008, at 7:34PM, Chris Suter wrote: int var __attribute__((__unused__)); Or use the following short cut found in cdefs.h. #define __unused __attribute__((__unused__)) Which would make my example look like this which seems to work well. int __unused error = foo(); NSAs

Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread Jonathan del Strother
On Thu, Apr 3, 2008 at 8:38 PM, David Duncan <[EMAIL PROTECTED]> wrote: > On Apr 3, 2008, at 12:28 PM, Jonathan del Strother wrote: > > > > > > If you have a CVPixelBufferRef, you can use the various functions > defined > > > for a CVPixelBuffer to access the base address, row bytes, width, height

how to hack my own apps

2008-04-03 Thread justin webster
just wondering how easy it is for would-be hackers to get inside my code. how meaningful and human-readable is a reverse engineered version of my app? is there a particular tool a hacker would use for Mac apps? any help much appreciated, justin ___

Re: -[CALayer setContents: cvPixelBufferRef ] ?

2008-04-03 Thread David Duncan
On Apr 3, 2008, at 1:00 PM, Jonathan del Strother wrote: I'm using the QTCapture api to record from a camera, while displaying a live preview (ideally with 0 lag) in Core Animation. The QTCaptureLayer doesn't do what you want? -- David Duncan Apple DTS Animation and Printing [EMAIL PROTECTED]

Re: WebDav Client Libraries in Cocoa

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 12:32 PM, JanakiRam wrote: I'm porting a windows based application to Mac. My windows application makes webdav calls to the server to retrieve the information. Now i need to make similar calls from Cocoa Application. Is the WebDAV library used by the Windows version

Re: how to hack my own apps

2008-04-03 Thread Nick Zitzmann
On Apr 3, 2008, at 3:06 PM, justin webster wrote: just wondering how easy it is for would-be hackers to get inside my code. It depends. For 32-bit apps, it's trivial for someone to inject code using an input manager or something. For 64-bit apps, I don't think that's been done yet, but it

Re: how to hack my own apps

2008-04-03 Thread John Stiles
I'm not a hacker, but if I had to figure out how a Cocoa app worked in a hurry, I'd check out F-Script Anywhere. justin webster wrote: just wondering how easy it is for would-be hackers to get inside my code. how meaningful and human-readable is a reverse engineered version of my app? is the

Re: how to hack my own apps

2008-04-03 Thread Rob Napier
On Thu, Apr 3, 2008 at 5:06 PM, justin webster <[EMAIL PROTECTED]> wrote: > just wondering how easy it is for would-be hackers to get inside my code. > how meaningful and human-readable is a reverse engineered version of my > app? > is there a particular tool a hacker would use for Mac apps? > > a

Re: WebDav Client Libraries in Cocoa

2008-04-03 Thread Nick Zitzmann
On Apr 3, 2008, at 1:32 PM, JanakiRam wrote: Are there any WEBDAV Client libraries available for Cocoa. If so please let me know the available libraries and recommended one among them on Tiger as well as on Leopard. Try searching around for "ConnectionKit"... I think that's what it's

Re: Bindings on Contextual Menu Items when to unbind:

2008-04-03 Thread Ben Lachman
After thinking about this a bit more I think the proper response to my message was/is: Why the heck are you using bindings in a *contextual* menu? Since bindings are used to keep things (Model/View) in sync, using them in a context menu, which is kind of by definition representative of a t

Basic XPath Question

2008-04-03 Thread Mac QA
Hi, I am trying to use the nodesForXPath:error: API to search an XML document and find particular nodes. For example, my document has multiple entries for various hosts that look something like this: So I want to craft an XPath to search the

Re: how to hack my own apps

2008-04-03 Thread glenn andreas
On Apr 3, 2008, at 3:17 PM, Nick Zitzmann wrote: On Apr 3, 2008, at 3:06 PM, justin webster wrote: just wondering how easy it is for would-be hackers to get inside my code. It depends. For 32-bit apps, it's trivial for someone to inject code using an input manager or something. For 64-bi

Re: Basic XPath Question

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 1:40 PM, Mac QA wrote: Does the nodesForXPath:error: API in Cocoa just not support the features of XPath for matching nodes with specific attribute values? Or am I just doing something totally wrong? Any suggestions or pointers to examples would be greatly appreciated. Thanks!

Re: scrollRangeToVisible from within mouseDown causing crash?

2008-04-03 Thread Martin Wierschin
Hi Ben, 1) I had a bug in my selection constraining code that in a few odd places subtract a larger number from a smaller number when creating a range, thus creating a range with a really really big length-- close to UINT_MAX. ... Anyway, I would have never run up against this if my code wa

Re: More fun with C++

2008-04-03 Thread Scott Ribe
> #ifdef __cplusplus > > C++ stuff > > #endif As long as you don't need to reference the C++ stuff from a .m file. But then, should the header even be included by any .m files? Sure, there are times when C++ and non-C++ stuff might belong together in a header, but most of the time my C++ headers

Re: Need Mac Developers

2008-04-03 Thread John C. Randolph
On Apr 3, 2008, at 11:19 AM, Kristan Kennedy wrote: I desperately need to hire two Mid-Level Mac/Cocoa Developers. Cocoa-dev is a technical discussion list. If you have a job opening, then post a description of the position, and include [JOB] in the title. If anyone's interested, they'll

Re: Need for a creator code?

2008-04-03 Thread Scott Ribe
> But having an app explicitly > and automatically mark documents it saves as opening in itself can get > frustrating for the user. How so? It seems the most reasonable default. I really don't see end users saving a file from one app, and expecting it to automatically open with a different app. In

Re: Resorting normal field editor behaviour

2008-04-03 Thread K. Darcy Otto
Thank you very much; this is exactly the solution. Just for others who might have this problem, here is how i solved it: 1. Set up a NSText variable globally: NSText *fieldEd 2. Implement controlTextDidBeginEditing: as below: -(void)controlTextDidBeginEditing:(NSNotification *)notification {

Re: duplicate symbol error

2008-04-03 Thread Daniel Child
Thanks. Separating the header and implementation solved the linking error, and that should hopefully cure me of the sloppy habit of stuffing functions into a header. I'm not sure the differences between reported errors in Xcode 3 and 2.4 are not worth tracking down, because they are conside

Re: More fun with C++

2008-04-03 Thread Herb Petschauer
Ah, we can easily go to the loony bin with this one. You have to start doing: typedef struct Foo { Byte a; } Foo; #ifdef __cplusplus class Bar { private: Foo mFoo; }; #endif or just refactor your code and (in this case) add a ProjectTypes.h which contains common structures and types (common

Autorelease question

2008-04-03 Thread Dmitry Markman
Hi How can I tell that default autorelease pool exists? here is why I ask Aaron Hillehass in his book, said that if object wasn't created with alloc, new, copy or mutableCopy then that object will be added to the default autorelease pool and indeed, in the simple guiless Cocoa application if I t

Re: Autorelease question

2008-04-03 Thread Robert Claeson
On 4 Apr 2008, at 02:03, Dmitry Markman wrote: Hi How can I tell that default autorelease pool exists? Dmitry The default autorelease pool is created in the .m file of a newly created project. If you have messed around too much with that file, you might have deleted it. The interesting

Re: Autorelease question

2008-04-03 Thread Hamish Allan
On Fri, Apr 4, 2008 at 1:03 AM, Dmitry Markman <[EMAIL PROTECTED]> wrote: > but from other hand in the complex Carbon application, where I never > explicitly created NSAutoreleasePool object > I can call > NSString *textString = [NSString stringWithCString:"Hello From > Cocoa" encodi

Re: Modify Input in NSTableView

2008-04-03 Thread K. Darcy Otto
See the following for the solution: http://www.cocoabuilder.com/archive/message/cocoa/2008/4/4/203185 On 31-Mar-08, at 5:18 PM, K. Darcy Otto wrote: Closing in on a solution (but not quite there): I have made some progress in solving this problem, but still have one strangeness (detailed be

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
Hi, Robert thanks for your answer our project never had that file as matter of fact project in question doesn't have any .m files at all (we just compile file with the Cocoa code with -x objective-c++ compiler flag) thanks dm On Apr 3, 2008, at 8:07 PM, Robert Claeson wrote: On 4 Apr

NSAutoreleasePool causes crashes when empty?

2008-04-03 Thread Kevin Dixon
I have a method in my class that's a thread entry point, using detachNewThreadSelector. According to the docs, I create an NSAutoreleasePool and release it at the end of the thread's life (right before [NSThread exit]. The thread calls a single routine from another class. Sometimes this routine ab

Re: NSAutoreleasePool causes crashes when empty?

2008-04-03 Thread John Stiles
I'd suspect some sort of error in your app, e.g. perhaps "pool" itself has never been alloc/inited and contains garbage. [pool release] on a valid but empty NSAutoreleasePool is perfectly harmless. Kevin Dixon wrote: I have a method in my class that's a thread entry point, using detachNewThrea

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
Hi, Hamish or yes I'm pretty sure I can see result on the screen code in question is called from the mac os x bundle neither bundle project nor project of the main application have any NSAutoreleasePool creation in fact there is only one file that include On Apr 3, 2008, at 8:19 PM, Hamish All

Re: Autorelease question

2008-04-03 Thread Jens Alfke
On 3 Apr '08, at 5:07 PM, Robert Claeson wrote: The default autorelease pool is created in the .m file of a newly created project. If you have messed around too much with that file, you might have deleted it. There's not a "default" autorelease pool. They form a stack, and get pushed and

Re: Autorelease question

2008-04-03 Thread Chris Suter
On 04/04/2008, at 11:47 AM, Jens Alfke wrote: It's true that the very outermost pool on the main thread is created in main(); I don't think that's normally the case. For a Cocoa application created by the Xcode template, it won't create an autorelease pool for you. Obviously, there won't

NSCondition easter-egg hunt

2008-04-03 Thread Jack Repenning
So, what's the scoop on NSCondition? Can someone lead me out of the woods? I can't formulate a coherent question, only a list of bits of documentation which appear to me to contradict each other every way from Sunday. Am I misreading something, or are some few of these wrong? (1) When di

Re: Autorelease question

2008-04-03 Thread Adam Leonard
Hi, This is all explained for you here: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/AutoreleasePools.html and here: http://developer.apple.com/documentation/Cocoa/Conceptual/CarbonCocoaDoc/Articles/WrapperFunctions.html#/ /apple_ref/doc/uid/20002398-TP1 To sum

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
thanks a lot for the answer, Jens but that how my problem began :-) from creating my own NSAutoreleasePool here is my code NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncod

Re: Autorelease question

2008-04-03 Thread Chris Suter
On 04/04/2008, at 12:45 PM, Dmitry Markman wrote: thanks a lot for the answer, Jens but that how my problem began :-) from creating my own NSAutoreleasePool here is my code [snip] You're releasing things you shouldn't be. Take some time to read the memory management documentation. - Chr

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
Just addition to the previous email On Apr 3, 2008, at 9:45 PM, Dmitry Markman wrote: [stringAttributes release]; [font release]; [cocoaColor release]; [context release]; [textString release]; [nsFontName release]; [pool release]; if I comme

Re: NSAutoreleasePool causes crashes when empty?

2008-04-03 Thread Kevin Dixon
Here's the contents of my thread's routine { NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; mEngine->Destretch(mAudioFileList, [uiOutputDirectory stringValue], smpteIndex); [pool release]; [NSThread exit]; } In ->Destretch the only real allocation of Cocoa stuff is this NSURL * ur

Re: Autorelease question

2008-04-03 Thread Rob Keniger
On 04/04/2008, at 11:54 AM, Dmitry Markman wrote: if I comment all those releases (excerpt [pool release]) then application won't crash That's because all the methods you use to create the objects return autoreleased objects which don't need to be released manually. that probably means th

Re: NSCondition easter-egg hunt

2008-04-03 Thread Adam R. Maxwell
On Thursday, April 03, 2008, at 06:15PM, "Jack Repenning" <[EMAIL PROTECTED]> wrote: >So, what's the scoop on NSCondition? Can someone lead me out of the >woods? I can't formulate a coherent question, only a list of bits of >documentation which appear to me to contradict each other every w

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
On Apr 3, 2008, at 9:52 PM, Chris Suter wrote: You're releasing things you shouldn't be. Take some time to read the memory management documentation. well, exactly so here is what I have NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncod

Re: Autorelease question

2008-04-03 Thread stephen joseph butler
On Thu, Apr 3, 2008 at 9:18 PM, Dmitry Markman <[EMAIL PROTECTED]> wrote: > I just thought that all those 5 methods are CREATION methods they are not > GET methods > so how do I know which one I should release? You're way over analyzing this. Does the *method name* contain the words alloc, new,

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
why do you think I didn't read all of that documentation? I did but, alas, maybe I'm not smart enough and I can't tell which object is autoreleased and which one not that was in principle my initial question looking at the retainCount property won't tell you about was object autoreleased or not

Re: Autorelease question

2008-04-03 Thread Dmitry Markman
thanks as Adam Leonard said ([EMAIL PROTECTED]) (BTW in reply to my note) Also, a small note: Aaron Hillehass in his book, said that if object wasn't created with alloc, new, copy or mutableCopy then that object will be added to the default autorelease pool Reread that sentence in Hille

Re: Autorelease question

2008-04-03 Thread Chris Suter
On 04/04/2008, at 1:25 PM, Dmitry Markman wrote: how can you explain that NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncoding]; can be released, but NSString *textString = [NSString stringWithCString:"Hello From Cocoa" encoding:NS

Re: Autorelease question

2008-04-03 Thread Adam Leonard
You quoted the key memory management rule yourself from Hillegass's book :) You are making this too complicated. Just read this: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html#/ /apple_ref/doc/uid/2994 There are virtually no exceptio

Re: NSCondition easter-egg hunt

2008-04-03 Thread Ken Thomases
On Apr 3, 2008, at 8:14 PM, Jack Repenning wrote: So, what's the scoop on NSCondition? Can someone lead me out of the woods? I can't formulate a coherent question, only a list of bits of documentation which appear to me to contradict each other every way from Sunday. Am I misreading somet

Re: Autorelease question

2008-04-03 Thread Dave Hersey
why do you think I didn't read all of that documentation? I did but, alas, maybe I'm not smart enough and I can't tell which object is autoreleased and which one not that was in principle my initial question I doubt that it's that you're not smart enough. At the very least, you need to read

Re: Autorelease question

2008-04-03 Thread Rohan Lloyd
On 4 Apr 2008, at 1:32 PM, Chris Suter wrote: On 04/04/2008, at 1:25 PM, Dmitry Markman wrote: how can you explain that NSString *nsFontName = [NSString stringWithCString:fontName encoding:NSMacOSRomanStringEncoding]; can be released, but NSString *textString = [NSString stri

  1   2   >