Dear list,
I have an NSDocument app that implements autosave and versions on Lion. The
NSDocument subclass is essentially a text editor. If I create a new document
and type something in the text view then the 'Edited' tag appears. I then save
the document to disk. After this, typing in the text
Is there an easy way to figure out the capacity of a NSMutableData object -
that is the number of bytes that can be written to the data object without
causing it to reallocate the internal buffer or invalidating the base pointer
to the internal buffer?
Example:
NSMutableData* data = ..
[dat
Does "Revert to Last Saved" become available after saving and editing? Which
NSDocument methods are you overriding?
It is indeed -updateChangeCount: that controls the 'Edited' state. You might
try overriding with a call to super and setting a breakpoint or adding a log to
make sure it's being c
Hi Rick,
On May 22, 2012, at 9:14 PM, Rick C. wrote:
> Hi,
>
> I'm having some trouble doing a custom drawing for my group row in a
> view-based nstableview. First of all I subclassed NSTableRowView is this
> correct?
Yes, that is correct.
> And if so the problem I'm having is to recreate
On May 23, 2012, at 05:30 PM, Kevin Perry wrote:
> Does "Revert to Last Saved" become available after saving and editing? Which
> NSDocument methods are you overriding?
I override:
-autosavesInPlace
-readFromURL:ofType:error:
-writeToURL:ofType:error:
-saveDocument:
plus some others (like -pr
On May 23, 2012, at 9:43 AM, Martin Hewitson wrote:
>> It is indeed -updateChangeCount: that controls the 'Edited' state. You might
>> try overriding with a call to super and setting a breakpoint or adding a log
>> to make sure it's being called as expected (with NSChangeDone). That should
>>
On May 23, 2012, at 12:43 PM, Martin Hewitson
wrote:
>
> On May 23, 2012, at 05:30 PM, Kevin Perry wrote:
>
>> Does "Revert to Last Saved" become available after saving and editing? Which
>> NSDocument methods are you overriding?
>
> I override:
>
> -autosavesInPlace
> -readFromURL:ofType:e
On May 23, 2012, at 8:26 AM, Andreas Grosam wrote:
> Is there an easy way to figure out the capacity of a NSMutableData object -
> that is the number of bytes that can be written to the data object without
> causing it to reallocate the internal buffer or invalidating the base pointer
> to the
Hi all,
I'm making some tests with a new from scratch CoreData Document based
application in Mac OS X 10.7.4 with autosave enabled and Sandbox. (I must
"sandboxing" an existing application for the AppStore upload).
All works fine with binary or xml type but not with SQLite.
Step 1 - I can creat
Is there an easy way to figure out the capacity of a NSMutableData
>object - that is the number of bytes that can be written to the data
object without causing it to reallocate the internal buffer or
>invalidating the base pointer to the internal buffer?
Can you not track the capacity yourself
On 23 May 2012, at 1:41 PM, Jason Teagle wrote:
> Unless I'm missing something, if you use
...
> -initWithCapacity:some_capacity
>
> to guarantee it has the capacity (but not necessarily allocated yet) followed
> by
>
> -initWithLength:some_capacity
DO NOT DO THIS.
-init... is a
DO NOT DO THIS.
-init... is a one-time operation in Cocoa. The call is privileged to make
>destructive initializations to the object, to assume that its initial
state
>can be ignored, and even to replace the object entirely. Subsequent
-init...
calls will in turn assume they can make destructi
On May 23, 2012, at 12:15 PM, Jason Teagle wrote:
> Fair point, and well noted. I think it's a shame that objects would be so
> cavalier about their existing state (isn't that just sloppy? Makes it far too
> easy to leak memory)
No, it's part of the contract of object initialization. Initializ
I've got a UIScrollView that's supposed to page horizontally. It works
correctly if programmatically scrolled, but user touches to scroll it are
getting eaten by something else.
Is there any way to debug the touches, and see who's getting them? This used to
work, but I've been doing some other
On 5/23/12 3:24 PM, Rick Mann wrote:
> I've got a UIScrollView that's supposed to page horizontally. It
> works correctly if programmatically scrolled, but user touches to
> scroll it are getting eaten by something else.
>
> Is there any way to debug the touches, and see who's getting them?
> This
On May 23, 2012, at 15:51 , Conrad Shultz wrote:
> On 5/23/12 3:24 PM, Rick Mann wrote:
>> I've got a UIScrollView that's supposed to page horizontally. It
>> works correctly if programmatically scrolled, but user touches to
>> scroll it are getting eaten by something else.
>>
>> Is there any wa
> Can you not track the capacity yourself? Unless I'm missing something, if you
> use
>
>+dataWithCapacity:some_capacity
The docs note that this doesn't necessarily pre-allocate the given capacity.
You can test that trivially by asking for a capacity of several gigabytes.
In a nutshell, t
You can't believe how easy that was to implement in cocoa:
[myThumbnailView setThumbnailSize: [myThumbnailView thumbnailSize]];
That's it; works like a charm.
On May 22, 2012, at 11:37 PM, Antonio Nunes wrote:
> On 23 May 2012, at 03:53, Matthew Weinstein wrote:
>
>> I have a typical t
On May 23, 2012, at 7:30 PM, Wade Tregaskis wrote:
> If there's a performance concern, using IMP caching. The cost of the
> function call to retrieve the bytes pointer is really trivial.
Or just manage your own memory block using malloc / realloc / free. It's not
that much more work than usin
Thanks Corbin for the reply. Ok I will continue with NSTableRowView and see if
I can get the floating right this time. I'll let you know thanks again!
rc
On May 24, 2012, at 12:10 AM, Corbin Dunn wrote:
> Hi Rick,
> On May 22, 2012, at 9:14 PM, Rick C. wrote:
>
>> Hi,
>>
>> I'm having so
+dataWithCapacity:some_capacity
The docs note that this doesn't necessarily pre-allocate the given capacity.
Which is exactly why I said, in the very same sentence, "to guarantee it
has the capacity (but not necessarily allocated yet)".
That's why you then call -setLength:, which writes
On 24 May 2012, at 06:02, Jason Teagle wrote:
>>>+dataWithCapacity:some_capacity
>>
>> The docs note that this doesn't necessarily pre-allocate the given capacity.
>
> Which is exactly why I said, in the very same sentence, "to guarantee it has
> the capacity (but not necessarily allocated
I'm not sure what you're hoping to achieve from this. NSMutableData's capacity
is
not a hard and fast upper limit to how much data can be put in there; it's just
a hint
to the API for roughly how much space should be found for the data.
(The point - with setLength: - was to pre-allocate the m
23 matches
Mail list logo