Re: Questions regarding release

2019-09-28 Thread Wim Lewis via Cocoa-dev
On Sep 2'6, 2019, at 9:47 AM, Gabr'iel Zachmann via Cocoa-dev wrote: >> >> I don’t believe that’s entirely true. “make” methods return a +0 value. >> >> The issue in the below code to my eye is that you allocate a path with >> CGPathCreateWithRect (+1) but then don't release it. >> > > In

Re: Questions regarding release

2019-09-25 Thread Wim Lewis via Cocoa-dev
On Sep 25, 2019, at 12:31 PM, Gabriel Zachmann via Cocoa-dev wrote: > The doc for CGImageSourceCreateImageAtIndex() that I need to release imageRef > myself. > Is it safe to do it after assigning the nsimage to the layer, but before > deleting the layer? Yes, the NSImage will retain/release

Re: Silly question on extending NSObject.

2019-02-19 Thread Wim Lewis
On 19. feb. 2019, at 1:23 e.h., Alex Zavatone wrote: > In most Objective-C projects I add an autodescribe category on NSObject and > put the import for the category header into a .pch for the project so that it > will be available for every class in the project. > > This lets me dump an object’

Re: Data, enumerateBytes: separate blocks?

2018-01-08 Thread Wim Lewis
On 22. des. 2017, at 8:48 f.h., Daryle Walker wrote: > I already have the code as an extension of Data. In C, we can use pointer > type-punning shenanigans to convert between a dispatch_data_t and NSData*. To > trigger this code in a test that I would write in Swift, DispatchData would > need

Re: Data, enumerateBytes: separate blocks?

2017-11-28 Thread Wim Lewis
On 27. nóv. 2017, at 10:51 e.h., Quincey Morris wrote: > On Nov 27, 2017, at 22:36 , Daryle Walker wrote: >> >> Is there a way to make a (NS)Data that uses multiple contiguous blocks? > > You mean multiple *non-contiguous* blocks?? > > The only way I know of forcing Data to use multiple bloc

Re: -forceCancel an NSOperation

2017-03-01 Thread Wim Lewis
On Mar 1, 2017, at 2:23 PM, Carl Hoefs wrote: > Normally, that is sufficient. But under some circumstances, it's possible for > an executing NSOperation to get hung up doing I/O or for some other reason. > No means is given to forcibly stop the execution of an NSOperation, and > there's no -th

Re: Swift DispatchQueue docs?

2016-11-21 Thread Wim Lewis
On Nov 21, 2016, at 1:48 PM, Rick Mann wrote: > Is there a way to look at the C header files for GCD? I tried opening > Dispatch.h, and Xcode is stuck "Generating Interface…", presumably a Swift > interface I don't want to see. I've found that if I tell Xcode to open Foo.h, and Xcode gets stuc

Re: Stupid objective-c question

2016-09-21 Thread Wim Lewis
On Sep 21, 2016, at 7:00 PM, Doug Hill wrote: > As to the context type, I would be interested to know of cases where the > observer doesn't have control over the context. My understanding is that the > context is something that the observer sets itself when calling addObserver, > and it is pass

Re: Does setFormatter() retain?

2016-08-24 Thread Wim Lewis
On Aug 24, 2016, at 1:04 PM, Andreas Falkenhahn wrote: > I have read Apple's memory management guide on retain/release and > I think I've basically got it, but there's just one thing that > I'm not confident about and that is "setXXX" methods which accept an > NSObject parameter and I don't know

Re: Using va_list to build a formatted string

2016-06-29 Thread Wim Lewis
On Jun 29, 2016, at 7:38 PM, Graham Cox wrote: > va_list argsP; > va_start( argsP, format ); > > logString = [NSString stringWithFormat:format, argsP]; You need to use -stringWithFormat:arguments: here, since you're passing in a va_list of arguments.

Re: NSURLErrorKey vs. NSURLErrorFailingURLErrorKey

2016-04-06 Thread Wim Lewis
On Feb 26, 2016, at 6:12 PM, Jens Alfke wrote: > On Feb 26, 2016, at 4:48 PM, Quincey Morris > wrote: >> >> According to NSError documentation: > > Thanks, but I did read the documentation before asking. I think Quincey Morris' summary is accurate - at least, it matches my understanding - a

Re: Using CFHash to tell if a CFTypeRef has changed?

2016-01-11 Thread Wim Lewis
On Jan 11, 2016, at 10:18 AM, Dave wrote: > It’s actually an NSInteger so it’s 64 bits isn’t it? But I take your point, > the hash isn’t going to change. > > Any one have any other techniques for telling if a CFTypeRef has changed? Does CFEqual() do what you need? It depends a lot on what you

Re: Question about getBytes:length:

