On Sep 15, 2008, at 5:16 PM, Alex Reynolds wrote:
I also wanted to learn a bit about Objective-C++.
What are the issues that involve exceptions? I find that
NSExceptions I have in my larger application still work when I poke
those.
In the 32-bit runtime, Objective-C exceptions and C++ exc
BOOL vs. bool aside (as well as a couple methods that return NSString*
and throw NSException) I wanted to take a stab at making this particular
class more portable.
If I wrote it closer to the C++ STL spec, I could more easily use it in
other contexts while writing my larger application in Coc
On Mon, Sep 15, 2008 at 5:43 PM, Alex Reynolds <[EMAIL PROTECTED]> wrote:
> Are there any downsides to creating Cocoa-based applications in Objective
> C++?
If you're switching to Objective-C++ just to get std::vector, I would
strongly suggest you reconsider. There are plenty of issues regarding
On Sep 15, 2008, at 4:43 PM, Alex Reynolds wrote:
Is there a difference in the underlying storage between vector
and
vector?
Yes! std::vector is a class template. There's a generic
implementation provided that works with any type (within certain
constraints), but there's a specializati
On Mon, Sep 15, 2008 at 2:43 PM, Alex Reynolds <[EMAIL PROTECTED]> wrote:
>>
>> Of course there's always std::vector< bool > ;-) usually at 1 bit per
>> bit...
>>
>> --
>> Scott Ribe
>> [EMAIL PROTECTED]
>> http://www.killerbytes.com/
>> (303) 722-0567 voice
>
>
> Thanks for the tip. So I ended up
>
> Of course there's always std::vector< bool > ;-) usually at 1 bit per
> bit...
>
> --
> Scott Ribe
> [EMAIL PROTECTED]
> http://www.killerbytes.com/
> (303) 722-0567 voice
Thanks for the tip. So I ended up going the route of making my .m files into
.mm files, and using std::vector< vector > t
On Thu, Sep 11, 2008 at 6:22 AM, dreamcat7 <[EMAIL PROTECTED]> wrote:
>
> On 11 Sep 2008, at 13:08, Jean-Daniel Dupas wrote:
>>
>> That's fine if you love to reinvent the wheel, but that exactly the
>> interface provided by CFMutableBitVector.
>>
>> CFBitVectorCreateMutable()
>> CFBitVectorSetBitAt
On Wed, Sep 10, 2008 at 12:28 PM, Shawn Erickson <[EMAIL PROTECTED]> wrote:
> On Wed, Sep 10, 2008 at 9:18 AM, Joel Norvell <[EMAIL PROTECTED]> wrote:
>> OK. I think I've got it. One could use an increasing sequence of integers,
>> letting evenness and oddness determine the boolean state at any
At 14:22 +0100 11/9/08, dreamcat7 wrote:
On 11 Sep 2008, at 13:08, Jean-Daniel Dupas wrote:
And it probably does it better as it will not waste 7 bits for each option.
No, in a CFBitVector there is 4-bytes for each bit.
CFBit
A binary value of either 0 or 1.
typedef UInt32 CFBit;
The CFBi
No, CFBit is just declared to be used in the interface of CFBitVector.
Look at
http://http://src.gnu-darwin.org/DarwinSourceArchive/expanded/CF/CF-299/Collections.subproj/CFBitVector.c,
in particular the function __CFBitVectorBit. Each value has 1 bit of
overhead. Anything more is a needless waste
On 11 Sep 2008, at 13:08, Jean-Daniel Dupas wrote:
That's fine if you love to reinvent the wheel, but that exactly the
interface provided by CFMutableBitVector.
CFBitVectorCreateMutable()
CFBitVectorSetBitAtIndex()
CFBitVectorGetBitAtIndex()
And it probably does it better as it will not w
Le 11 sept. 08 à 13:32, dreamcat7 a écrit :
Yes the NSMutableData needs this category method then it work.
@interface NSMutableData (charArray)
- (char*)char;
@end
@implementation NSMutableData (charArray)
- (char*)char
{
char * foo = self.mutableBytes;
return foo;
}
@end
Yes the NSMutableData needs this category method then it work.
@interface NSMutableData (charArray)
- (char*)char;
@end
@implementation NSMutableData (charArray)
- (char*)char
{
char * foo = self.mutableBytes;
return foo;
}
@end
+ (NSMutableData*)defaultOptions
{
NSMu
" use NSMutableData objects with 1 byte for each 0 or 1 value. You
can then get the BOOL values as
'data.bytes [index]', set them with 'data.mutableBytes [index] =
someBool' and resize the array with
'data.length = someLength'. In terms of source code, that's about as
minimalistic as it gets
... [earlier discussion] ...
NSIndexSet can use less than 1-bit per bit :)
(It compresses contiguous ranges)
In some cases, especially where 1s are relatively sparse, as with
selections. It can also take a whole lot more than 1 bit per bit,
since a
range is a pair of 32-bit ints.
... [future
> NSIndexSet can use less than 1-bit per bit :)
> (It compresses contiguous ranges)
In some cases, especially where 1s are relatively sparse, as with
selections. It can also take a whole lot more than 1 bit per bit, since a
range is a pair of 32-bit ints.
--
Scott Ribe
[EMAIL PROTECTED]
http://w
NSIndexSet can use less than 1-bit per bit :)
(It compresses contiguous ranges)
On Wed, Sep 10, 2008 at 5:21 PM, Scott Ribe <[EMAIL PROTECTED]> wrote:
> Of course there's always std::vector< bool > ;-) usually at 1 bit per bit...
--
Clark S. Cox III
[EMAIL PROTECTED]
__
Of course there's always std::vector< bool > ;-) usually at 1 bit per bit...
--
Scott Ribe
[EMAIL PROTECTED]
http://www.killerbytes.com/
(303) 722-0567 voice
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or
Yes, only storing "ones" would work well with NSMutableIndexSet's containsIndex
method. If you didn't get a "hit" you'd know that that position was a "zero."
I was incorrectly thinking of NSMutableIndexSet as an array.
--- On Wed, 9/10/08, Shawn Erickson <[EMAIL PROTECTED]> wrote:
> On Wed, S
On Wed, Sep 10, 2008 at 9:18 AM, Joel Norvell <[EMAIL PROTECTED]> wrote:
> OK. I think I've got it. One could use an increasing sequence of integers,
> letting evenness and oddness determine the boolean state at any index. That
> would save a huge amount of "overhead" in this case!
You only n
2008/9/10 Joel Norvell <[EMAIL PROTECTED]>:
> OK. I think I've got it. One could use an increasing sequence of integers,
> letting evenness and oddness determine the boolean state at any index. That
> would save a huge amount of "overhead" in this case!
Is the size of the boolean set always f
OK. I think I've got it. One could use an increasing sequence of integers,
letting evenness and oddness determine the boolean state at any index. That
would save a huge amount of "overhead" in this case!
--- On Wed, 9/10/08, Todd Blanchard wrote:
> Well, if I read it right, he's using the NS
cter long NSString *
instances into an NSMutableArray. The characters are 0 or 1.
I guess I could use an int array, but I'm looking to speed up my app
and reduce storage. Is it possible to create a BOOL array that can
be put into an NSMutableArray?
On Sep 10, 2008, at 02:32, Todd Blanchard w
e characters are 0 or 1.
> >
> > I guess I could use an int array, but I'm looking to speed up my app
> > and reduce storage. Is it possible to create a BOOL array that can
> > be put into an NSMutableArray?
> On Sep 10, 2008, at 02:32, Todd Blanchard wrote:
&g
an int array, but I'm looking to speed up my app
> > and reduce storage. Is it possible to create a BOOL array that can
> > be put into an NSMutableArray?
> Or use NSMutableData objects with 1 byte for each 0 or 1 value. You
> can then get the BOOL values as 'dat
I'm looking to speed up my app
and reduce storage. Is it possible to create a BOOL array that can
be put into an NSMutableArray?
Thanks,
Alex
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or mode
app and reduce storage. Is it possible to create a BOOL array that
can be put into an NSMutableArray?
Or use NSMutableData objects with 1 byte for each 0 or 1 value. You
can then get the BOOL values as 'data.bytes [index]', set them with
'data.mutableBytes [index] = someBool
On Sep 9, 2008, at 3:24 AM, Alex Reynolds wrote:
I am currently putting 320 to 480 character long NSString *
instances into an NSMutableArray. The characters are 0 or 1.
I guess I could use an int array, but I'm looking to speed up my app
and reduce storage. Is it possible to create a
On Sep 9, 2008, at 03:24, Alex Reynolds wrote:
I am currently putting 320 to 480 character long NSString *
instances into an NSMutableArray. The characters are 0 or 1.
I guess I could use an int array, but I'm looking to speed up my app
and reduce storage. Is it possible to create a
Le 9 sept. 08 à 12:24, Alex Reynolds a écrit :
I am currently putting 320 to 480 character long NSString *
instances into an NSMutableArray. The characters are 0 or 1.
I guess I could use an int array, but I'm looking to speed up my app
and reduce storage. Is it possible to create a
BOOL array that can
be put into an NSMutableArray?
You can use a BOOL array or an int array... or an array of uint8_t.
BOOL is just a signed char anyway. Just wrap the array in an NSValue
object when you put it into the NSMutableArray:
BOOL boolArrayOne[320];
/* ... */
NS
I am currently putting 320 to 480 character long NSString * instances
into an NSMutableArray. The characters are 0 or 1.
I guess I could use an int array, but I'm looking to speed up my app
and reduce storage. Is it possible to create a BOOL array that can be
put into an NSMutable
32 matches
Mail list logo