Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Vincent Habchi
Hi! Thanks to all for your quick and kind answers. > You're comparing apples to oranges. That’s a nice way of putting it! > You were storing strings for each numeric value, now you're storing doubles. Actually just floats, in order to save space. > You could have tried NSNumber objects inste

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Vincent Habchi
Quincey, > Each NSString has at least 4 bytes of overhead (the 'isa' pointer); each > character is UTF-16; each object is a multiple of 16 bytes. Your values may > not fit in the remaining 12 bytes of the smallest object (an input format > something like '0.xe-nn', which isn't an unlikely forma

NSTextField / NSSecureTextField toggl

2013-07-07 Thread Michael Starke
Hello List, I'm somewhat heading down a road of pain with this. Maybe I approach the problem from the wrong angle, so I wanted to ask for advice. My goal is to have a NSTextField that can be toggled to display a Password in clear or bulleted format. Sort of NSTextField - NSSecureTextField I'm u

Re: NSTextField / NSSecureTextField toggl

2013-07-07 Thread Michael Starke
Well, turns out you can use NSString's: - (void)enumerateSubstringsInRange:options:usingBlock: Using the NSStringEnumerationByComposedCharacterSequences option, you get the actual character count. But that's just a little bit nearer to the solution, as I'm guessing I need to intervene earlier

Re: NSTextField / NSSecureTextField toggl

2013-07-07 Thread Mike Abdullah
I reckon this code of mine is what you want: https://github.com/karelia/SecurityInterface/blob/master/README.md Mike. Sent from my iPhone On 7 Jul 2013, at 13:46, Michael Starke wrote: > Hello List, > > I'm somewhat heading down a road of pain with this. Maybe I approach the > problem from

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread dangerwillrobinsondanger
Sent from my iPhone On 2013/07/07, at 16:33, Vincent Habchi wrote: > Hi! > Thanks to all for your quick and kind answers. > >> You're comparing apples to oranges. > > That’s a nice way of putting it! > >> You were storing strings for each numeric value, now you're storing doubles. > > Ac

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Scott Ribe
On Jul 7, 2013, at 1:33 AM, Vincent Habchi wrote: > Is there any hope in the future to be able to store simple types like int or > floats in NSArrays? Why? What's wrong with a simple array? (Or, I would argue, though it's not a popular strategy, what's wrong with std::vector?) Now if you real

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Vincent Habchi
Hi! You’re right to point that CFtypes exist: I often overlook these and that’s stupid of me. > Why? What's wrong with a simple array? Nothing. Well, at first, I was looking for a self expanding array, given that I didn’t know the size beforehand. > (Or, I would argue, though it's not a popul

Re: NSTextField / NSSecureTextField toggl

2013-07-07 Thread Jens Alfke
On Jul 7, 2013, at 5:46 AM, Michael Starke wrote: > I'm somewhat heading down a road of pain with this. Maybe I approach the > problem from the wrong angle, so I wanted to ask for advice. > My goal is to have a NSTextField that can be toggled to display a Password in > clear or bulleted forma

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Scott Ribe
On Jul 7, 2013, at 10:38 AM, Vincent Habchi wrote: > Oh, just that since I moved from plain BSD/Qt3 to MacOS/Cocoa, I swore not to > write any line of C++ ever again. But that’s just a personal commitment ;) If Qt is the majority of your experience with C++, then I understand wanting to avoid i

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Scott Ribe
And while we're on the subject of speed, you're already dealing with threads, you're already prefixing the values with a count, if you get to a format where values in the input file are fixed-length, then you can find sections 2 & 3 without reading 1 & 2, so you could load the sections in parall

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Jens Alfke
On Jul 7, 2013, at 1:08 AM, Vincent Habchi wrote: > My initial reasoning was very (too) simple: I have a 20 MB file made up of > strings, if I store those strings in objects, even with a small overhead, it > should not top 30 or 40 MB. It turned out I was plainly wrong, at least the > way I i

Re: The cost of using objects rather than plain C variables

2013-07-07 Thread Frederick Bartram
> Is there any hope in the future to be able to store simple types like int or > floats in NSArrays? Have you tried using NSData to store C-arrays? *- * Frederick Bartram * PGP key id: 0x63fa758 keyserver: http://keyserver.pgp.com */ smime.p7s De

pathForResource:ofType: iOS bug?

2013-07-07 Thread Jeff Smith
Hi, pathForResource:ofType: is returning a path string with 4 garbage characters added to the end of the string. To make sure it wasn't my program causing the problem I created a new iOS project to try it out and it does it too. Empty Application Devices - Universal No - Use Core Data No

Re: pathForResource:ofType: iOS bug?

2013-07-07 Thread Stephen J. Butler
How are you examining the return value? Show us that code too, please. On Sun, Jul 7, 2013 at 7:34 PM, Jeff Smith wrote: > > > Hi, > > > > pathForResource:ofType: is returning a path string with 4 garbage > characters added to the end of the string. > > To make sure it wasn't my program causing

Re: pathForResource:ofType: iOS bug?

2013-07-07 Thread Jeff Smith
Whoops! It looks like it was my program after all. I quit Xcode and threw out all of the derived data and tried it again. Now it's working correctly in the test program. Sorry about that... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.

10.8 & Sandbox & start at login

2013-07-07 Thread Robert Vojta
Hi all, I've got problem with start at login in sandboxed environment on 10.8 (< 10.8 is not supported now). It simply doesn't work sometimes. What does it mean exactly? 1. App is downloaded from the App Store 2. App is started by me/user and Start at login is checked (code below) 3. I do resta