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: Objective-C Question

2013-03-12 Thread Graham Cox
On 13/03/2013, at 6:53 AM, Dave wrote: > If that is the case, then how do you signal to the compiler/analyzer that you > are returning a retained object? In general you shouldn't return a retained object (unless it's temporarily retained and will be autoreleased of course). If you are routine

Re: Objective-C Question

2013-03-12 Thread Graham Cox
On 13/03/2013, at 2:41 AM, Dave wrote: > So, what is it? Wind up merchant or Moron? > I don't think there's any need for this. If I caused offence, it was unintended (I sometimes have trouble anticipating how others might receive statements I make, that's just something I have to live with)

Re: Snapping windows while moving

2013-03-12 Thread Steve Mills
On Mar 12, 2013, at 15:29:53, Seth Willits wrote: > Pretty sure you want to subclass and override constrainFrameRect:toScreen: > but I can't recall off the top of my head whether this is called live for > every movement. I believe it is. Nope. It only seems to be called when the window is bei

Re: Snapping windows while moving

2013-03-12 Thread Seth Willits
On Mar 12, 2013, at 1:11 PM, Steve Mills wrote: > What's the best way to go about snapping windows to screens and other windows > while dragging the window? I've tried catching it in windowDidMove (only when > the mouse is down), but that isn't called for every single movement of the > mouse. I

Snapping windows while moving

2013-03-12 Thread Steve Mills
What's the best way to go about snapping windows to screens and other windows while dragging the window? I've tried catching it in windowDidMove (only when the mouse is down), but that isn't called for every single movement of the mouse. I haven't been able to find anything equivalent to the old

Re: Objective-C Question

2013-03-12 Thread Dave
On 12 Mar 2013, at 19:38, Jean-Daniel Dupas wrote: Le 12 mars 2013 à 20:15, Dave a écrit : On 12 Mar 2013, at 18:50, Jens Alfke wrote: On Mar 12, 2013, at 9:44 AM, John McCall wrote: However, that wouldn't be an idiomatic implementation. The usual expectation is that allocating met

Re: Objective-C Question

2013-03-12 Thread Jean-Daniel Dupas
Le 12 mars 2013 à 20:15, Dave a écrit : > > On 12 Mar 2013, at 18:50, Jens Alfke wrote: > >> >> On Mar 12, 2013, at 9:44 AM, John McCall wrote: >> >>> However, that wouldn't be an idiomatic implementation. The usual >>> expectation is that allocating methods, like +new methods, construct

Re: Objective-C Question

2013-03-12 Thread Dave
On 12 Mar 2013, at 18:50, Jens Alfke wrote: On Mar 12, 2013, at 9:44 AM, John McCall wrote: However, that wouldn't be an idiomatic implementation. The usual expectation is that allocating methods, like +new methods, construct an object *of type self* (at least). Are you just quibbling

Re: Objective-C Question

2013-03-12 Thread Jens Alfke
On Mar 12, 2013, at 9:44 AM, John McCall wrote: > However, that wouldn't be an idiomatic implementation. The usual expectation > is that allocating methods, like +new methods, construct an object *of type > self* (at least). Are you just quibbling about the prefix “new-“? The specific method

Re: Another Gnarly Objective-C Question!

2013-03-12 Thread Jens Alfke
On Mar 12, 2013, at 2:08 AM, Graham Cox wrote: > 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 [super class] and so > on is wholly unnecessary to correctly use class methods. Agreed. This can be confusing t

Re: Objective-C Question

2013-03-12 Thread Dave
On 12 Mar 2013, at 16:44, John McCall wrote: There is exactly one difference between [[self superclass] newDict] and [super newDict] here: the value of 'self'. (This assumes the obvious behavior for +superclass, of course.) [[self superclass] newDict] is exactly equivalent to [Subclass1

Re: Problem with using a Navigation Controller in Xcode

2013-03-12 Thread gary . gardner
Matt, Step #7 was delete what's there. Perhaps I was not clear. In the Storyboard, I delete it. Step #8 I add a UIViewController. Sorry if that caused confusion 1) Launch XCode 2) Create a new project 3) Select Single View Application 4) Give a Project Name 5) Select Device iPhone 6) Click on

Re: Freshly created .xcmappingmodel seems to have incorrect version hashes

2013-03-12 Thread Sean McBride
On Mon, 17 Dec 2012 17:37:22 -0500, Sean McBride said: >I created a brand new .xcmappingmodel for version x to y of my >xcdatamodel. I don't change anything in the mapping GUI. I clean. I >build. I write some test code: > >NSURL* url = ...App.app/Contents/Resources/VersionXToY.cdm >mappingMode

Re: UITableViewController init not called (storyboard)

2013-03-12 Thread Damian Carrillo
The particular initializer in use is initWithCoder: UITableView conforms to the NSCoding protocol. Hope this helps. Damian On Mar 12, 2013, at 11:09 AM, Koen van der Drift wrote: > I'm playing around with a storyboard app on iOS. To test a TableView I > created a UITableViewController sub

Re: Objective-C Question

2013-03-12 Thread John McCall
On Mar 12, 2013, at 12:31 AM, Dave wrote: > On 11 Mar 2013, at 21:45, John McCall wrote: >> On Mar 11, 2013, at 2:02 PM, Dave wrote: >>> On 11 Mar 2013, at 20:53, John McCall wrote: On Mar 11, 2013, at 1:33 PM, Dave wrote: > On 11 Mar 2013, at 20:26, Mike Abdullah wrote: >>> >>

Re: UITableViewController init not called (storyboard)

2013-03-12 Thread Koen van der Drift
On Mar 12, 2013, at 12:32 PM, Ten Horses | Diederik Meijer wrote: > Have you tried moving those datasource codelines to viewDidLoad or > viewWillAppear? It may be that when the view is instantiated from the > storyboard init is not called? > I thought about that, and yes it works. I was hes

Re: Problem with using a Navigation Controller in Xcode

2013-03-12 Thread Matt Neuburg
On Mon, 11 Mar 2013 09:19:23 -0600, gary.gard...@brokensoftware.com said: >10) Drag a Navigation Controller to the storyboard window >11) Click on the root view controller view Yes, but the problem is that the default root view controller (11) that you get when drag a navigation controller into