2015-11-24 Thread Wim Lewis
On Nov 23, 2015, at 8:57 PM, Charles Srstka wrote: > Is there a possible typo here? It looks like you’re reading in 16 *bytes* of > data, and then comparing it against an integer that is 16 *bits* in size. Is > that what you meant to do? Bluetooth has a number of "short form" UUIDs where most

Re: CGContextShowTextAtPoint

2015-10-13 Thread Wim Lewis
On Oct 13, 2015, at 3:02 PM, Raglan T. Tiger wrote: > CGContextShowTextAtPoint (ctx, pt.x,pt.y,(const char*)txt, len ); > > This has printed my text UNTIL 10.11. > > I see that CGContextShowTextAtPoint is deprecated in 10.9 ... is it gone in > 10.11? As Quincey Morris says, Core Text is the r

Re: AfxIsValidAddress

2015-07-14 Thread Wim Lewis
ase is crash and send a crashdump to the developer so that it can be fixed. If you don't know (with enough certainty to omit a call to IsValidAddress) whether a pointer is readable, you certainly don't know whether the data there is what you expect to be there

Re: Finding the use of a private API

2015-03-16 Thread Wim Lewis
On Mar 16, 2015, at 4:20 PM, Wim Lewis wrote: > You can use the -o option to include the object filename on each line instead > of just once before each group of symbols. (To clarify, this is if you’re looking at a static lib, not at a fully linke

Re: Finding the use of a private API

2015-03-16 Thread Wim Lewis
On Mar 16, 2015, at 4:12 PM, Rick Mann wrote: > $ nm -u MyApp | grep dsyrk > _dsyrk_ > _dsyrk_ > > These are the undefined symbols (that is, symbols provided outside my binary. > > There's no other information there I see to help me identify where it's being > called. Ah, that’s because it’s

Re: Finding the use of a private API

2015-03-16 Thread Wim Lewis
On Mar 16, 2015, at 3:26 PM, Rick Mann wrote: > Further, how do I see what undefined symbols exist in a .a file? nm doesn't > seem to work for those. nm works for me on static libraries (.a ‘ar’ archives). It just iterates over all the objects in the library and nm’s each one after printing th

Re: Beep ( frequency, duration)

2014-12-29 Thread Wim Lewis
On Dec 29, 2014, at 2:12 AM, Michael Crawford wrote: >for ( int i = 0; i < inNumberFrames; ++i ){ > *sample++ = sin( twoPi * ( now / 100.0 ) ); > now += 1.0; >} Depending on what your overall goal is, it might be easier to use the software MIDI synthesizer instead of comput

Re: WTF is happening?

2014-12-15 Thread Wim Lewis
On Dec 13, 2014, at 11:06 AM, Maxthon Chan wrote: > What I am doing here is scanning all loaded classes for subclasses of a > certain class. Before any NSObject method can be issued I have to check if it > is actually NSObject or NSProxy derivative instead of an Object derivative > that does n

Re: NSImage glowing

2014-11-05 Thread Wim Lewis
On Nov 5, 2014, at 3:43 PM, Alex Kac wrote: > BUT, in this case I’m just trying to get the glow on selected images, so when > I look at the code below all I see is that we’re getting the bitmap and > drawing it. I’m not understanding how that gets a glow. It’s applied by NSButtonCell, which k

Re: Serializing NSDictionary for network transfer

2014-05-07 Thread Wim Lewis
On 7 May 2014, at 11:17 AM, Carl Hoefs wrote: > Newb questions re: serializing an NSDictionary for network transfer to > another process. I've read over the Apple documentation, but it seems to > detail the methods involved but not how to use serialization, and some > methods seem to require wr

cocoa-dev@lists.apple.com

2014-03-25 Thread Wim Lewis
On 25 Mar 2014, at 11:12 AM, Jens Alfke wrote: > I agree — it seems like the 32-bit equivalent of the more common mistake of > accepting an input blob containing text without first checking that it’s > valid UTF-8. I did that once, and after debugging the resulting file > corruption bug I made

Re: Decoding images in PDF files

2013-08-26 Thread Wim Lewis
On 26 Aug 2013, at 10:49 AM, Graham Cox wrote: > I'm working on a parser that needs to be able to extract graphics from PDF > files. So far, I'm making good headway with the CGPDFxxx functions. > > I have a question about extracting embedded bitmap images. When I encounter > an XObject stream w

Re: Fastest way to replace characters in string

2013-08-21 Thread Wim Lewis
On 21 Aug 2013, at 4:44 PM, Diederik Meijer | Ten Horses wrote: > The web service returns the list lightning fast, but in order to get the > count number added to each of the >300 articles html header, I am > looping through the list and call NSString's > stringByReplacingOccurancesOfString:wi

Re: Core Data Reverse Engineering KickStarter Project

2013-06-25 Thread Wim Lewis
On 25 Jun 2013, at 7:44 AM, Steve Sisak wrote: > The safest thing to would probably to be to implement a Core Data "workalike" > with a documented database schema and possibly an importer for "real" code > data files. FWIW, Omni's open-source data objects framework was our response to our dif

Re: Determine load path of linked framework at runtime

2013-06-05 Thread Wim Lewis
On 5 Jun 2013, at 3:59 PM, Graham Cox wrote: > Hi all, > > Is there a way to discover the load path of a framework at runtime? > > I have an odd situation where a framework which is bundled within my app is > being overridden by an older copy on a user's machine. They've tried looking > in all

Re: CoreText and a trailing space

2013-04-09 Thread Wim Lewis
On 9 Apr 2013, at 7:04 PM, Roland King wrote: > I have an attributed string I'm laying out with a CTFrame. The string can > have a trailing space in it, possibly more than one, they are actually > \u3000, IDEOGRAPHIC SPACE. I need them to be treated like a real character > and laid out, even if

Re: Another Gnarly Objective-C Question!

2013-03-12 Thread Wim Lewis
On 12 Mar 2013, at 2:08 AM, Graham Cox wrote: > in a + method, [self class] === self. Once you've got that, you've got it. > > > > You're overthinking this. > > A class method is just an instance method of the class object. No magic at > all. So all this confusion you've caused yourself about

Re: getting ivar of fundamental types with object_getInstanceValue

2013-03-04 Thread Wim Lewis
On 4 Mar 2013, at 6:23 PM, Ignacio Enriquez wrote: > I am trying to understand the correct usage and caveats, of > object_setInstanceValue function from objc/objc-runtime.h. > [] > An old post in this list (Re: ivars and fundamental types - > http://lists.apple.com/archives/cocoa-dev/2010/Oc

Re: Dynamic Creation

2013-02-18 Thread Wim Lewis
On 18 Feb 2013, at 1:17 AM, Christ Levesque wrote: > Ability to create instances of classes that did not exist at the time an app > was compiled and dynamically load and link new class at runtime. > How to implement it? NSBundle is the Cocoa way to deal with loading new code at runtime (plugins

Re: Harnessing Perl Scripts within a Project

2012-11-05 Thread Wim Lewis
On 5 Nov 2012, at 2:59 PM, John Delacour wrote: > [] hearing all the whoops and applause as the most elementary new things > were unveiled and it was announced that a dictionary object could now finally > be built in something approaching the sane way it would be done in ancient > languages

Re: Harnessing Perl Scripts within a Project

2012-11-05 Thread Wim Lewis
On 4 Nov 2012, at 1:03 AM, John Delacour wrote: > Perl is another matter altogether. While I am getting up to speed with Obj-C > I would like to be able to include Perl routines within projects, and I can > find very little on the WWW to be guided by. So far I have experimented > simply with

Re: a way to clear inactive RAM

2012-11-05 Thread Wim Lewis
On 5 Nov 2012, at 10:54 AM, Nick Rogers wrote: > I am assigned this small utility which should clear inactive RAM. > I know Mac OS X manages memory quite efficiently and inactive RAM also has a > purpose. > But I have to make this. What are you trying to achieve? What exactly do you mean by "in

Re: Clear NSPanel & View Shadow

2012-10-22 Thread Wim Lewis
On 22 Oct 2012, at 12:07 PM, Jean Suisse wrote: > The issue: > If the NSPanel opens with theView visible, when hiding it, theView's shadow > remains. > If the NSPanel opens with theView hidden, when displaying theView, theView > doesn't get a shadow. > > It seems that the shadow for the panel

Re: NSTask and NSPipe has buffering issues?

2012-07-31 Thread Wim Lewis
On 31 Jul 2012, at 3:33 PM, Mr. Gecko wrote: > I am having weird results with NSTask. It sometimes retrieves the output, and > other times receives nothing. I haven't looked at the code you posted, but is it possible that you're reading from the NSPipe in such a way that you're mixing up the "e

Re: When does NSInputStream's -getBuffer:length: actually work?

2012-07-25 Thread Wim Lewis
On 25 Jul 2012, at 10:08 AM, Jens Alfke wrote: > NSInputStream has a -getBuffer:length: method that lets you get the available > data from the stream without copying. This is great for performance, and I've > written my client code to take advantage of it if it's supported, but every > time I'v

Re: String Encoding

2012-06-12 Thread Wim Lewis
On 12 Jun 2012, at 12:42 PM, koko wrote: > I have international users who may have things like umlaut in file names / > paths which I may get as CStrings given our Model. > > What NS string encoding should be used to preserve the umlaut and not crash? > Is NSUTF8 OK? UTF-8 can represent any U

Re: Converting CGPathAddArcToPoint (or NSBezierPath equivalent) to a fixed number of CGPathAddCurveToPoint calls

2012-05-02 Thread Wim Lewis
On 30 Apr 2012, at 3:26 PM, Gideon King wrote: > Hi, I am using the CAShapeLayer's ability to animate a path, but the start > and end path need to have the same number of segments. > > I have been using CGPathAddArcToPoint to add the curves to my path. That > translates to CGPathAddCurveToPoin

Re: Instruments, how to fix leak in C Lib

2012-05-02 Thread Wim Lewis
On 2 May 2012, at 10:55 AM, Wade Tregaskis wrote: > Symbolication picks the first known symbol before the address in question. > It's the consequence of a tragic design flaw in debug info formats to date. > > It's more obvious when this goes wrong in Crash Reporter or Shark where you > can see

Re: Accessing array in thread safe way

2012-03-07 Thread Wim Lewis
On 6 Mar 2012, at 11:51 AM, Jan E. Schotsman wrote: > I have an array of progress values (number objects) for subprojects, from > which I calculate the overall progress . > The array is an atomic property of the project class. > > Is it safe to access this array from multiple threads, using meth

Re: Unclear on -initWithBytesNoCopy:

2012-03-05 Thread Wim Lewis
On 3 Mar 2012, at 12:24 PM, Jens Alfke wrote: > On Mar 3, 2012, at 11:28 AM, Dave Keck wrote: > >> The buffer needs to remain intact until the NSString/NSData object is >> deallocated. > > True; but a strict interpretation of this is that the buffer can _never_ be > destroyed, because you can

Re: Convert PDF CGContextRef to NSView for hi-res printing

2012-03-05 Thread Wim Lewis
On 5 Mar 2012, at 12:13 PM, Gilles Celli wrote: > I'm stuck on a problem on how to print high resolution graphs on Mac OS X, by > using the wonderful CorePlot (1) framework. > I've asked on the Coreplot mailing list but no answer...maybe it's too > obvious that I don't see the tree in the forest

Re: __block __weak - am I doing this right?

2012-02-15 Thread Wim Lewis
On 15 Feb 2012, at 12:58 PM, Matt Neuburg wrote: > * Why was I crashing until I said __block? Without __block, the value of the variable is copied into the block (effectively as a const local variable) when the block is created. With __block, both the code inside and outside the block referenc

Re: Alternate Framework location

2011-12-05 Thread Wim Lewis
On 5 Dec 2011, at 5:11 PM, TomJones wrote: > I've been reading through the developer docs and I'm not sure I can do what I > want so I thought I would ask. I have created a Foundation tool and I have > created a private framework. All works great if I install my framework in > /Library/Framew

Re: Escape xml with CFXMLCreateStringByEscapingEntities

2011-12-05 Thread Wim Lewis
On 4 Dec 2011, at 10:42 AM, Jens Alfke wrote: > It looks like you’re trying to convert an NSString to a CFString through a > whole bunch of conversions; but all this takes is a simple cast: For more information on this, by the way, check "Toll-Free Bridging" in the developer docs; instances of

Re: Calling a Cocoa library from C

2011-11-11 Thread Wim Lewis
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, along the > lines of: > > retval=get_float_data(&float1,&float2); > > where get_float_data() is a fun

Re: How to compiler arm assembler .s source file with Xcode 4.2?

2011-11-09 Thread Wim Lewis
On 8 Nov 2011, at 11:49 PM, Don Quixote de la Mancha wrote: > I can see that Xcode is indeed calling CompileC on my .s source, which > ultimately calls clang. Clang is the LLVM compiler's front end for > the "C-Like" languages: C, Objective-C and C++. A quick test on the command-line shows that

Re: Private Method?

2011-11-07 Thread Wim Lewis
On 6 Nov 2011, at 2:10 PM, Bryan Harrison wrote: > I'm a total tyro and hope nobody minds if I fire off the occasional > incredibly elementary question. > > I'm reviewing some sample code and am looking at a class with a method > declared in @implementation which isn't mentioned in any @inte

Re: Writing a simple vector graphics editor - how to implement?

2011-10-05 Thread Wim Lewis
On 5 Oct 2011, at 12:39 PM, Nick wrote: > I have a task to write a simple vector graphics editor, which has a window, a > sheet (which can be bigger than the window), and some objects [...] I need an > advice how would experienced developers implement this basic functionality. > [] > What I

Re: The best way to call Cocoa methods not implemented in previous versions of the SDK?

2011-09-06 Thread Wim Lewis
On 6 Sep 2011, at 4:31 PM, Chris Hanson wrote: > It may be better to actually check whether your code is running on Snow > Leopard rather than make -respondsToSelector: checks. Another reason to do this is that occasionally the method or class you're interested in actually appeared in an earlie

Re: Decimation - NSBezierPath or something else?

2011-08-08 Thread Wim Lewis
On 8 Aug 2011, at 5:16 PM, N!K wrote: > Does NSBezierPath do decimation as well as interpolation? I didn't find it in > the Class Reference. > Or is there another class that does it? > Or must I do the decimation before plotting the data with NSBezierPath? No, NSBezierPath doesn't do any kind o

Re: Removing (foo) from a NSString

2011-07-12 Thread Wim Lewis
On 12 Jul 2011, at 12:42 PM, Fritz Anderson wrote: > On 12 Jul 2011, at 2:23 PM, Eric E. Dolecki wrote: >> What would be the easiest way to strip out parens and everything between >> them from an NSString? >> >> Into The Fire (Live) >> becomes >> Into The Fire > > NSRegularExpression will do, bu

Re: Adding Spotlight comment data to folder/file

2011-07-11 Thread Wim Lewis
On 11 Jul 2011, at 12:05 PM, Kevin Muldoon wrote: > Would like to get/set Spotlight comments into directories and files. I > thought this would have been the easy part. IIRC you can read them pretty easily as the kMDItemFinderComment metadata attribute. Setting them is harder. The comments are

Re: Loading Nibs which are self-ref

2011-07-06 Thread Wim Lewis
On 6 Jul 2011, at 2:43 PM, Kevin Muldoon wrote: > I'm seeking to do a copyObject class that has it's own progress window. So, > I'm doing my research and I see a technique for loading a nib with an object, > like so... > > MyDocument *myDocument = [[MyDocument alloc] init]; > [NSBundle loadNibN

Re: Using a Soundex category...

2011-07-06 Thread Wim Lewis
On 6 Jul 2011, at 11:23 AM, Eric E. Dolecki wrote: > However, when I tried it out I get strange results... > > //someString is set to different strings each time tested > BOOL test = [someString soundsLikeString:@"Face"]; > NSLog(@"sounds like Face: %d",test); > > Place = 0 > Ace = 0 > Mace = 0

Re: dealloc and scarce resources

2011-06-29 Thread Wim Lewis
On 29 Jun 2011, at 5:43 PM, James Merkel wrote: > In the [Memory Management Programming Guide] it says: > > "You should typically not manage scarce resources such as file descriptors, > network connections, and buffers or caches in a dealloc method. In > particular, you should not design classe

Re: Drawing noise in Cocoa (preferably fast)

2011-06-14 Thread Wim Lewis
On 14 Jun 2011, at 2:56 PM, Stephen Blinkhorn wrote: > I'm looking to fill a large custom view with noise. The solution I have > arrived at so far is taking much too long to draw for it to be useable. Does > anyone know any better ways of achieving this in Cocoa? The basic idea is to > add an a

Re: Declaring and initialization of C array.

2011-06-01 Thread Wim Lewis
On 1 Jun 2011, at 8:17 AM, Graham Cox wrote: > On 02/06/2011, at 1:12 AM, JAMES ROGERS wrote: >> K&R says to declare and initialize an array in C: >> >> int myArray[2] = {1,2}; >> ArrayTestAppDelegate.h:14: error: expected ':', ',', ';', '}' or >> '__attribute__' before '=' token If I cop

Re: Problems linking json-framework with ios application

2011-05-17 Thread Wim Lewis
On 17 May 2011, at 2:03 PM, Damien Cooke wrote: > I am building a library to be used by other apps. I have included the > json-framework in the library project and used the -ljson flag as directed. > Now this all works fine, until my app uses one of the JSON categories that > the library imple

Re: Why RunLoop?

2011-05-17 Thread Wim Lewis
On 17 May 2011, at 9:54 AM, Bing Li wrote: > But I noticed that Cocoa threading provides wait/pulse-like synchronization > techniques, such as Condition. I believe these techniques can be used to > control a thread which has a while-true loop. So I think RunLoop can be > replaced. Do you think so?

Re: Asynchronous Notification Failed

2011-05-16 Thread Wim Lewis
On 16 May 2011, at 2:19 PM, Bing Li wrote: > An application, AppController, which is interested in the asynchronous > notification, is as follows. I put sleep(5) deliberately to test if the > asynchronous notification works. As far as the run loop is concerned, when you are in sleep(5) you are bu

Re: Why NSClassFromString(@"CADisplayLink")?

2011-05-10 Thread Wim Lewis
On 10 May 2011, at 3:34 AM, Brian Bruinewoud wrote: > Just curious, why does this work (compiles and runs): > >displayLink = [NSClassFromString(@"CADisplayLink") displayLinkWithTarget: > tapped selector:@selector(respond:)]; > > But this doesn't link because the CADisplayLink class is missi

Re: what should I understand from kAudioQueueProperty_CurrentLevelMeterDB

2011-05-09 Thread Wim Lewis
On 8 May 2011, at 11:07 PM, Graham Cox wrote: > You need to find in the documentation or ask what 0dB is considered to be in > this measurement system. As I understand it, the 0dB reference for a VU meter is usually the maximum volume the system can reproduce without distortion (maybe plus some

Re: Instruments and leaks in a DRM framework

2011-05-03 Thread Wim Lewis
On May 1, 2011, at 3:42 AM, Jose R.P. - Renacentist Software wrote: > I've run "Instruments" in order to detect leaks in a sample xcodeproj > (RTestApp) for the framework I'm creating. There are leaks and the tool never > identifies my Framework as the responsible one, but there are at least fif

Re: Quick Looking big files crash

2011-05-03 Thread Wim Lewis
On 3 May 2011, at 4:03 PM, Brad Stone wrote: > I have a symbolic breakpoint set and it stops on > auto_refcount_underflow_error, even the small files. If I continue the doc > shows in QL. Presumably, a few stack frames up, there will be a call to CFRelease() which is causing the underflow (wh

Re: Quick Looking big files crash

2011-05-03 Thread Wim Lewis
On 3 May 2011, at 3:45 PM, Brad Stone wrote: > Here's what I get when I QL a large file. > > proNotes(52698,0x1196fd000) malloc: reference count underflow for > 0x201afc920, break on auto_refcount_underflow_error to debug. (17 times) > proNotes(52698,0x1196fd000) malloc: resurrection error for o

Re: Resolving a crash address to position in code

2011-04-18 Thread Wim Lewis
On 18 Apr 2011, at 12:38 PM, Nick Zitzmann wrote: > Did you save the dSYM from when you built the shipping product? If so, then > you can use dwarfdump with the --lookup option to look up that address. Don't > forget to include the architecture from the crash log. atos can also read .dSYMs ---

Re: Not sure about autorelease pools in NSOperations

2011-04-11 Thread Wim Lewis
On 11 Apr 2011, at 7:38 PM, G S wrote: > I haven't really managed autorelease pools explicitly before, but the > NSOperation doc says to use one in your NSOperation derivatives. My > question is where to put it. The example shows the pool being created and > released in the main() function, but

Re: autorelease pool comprehension

2011-03-30 Thread Wim Lewis
On 30 Mar 2011, at 9:53 AM, Apple Developer wrote: > Why were the NSNumber objects not released when the pool was released? They are being kept alive because they are (indirectly) members of 'list', which I assume is released by a containing autorelease pool somewhere.

Re: OCTET_STRING_t -> NSString?

2011-03-29 Thread Wim Lewis
On 29 Mar 2011, at 12:26 PM, Chris Ridd wrote: > liblber can only decode the restricted BER defined for use with LDAP. In > particular, no indefinite length encoding, strings can't be constructed, etc. > The lber-decode man page mentions this at the top. > > Given this is all likely to be part

Re: easy way to store table-like data

2011-03-07 Thread Wim Lewis
On 7 Mar 2011, at 12:26 PM, Martin Batholdy wrote: > Is it also possible to filter the entries of an NSDictionary like in SQL? Yes (as Dave DeLong describes). If you just need to filter it for display and are using NSArrayController you can also use -setFilterPredicate:. It's presumably doing t

Re: easy way to store table-like data

2011-03-07 Thread Wim Lewis
Well, sqlite3 is available on the system (and is used by a lot of Apple code, so hopefully it won't be removed in the near future); you could simply use that, if that API is what you're most familiar with. However, unless you have a pretty large data set, sqlite is probably overkill and it'd be

Re: Function to get current Backtrace and Address Slide

2011-02-28 Thread Wim Lewis
On 28 Feb 2011, at 3:01 PM, Jerry Krinock wrote: > Apparently I can get the slides by using the _dyld_xxx_xxx_xxx() functions > from mach-o/dyld.h. I've tested the following and it seems to work. But > since I'm completely out of my league with this stuff I thought I'd throw > this code out t

Re: Reliable way to determine bitness of the kernel

2011-02-22 Thread Wim Lewis
On 22 Feb 2011, at 10:09 AM, eveningnick eveningnick wrote: > i have a kext (or, rather, 2 kexts - one built with -arch i386, another one > with -arch x86_64). They should work on both OS X 10.5 and 10.6. > i have an installing script, which looks like > if [ `uname -a | grep x86_64 | wc -l` ge 1

Re: -[NSSet containsObject:] returns NO when it should return YES

2011-02-21 Thread Wim Lewis
On 19 Feb 2011, at 2:17 PM, Michael Crawford wrote: > Anyone have previous experience with this problem? Can you shed some light > on where my thinking and assumptions are wrong. I could write a sweet of > tests to try and prove/disprove what I think is happening but I'm hoping to > benefit f

Re: Initializing NSError **, again Re: CoreData Migration Problems

2011-02-09 Thread Wim Lewis
On 9 Feb 2011, at 11:04 AM, Scott Anguish wrote: > If you pass &blah, if there is no error, blah == nil > > Perhaps by-reference would be a better terminology. > > Returns, by-reference, an NSError object if the regex is invalid; otherwise > nil. Pass nil if you don't care. My understanding i

Re: Base SDK 10.6 deployment target 10.5 - symbol not found

2011-01-11 Thread Wim Lewis
On 10 Jan 2011, at 11:42 PM, Kenneth Baxter wrote: > Hi, I have a project I'm working on which needs to run on 10.5 and 10.6. I > have various things enabled or disabled using: > > if (floor(NSAppKitVersionNumber) > NSAppKitVersionNumber10_5) ... > > but I also have some places in my code where

Re: NSGraphicsContext PDF crash

2011-01-03 Thread Wim Lewis
On 3 Jan 2011, at 4:10 PM, Wesley Smith wrote: > Then, I do > > [NSGraphicsContext setCurrentContext:ctx]; > [[NSColor blackColor] set]; > NSBezierPath *p = [[NSBezierPath bezierPath] retain]; > [p lineToPoint:NSMakePoint(100, 100)]; // <- crashes here > [p stroke]; > > > Top o

Re: Rendering combining marks

2011-01-03 Thread Wim Lewis
On 2 Jan 2011, at 1:23 PM, George Nachman wrote: > I'm using CGContextShowGlyphsWithAdvances to render fixed-width text > because it is very fast. If a glyph is missing, I use > CTFontCreateForString() to pick a better font, and that usually works. > I ran into a case that I just can't solve with

Re: Communicating to a process started by root from non-root app

2011-01-03 Thread Wim Lewis
On 3 Jan 2011, at 11:03 AM, eveningnick eveningnick wrote: > i have a daemon whose owner is wheel:root and which provides a Unix > Domain Socket where i can send/receive datagrams from my custom > Preference Pane. > The problem i have is that a socket, installed by a root-process can't > be "sent"

Re: assign property behaves differently from simple instance variable???

2010-12-13 Thread Wim Lewis
On 13 Dec 2010, at 11:01 AM, Matt Neuburg wrote: > How can this seemingly minor change make such a big difference? I'm not even > *using* the synthesized accessor! Yet its mere presence breaks the project. > How can this be? m. > > PS A new discovery: changing the name of the ivar / property to

Re: How to read a text file over a network

2010-12-13 Thread Wim Lewis
On 13 Dec 2010, at 4:54 AM, Abhijeet Singh wrote: > My question is if user wants to define some network file path then:How to > define a network file path? (I tried keeping file1.txt over a network and > define its path as given in "Get Info" panel in file2.txt)How to read a file > over a netw

Re: OS X: how to create a text label?

2010-12-08 Thread Wim Lewis
On 8 Dec 2010, at 11:15 AM, Artemiy Pavlov wrote: > I would like to add a simple text label to my Cocoa UI on OS X, > programaticaly. It's just a static text label that'll be there unchanged, > that has a certain font, size and color. What is the best way to do this? Use an NSTextField, and set

Re: Problem instantiating an array

2010-12-07 Thread Wim Lewis
On 7 Dec 2010, at 10:11 AM, Dennis wrote: > But if for example I declare int test[16], the debugger shows the array > "test" with 16 members. That's not happening in the case of my code with > allColumns. It's displaying an array of -1 members. It's possible that the debugger simply doesn't kno

Re: Keeping track of state in Cocoa

2010-12-01 Thread Wim Lewis
On 1 Dec 2010, at 3:31 PM, Jon Sigman wrote: > I have a message receiver which manages a number of TCP-connected processes > (100 > or so). However, I need to keep track of the state of each connected process > (registered, busy, waiting, etc) to know what operations are 'legal' or > appropria

Re: aborting init

2010-11-29 Thread Wim Lewis
On 29 Nov 2010, at 6:59 PM, Rainer Standke wrote: > I am thinking about doing something like this: > > - to init a custom object, call a convenience initializer that in turn calls > the designated initializer > > - in the convenience initializer, before the designated initializer is > called,

Re: BSD Libs

2010-11-17 Thread Wim Lewis
On 17 Nov 2010, at 3:51 PM, k...@highrolls.net wrote: > I have a number of BSD static libs that link with my Cocoa apps. I want to > bring this functionality to iPhone / iPad apps. So, before I jump in I > thought I would ask: > > Can I build BSD static libs using iPhone sdks as my base

Re: NSTimer firedate randomly changes

2010-11-17 Thread Wim Lewis
On 17 Nov 2010, at 1:54 PM, Kyle Sluder wrote: > Okay, that's two people who have corrected me on this now. What am I > misinterpreting about this documentation: > > http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/Multithreading/RunLoopManagement/RunLoopManagement.html Whi

Re: remove icon from Dock

2010-10-12 Thread Wim Lewis
On 12 Oct 2010, at 5:57 AM, kirankumar wrote: > Need help , is there any command line for removing icon from Dock. > > I don't want to do drag option and aslo do not want right click on > Remove from Dock. There isn't a specific API for manipulating the dock, but many people have found that it

Re: NSTableView display issue

2010-09-22 Thread Wim Lewis
On Sep 22, 2010, at 12:01 PM, k...@highrolls.net wrote: > Besides bindings and KVO issues, anything else to look at? I am not using > bindings nor is this KVO. On occasion I've seen a things like this happen if a data source method has raised an exception. It's generally not safe to throw an ex

Re: CGContextSelectFont spinlock

2010-09-15 Thread Wim Lewis
On Sep 15, 2010, at 5:22 PM, Stevo Brock wrote: > And also unfortunately, when I click Pause in the Debugger, the stack trace I > gave is all that is shown. If there is a way to get a more complete stack > trace, please let me know. Is there anything releted-looking going on in another thread?

Re: Interpreting a Crash Log

2010-09-13 Thread Wim Lewis
On Sep 13, 2010, at 4:15 PM, k...@highrolls.net wrote: > As I understand the entries below from a crash log my app crashed in > objc_msgSend which was called from the method changeAColor:newColor in the > class BMatrix, 1499 bytes into the method. > > How do I find the offending line in the sou

Re: Finding source of EXC_BREAKPOINT crash

2010-08-31 Thread Wim Lewis
On Aug 30, 2010, at 7:10 AM, Ben wrote: > My app is built with a base SDK and deployment target of 10.5, but will only > run on 10.6 systems. On 10.5 systems it crashes on launch with an > EXC_BREAKPOINT and the following message: > > Dyld Error Message: > unknown required load command 0x80

Re: zlib works in Dubug, not in Release

2010-08-31 Thread Wim Lewis
On Aug 30, 2010, at 7:51 PM, Trygve Inda wrote: >> I am uncompressing data with zlib: >> >> err = uncompress( buffer, &bufferLength, (const Bytef*)data + sizeof( uLongf >> ), [self length] - sizeof( uLongf ) ); >> > [] > Just as a follow-up. More research revels that the data was compressed

Re: SecIdentity from Certificate

2010-08-04 Thread Wim Lewis
On Aug 4, 2010, at 3:23 PM, Apparao Mulpuri wrote: > I am trying to construct SecIndentity from the certificate with extension > .p12 as mentioned in > http://developer.apple.com/mac/library/documentation/Security/Conceptual/CertKeyTrustProgGuide/iPhone_Tasks/iPhone_Tasks.html, > but unfortunat

Re: case-insensitive but case-ordered sort

2010-07-20 Thread Wim Lewis
On Jul 20, 2010, at 10:39 AM, Roland King wrote: > I thought perhaps that comparing the two strings case insensitively, > returning that compare if they are not equal, but if they are equal, > comparing them case sensitively and returning the inverse of that (remember I > want a to beat A) woul

Re: Adding an image to a project

2010-07-14 Thread Wim Lewis
On Jul 14, 2010, at 10:01 AM, Vincenzo Morgante wrote: > I wrote the following code, but it does not work: the program crashes... > NSString* imageName = [[NSBundle mainBundle] pathForResource:@"image1" > ofType:@"png"]; > IplImage *image = cvLoadImage([imageName UTF8String], ...); That should w

Re: Drag pasteboard owner asked for data upon quitting

2010-07-13 Thread Wim Lewis
On Jul 13, 2010, at 2:35 PM, Philip White wrote: > I can understand why other pasteboards would ask for data upon quitting, but > why would the drag pasteboard? I think it's just general pasteboard behavior: it has to be able to fulfill the promised datatypes if someone eventually asks for them

Re: Looking for guidance re: password/credential storage and Core Data

2009-11-03 Thread Wim Lewis
On Nov 3, 2009, at 4:51 AM, David HM Spector wrote: Is there a pattern commonly followed regarding storage of passwords or other credential type data in core data..? Given the existence and security profile of the KeyChain, it would clearly be best to keep passwords there, but can I map t

  1   2   >