On 08/05/2012, at 1:17 PM, Ben Kennedy wrote:
> Well, that would require my controller to -addObserver:... on each of the
> collected objects, which I had earlier decided to avoid for various reasons.
> But that's a good technique for me to keep in mind, and is beginning to sound
> like possi
On May 7, 2012, at 20:16 , Koen van der Drift wrote:
> One of my viewcontrollers uses the representedObject to bind to the
> NSArrayController that holds all the data for the application (OS X, ARC on).
> I declared a local property mySelection (an NSArray) and bind it to the
> representedObjec
Roland's right about ARC, you just need the set and copy. Just for the record,
I don't think the pattern you present is safe when newSelection equals
mySelection (as you release before you copy), you need something like one of
the following:
if (mySelection != newSelection)
{
[mySelecti
mySelection = [ newSelection copy ];
is all you need.
On May 8, 2012, at 11:38 AM, Koen van der Drift wrote:
>
> On May 7, 2012, at 11:28 PM, Roland King wrote:
>
>> -(void)setMySelection:(NSArray*)newSelection
>> {
>> // set whatever instance variable you have for mySelection,
On May 7, 2012, at 11:28 PM, Roland King wrote:
> -(void)setMySelection:(NSArray*)newSelection
> {
> // set whatever instance variable you have for mySelection,
> with appropriate memory management if necessary
I thought about that too, but how do I do that when using ARC? Can I
It's ok, you can do it if you like, monitor your own properties, however if all
you really want to do here is, in your own class, do something more when
mySelection is changed, you can write your own setter and put it in there
yourself directly.
-(void)setMySelection:(NSArray*)mySelection
{
On 07 May 2012, at 4:45 pm, Graham Cox wrote:
> Another way to 'centralise' undo is to have an object listen for the KVO
> notifications of changes for properties it's interested in, and use the
> observation method to record to the undo manager. You'd still use
> setValue:forKey: at undo time,
One of my viewcontrollers uses the representedObject to bind to the
NSArrayController that holds all the data for the application (OS X, ARC on). I
declared a local property mySelection (an NSArray) and bind it to the
representedObject as follows:
[self bind:@"mySelection" toObject:self.rep
On 8 May 2012, at 01:08, David Duncan wrote:
> On May 5, 2012, at 10:15 PM, Gerriet M. Denkmann wrote:
>
>> My app (iOS 5.1) has a xib called MainWindow.xib which does NOT contain a
>> window, just two objects, one of this is an UIApplicationDelegate.
>>
>> This UIApplicationDelegate has:
>>
>> I'm sliding over the details of what you said because they're irrelevant for
>> my purposes.
>
> OK, but I'd *really* appreciate it if you'd avoid calling my replies
> senseless:
I never said your replies are senseless. The sequence was:
>> On 2012.05.05, at 4:51 PM, Kyle Sluder wrote:
>> I
On May 7, 2012, at 4:35 PM, Graham Cox wrote:
> The alternative would be to pull out each data field one by one, which I'm
> sure is also considered acceptable practice, but for this file type, using
> structs has proved to be a lot easier, not least because of a) the strange
> mix of big-endi
Hi Ben,
I think this undo approach should work fine.
Another way to 'centralise' undo is to have an object listen for the KVO
notifications of changes for properties it's interested in, and use the
observation method to record to the undo manager. You'd still use
setValue:forKey: at undo time,
On May 7, 2012, at 16:07 , Martin Wierschin wrote:
> I'm sliding over the details of what you said because they're irrelevant for
> my purposes.
OK, but I'd *really* appreciate it if you'd avoid calling my replies senseless:
>> On May 7, 2012, at 13:35 , Martin Wierschin wrote:
>>
>>> As Jens
Understood, but in this case I'm not writing anything. I'm reading a file into
a NSData, and using these structs to put a frame onto the data in places so I
can extract data from the fields.
The alternative would be to pull out each data field one by one, which I'm sure
is also considered accep
Hi all,
I have a custom data model object with a number of properties of various basic
types. An array of these is managed by an NSArrayController and bound to an
NSTableView (as the reader might recall from my earlier thread). I am not
using Core Data.
I am now wiring in undo support. Were
>> As Jens mentioned, that doesn't make any sense. What good is a localized
>> comparison method if not for sorting a list for display? I suppose you could
>> be implying that Cocoa's sorting methods aren't optimized to assume
>> comparisons are transitive (or special cases problematic
>> strin
On May 7, 2012, at 13:35 , Martin Wierschin wrote:
> As Jens mentioned, that doesn't make any sense. What good is a localized
> comparison method if not for sorting a list for display? I suppose you could
> be implying that Cocoa's sorting methods aren't optimized to assume
> comparisons are tr
> So even if we get the right compare options,
> 'localizedCaseInsensitiveCompare:' may not be viable for strings *not* in the
> language of the current locale.
That seems extremely unlikely and would be short-sighted of Apple, considering
multilingual users and international information exchan
>>> If I'm right, then sort order and search order are different, and you can't
>>> expect to use a binary search here. (Not unless you originally used
>>> pair-wise 'localizedCaseInsensitiveCompare' to manually sort the list of
>>> strings.)
>>
>> All comparisons, including those used for the
No, it does not help. I think since I am not scaling the view or sth.
like that, the difference between frame and bounds should be
irrelevant for this problem.
Tae
On Sat, May 5, 2012 at 6:12 PM, Andy Lee wrote:
> On May 5, 2012, at 3:31 AM, qvacua wrote:
>> - (void)drawRect:(NSRect)dirtyRect {
On May 5, 2012, at 10:15 PM, Gerriet M. Denkmann wrote:
> My app (iOS 5.1) has a xib called MainWindow.xib which does NOT contain a
> window, just two objects, one of this is an UIApplicationDelegate.
>
> This UIApplicationDelegate has:
>
> - (void)applicationDidFinishLaunching:(UIApplication *
On Mon, May 7, 2012 at 8:06 AM, Charles Srstka wrote:
> Myself, I like to just spin off a method or function that takes a chunk of
> data and populates the fields of the struct one by one, instead of writing
> the data straight onto the struct. A little more code, but you know it’s
> going to w
I just added a blue + button to my iOS button graphics. It's almost 100%
accurate and should be good enough if anyone wants to reuse it.
The edges of the + inside the blue are not as sharp as Apple's, and the +
itself is almost pixel perfect, but I'm being a perfectionist here and can fix
tho
On May 7, 2012, at 2:28 AM, Quincey Morris wrote:
> On May 7, 2012, at 00:22 , Graham Cox wrote:
>
>> Is using the syntax you suggested considered better form than #pragma,?
>
> I have a vague recollection that #pragma pack was already deprecated in GCC,
> so __attribute__ ((packed)) might be t
On 07/05/12 09:39, Quincey Morris wrote:
On May 7, 2012, at 00:30 , Quincey Morris wrote:
On May 7, 2012, at 00:14 , Eric Matecki wrote:
mWindow = [[NSWindow alloc] initWithContentRect: contentSize styleMask:
styleMask backing: NSBackingStoreBuffered defer: YES];
I would assume that the co
Thank you all very much, it is much clearer to me now. I'm diving into
documentation now...
___
Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-a
On May 7, 2012, at 00:30 , Quincey Morris wrote:
> On May 7, 2012, at 00:14 , Eric Matecki wrote:
>
>>> mWindow = [[NSWindow alloc] initWithContentRect: contentSize styleMask:
>>> styleMask backing: NSBackingStoreBuffered defer: YES];
>
> I would assume that the content rect is here assumed to
On May 7, 2012, at 00:14 , Eric Matecki wrote:
>> mWindow = [[NSWindow alloc] initWithContentRect: contentSize styleMask:
>> styleMask backing: NSBackingStoreBuffered defer: YES];
I would assume that the content rect is here assumed to be relative to the main
screen. Have you tried 'initWithCon
On May 7, 2012, at 00:22 , Graham Cox wrote:
> Is using the syntax you suggested considered better form than #pragma,?
I have a vague recollection that #pragma pack was already deprecated in GCC, so
__attribute__ ((packed)) might be the more compatible choice, but finding
trustworthy, non-out-o
Thanks Quincey, it set me on the right track,
I used #pragma pack(4) for these structures (with relevant push and pops so
it's isolated to this case only) and it all started working fine.
Is using the syntax you suggested considered better form than #pragma,?
--Graham
On 07/05/2012, at 4:3
Hello,
nobody has an idea ?
On 03/05/12 10:27, Eric Matecki wrote:
Hi everybody,
I have two screens on my MacPro (10.7.3)
When opening a window with the following code :
// create a reference rect
NSRect contentSize = NSMakeRect( iX, iY, iW, iH );
// allocate window
NSUInteger styleMask =
N
31 matches
Mail list logo