Re: UITableViewController init not called (storyboard)

2013-03-12 Thread Ten Horses | Diederik Meijer
Have you tried moving those datasource codelines to viewDidLoad or viewWillAppear? It may be that when the view is instantiated from the storyboard init is not called? Op 12 mrt. 2013, om 17:09 heeft Koen van der Drift het volgende geschreven: > I'm playing around with a storyboard app on i

UITableViewController init not called (storyboard)

2013-03-12 Thread Koen van der Drift
I'm playing around with a storyboard app on iOS. To test a TableView I created a UITableViewController subclass, and set it as the custom class in the storyboard. Then in the init method, I added a bunch of objects to act as the datasource, however init never gets called, and my tableview remain

Re: Objective-C Question

2013-03-12 Thread Dave
On 12 Mar 2013, at 13:37, Graham Cox wrote: On 12/03/2013, at 11:45 PM, Dave wrote: Except it doesn't do what the above does! Yes it does. Oh No it doesn't! It creates a copy of read only dictionary and then modifies that. If the underlying dictionary changes, you will not see th

Re: Fast user switching notifications

2013-03-12 Thread Jean-Daniel Dupas
Le 11 mars 2013 à 23:25, Jean Suisse a écrit : > Dear All, > > There may be several approaches to solve the issue I am about to describe, > either on the userland side or on the kernel side... or in-between, using a > daemon. > > Current situation > A bsd kernel extension communicates with a

Re: Objective-C Question

2013-03-12 Thread Graham Cox
On 12/03/2013, at 11:45 PM, Dave wrote: > Except it doesn't do what the above does! Yes it does. >> >> @implementation DF2 >> + (NSDictionary*) dictionary >> { >> NSMutableDictionary* md = [[super dictionary] mutableCopy]; >> // add extra items to md >> return [md autorelease

Re: Objective-C Question

2013-03-12 Thread Dave
Hi, What I have works fine now, but to explain: Basically I have just a Class definition, e.g. Class theClass; I can't instantiate the class (not that I'd consider that anyway), because I have no idea what side effects calling the init method of the class would be, it mi

Re: Issue with makeKeyAndOrderFront

2013-03-12 Thread Ken Thomases
On Mar 12, 2013, at 3:28 AM, anni saini wrote: > Thanks Ken. That works but this property doesn't make it active window. Is your app already the active app at the time you show this window? If not and you want it to be then (as you noted), you should invoke -[NSApplication activateIgnoringOthe

Re: Another Gnarly Objective-C Question!

2013-03-12 Thread Graham Cox
On 12/03/2013, at 7:39 PM, Dave wrote: > Hi All, > > Thanks for all help on the last question, here is one on a similar vein: > > This is all Class methods, no instances are allocated or intended to be > allocated at this stage. > > in + Method in a subclass: > > [[self class] someMethod];

Re: Objective-C Question

2013-03-12 Thread Graham Cox
On 12/03/2013, at 6:31 PM, Dave wrote: > I don't think you understand the difference between class methods and > instance methods. Are you certain you do? > Here is an example of what I mean: Why not state you goals instead of give us a lump of incoherent code? As far as I can see you don

Another Gnarly Objective-C Question!

2013-03-12 Thread Dave
Hi All, Thanks for all help on the last question, here is one on a similar vein: This is all Class methods, no instances are allocated or intended to be allocated at this stage. in + Method in a subclass: [[self class] someMethod]; This calls +someMethod in the current class, if it exists,

Re: Issue with makeKeyAndOrderFront

2013-03-12 Thread anni saini
Thanks Ken. That works but this property doesn't make it active window.   Regards, Anni From: Ken Thomases To: anni saini Cc: "cocoa-dev@lists.apple.com" Sent: Monday, 11 March 2013 7:31 PM Subject: Re: Issue with makeKeyAndOrderFront On Mar 11, 2013, at 3:

Re: Objective-C Question

2013-03-12 Thread Dave
On 11 Mar 2013, at 21:14, Mike Abdullah wrote: if from an instance + Method I do: [super someMethod], then surely it's an error because this isn't an instance? It *is* an instance. An instance of the *metaclass*. This is where you're deep into the guts of Objective-C :) H, I think

Re: Objective-C Question

2013-03-12 Thread Dave
On 11 Mar 2013, at 21:45, John McCall wrote: On Mar 11, 2013, at 2:02 PM, Dave wrote: On 11 Mar 2013, at 20:53, John McCall wrote: On Mar 11, 2013, at 1:33 PM, Dave wrote: On 11 Mar 2013, at 20:26, Mike Abdullah wrote: I had assumed (and I thought I'd done something like this befor