Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread ecir hana
On Sat, Jul 7, 2012 at 6:30 AM, Ken Thomases wrote: > > > > Thank you. And please, can you explain to me why is it that case? Is it > simply because AppKit includes the definition of NSTextViewDelegate > protocol and not includes one for NSApplicationDelegate? > > Correct. > > > Is it somewhere d

Re: NSTextView scrolls to top when text storage changes

2012-07-06 Thread Martin Hewitson
OK, I found the problem. Turns out I had left the textview associated with more than one textstorage. I'm surprised that this was the only symptom. In detail, when switching tabs in the editor, I forgot to remove the textview from all other text containers before assigning it to the file associa

NSTextView scrolls to top when text storage changes

2012-07-06 Thread Martin Hewitson
Dear List, I have a document managing app which has a project search feature for searching through the project's managed files (see thread "Dynamic modification of text search results" earlier this week). When I find search matches I add an attribute to the textstorage in which the search ter

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread Ken Thomases
On Jul 6, 2012, at 1:01 PM, Stephen J. Butler wrote: > On Fri, Jul 6, 2012 at 4:35 AM, ecir hana wrote: >> Sorry I should've said that before: no, I'm on 10.6. >> >> But thanks for the reply! > > You're positive you're linking against the 10.6 SDK? Even if you're on > 10.6 you might be linking

Re: rotating NSBezierPath objects

2012-07-06 Thread Roland King
On 7 Jul, 2012, at 8:10 AM, William Squires wrote: > Okay, I see in the doc set that you can perform an NSAffineTransform on an > NSBezierPath, but how do I perform a rotation of the NSBezierPath about an > arbitrary CGPoint and with a specified angle in radians? Is this something > deep

Re: rotating NSBezierPath objects

2012-07-06 Thread Graham Cox
On 07/07/2012, at 10:10 AM, William Squires wrote: > Okay, I see in the doc set that you can perform an NSAffineTransform on an > NSBezierPath, but how do I perform a rotation of the NSBezierPath about an > arbitrary CGPoint and with a specified angle in radians? Exactly that - use [NSAffineT

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Erik Stainsby
On 2012-07-06, at 5:13 PM, Alex Zavatone wrote: > OK. I'm not sure what I ran into is related, but maybe it is. > > If you can isolate the line of code before the crash, can you check and NSLog > the string value of the selector being sent and see if it matches the > selectors on the obje

Re: Custom NSViews

2012-07-06 Thread Jens Alfke
On Jul 6, 2012, at 4:55 PM, William Squires wrote: > How do I get my ShapeView class (the custom NSView subclass) to have the > necessary code/declarations so that IB can see that it can originate an > action, just like an NSButton or other control (i.e. Ctrl-drag from the > control to the act

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Erik Stainsby
On 2012-07-06, at 5:28 PM, Erik Stainsby wrote: > On 2012-07-06, at 5:11 PM, Greg Parker wrote: > >> On Jul 6, 2012, at 4:48 PM, Erik Stainsby >> wrote: >>> 2012-07-04 20:44:02.980 Trixie[422:303] >>> -[RSReactionRule(RSReactionRuleFromPlugin) loadFromPlugin:]- [0015] >>> plugin.action: a

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Erik Stainsby
On 2012-07-06, at 5:11 PM, Greg Parker wrote: > On Jul 6, 2012, at 4:48 PM, Erik Stainsby wrote: >> 2012-07-04 20:44:02.980 Trixie[422:303] >> -[RSReactionRule(RSReactionRuleFromPlugin) loadFromPlugin:]- [0015] >> plugin.action: addClass >> 2012-07-04 20:44:02.981 Trixie[422:303] -[RSReactionR

Re: Custom NSViews

2012-07-06 Thread Alex Zavatone
iOS or Mac OS? On Jul 6, 2012, at 7:55 PM, William Squires wrote: > Okay, I've got my custom NSView subclass to draw my Shape objects (or > subclasses thereof). Each Shape inherits or overrides: > > -(BOOL)shapeContainsPoint:(CGPoint)thePoint; > > Now, I want to detect clicks within the view

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Alex Zavatone
OK. I'm not sure what I ran into is related, but maybe it is. I was calling performSegueWithIdentifier on a storyboard action and passing in the exact segue name. Instant SIGABRT. Checked the wiring up of all outlets and such. Everything was fine. I did have two storyboards, one in Fren

rotating NSBezierPath objects

2012-07-06 Thread William Squires
Okay, I see in the doc set that you can perform an NSAffineTransform on an NSBezierPath, but how do I perform a rotation of the NSBezierPath about an arbitrary CGPoint and with a specified angle in radians? Is this something deep in CoreGraphics, or CoreAnimation? If not, I can do the trigonom

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Greg Parker
On Jul 6, 2012, at 4:48 PM, Erik Stainsby wrote: > 2012-07-04 20:44:02.980 Trixie[422:303] > -[RSReactionRule(RSReactionRuleFromPlugin) loadFromPlugin:]- [0015] > plugin.action: addClass > 2012-07-04 20:44:02.981 Trixie[422:303] -[RSReactionRule setAction:]: > unrecognized selector sent to inst

Custom NSViews

2012-07-06 Thread William Squires
Okay, I've got my custom NSView subclass to draw my Shape objects (or subclasses thereof). Each Shape inherits or overrides: -(BOOL)shapeContainsPoint:(CGPoint)thePoint; Now, I want to detect clicks within the view and iterate over all the objects the view is responsible for, and send them

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Erik Stainsby
On 2012-07-06, at 12:46 PM, Greg Parker wrote: > On Jul 5, 2012, at 7:50 PM, Erik Stainsby wrote: >> My project employs a framework which loads several plugins. When the user >> interacts with these plugins s/he generates an intermediate abstraction of >> the plugin contents which I refer to

Re: Modal event processing

2012-07-06 Thread Graham Cox
On 07/07/2012, at 6:02 AM, Charlie Dickman wrote: > In my view's drawRect method I use a global state variable that defines the > next function to perform. When drawRect gets called I do what is necessary > for the current state, set up for the next state, set the value for the next > state an

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread Kyle Sluder
On Fri, Jul 6, 2012, at 10:00 PM, ecir hana wrote: > On Fri, Jul 6, 2012 at 8:01 PM, Stephen J. Butler > wrote: > > > > > You're positive you're linking against the 10.6 SDK? Even if you're on > > 10.6 you might be linking against the 10.5 SDK and that would explain > > your problem perfectly. > >

Re: Modal event processing

2012-07-06 Thread Richard Altenburg (Brainchild)
Fritz Anderson's comments are very important, in that you do not control the state of your animation in the drawRect: but instead handle that from a calling method (like the one in your controller which is called from your timer). drawRect: is not fully under your control nor should you try to d

Re: Modal event processing

2012-07-06 Thread Fritz Anderson
On 6 Jul 2012, at 3:02 PM, Charlie Dickman wrote: > In my view's drawRect method I use a global state variable that defines the > next function to perform. When drawRect gets called I do what is necessary > for the current state, set up for the next state, set the value for the next > state and

Re: Modal event processing

2012-07-06 Thread Charlie Dickman
I just had a look at the NSAnimation class document and it actually suggests very prominently that, because of the limited capabilities of an NSAnimation, an NSTimer be used. I also just went back over the architecture of my app with Uli's comments in mind and have discovered that I think I am

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread ecir hana
On Fri, Jul 6, 2012 at 8:01 PM, Stephen J. Butler wrote: > > You're positive you're linking against the 10.6 SDK? Even if you're on > 10.6 you might be linking against the 10.5 SDK and that would explain > your problem perfectly. > > NSAppKitVersionNumber says "1038.36" which is 10.6.

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Greg Parker
On Jul 5, 2012, at 9:24 PM, Graham Cox wrote: > If so, I don't think that will work. When your app is loaded and linked when > it's launched, the category won't be attached to the class 'MyClass' because > it doesn't exist. It is only loaded and linked when the plug-in is loaded, > but the runt

Re: Is this an incorrect use of categories ?

2012-07-06 Thread Greg Parker
On Jul 5, 2012, at 7:50 PM, Erik Stainsby wrote: > My project employs a framework which loads several plugins. When the user > interacts with these plugins s/he generates an intermediate abstraction of > the plugin contents which I refer to as a rule. The rule abstraction exists > to facilitate

Re: Window-Frame Controls in Lion

2012-07-06 Thread Alex Zavatone
On Jul 5, 2012, at 9:43 PM, Richard Somers wrote: > Controls in the window-frame area (that is, in the toolbar or bottom bar) > normally have a textured style as stated in the OS X Human Interface > Guidelines. In 10.7 Lion textured controls became semi-transparent with some > of the backgroun

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread Stephen J. Butler
On Fri, Jul 6, 2012 at 4:35 AM, ecir hana wrote: > Sorry I should've said that before: no, I'm on 10.6. > > But thanks for the reply! You're positive you're linking against the 10.6 SDK? Even if you're on 10.6 you might be linking against the 10.5 SDK and that would explain your problem perfectly

Fwd: Need sample code for NSDocument / NSDocumentController

2012-07-06 Thread Keith Knauber
There is no sample code for the new -[NSDocumentController openDocumentWithContentsOfURL:display:completionHandler:] Why is there no sample project for a standard NSDocumentController/NSDocument based app? Can someone provide sample code for how to migrate from the deprecated - (id)openDocumentW

Re: Window-Frame Controls in Lion

2012-07-06 Thread Fritz Anderson
On 5 Jul 2012, at 8:43 PM, Richard Somers wrote: > Does this bother anyone else besides me? Are you asking for an advocacy opinion, or something practical that a forum dedicated to support for developing applications with Cocoa can help you with? If the latter, I don't believe you can do what y

Re: Modal event processing

2012-07-06 Thread Richard Altenburg (Brainchild)
In a situation similar to yours, I ended up replacing the NSTimer with an NSAnimation. The animation I was doing was way faster after this tiny change, plus the user interface was not blocked at all. I refresh my animation 30 times per second now without any negative effect for the user. I think

Re: Modal event processing

2012-07-06 Thread Graham Cox
On 06/07/2012, at 11:38 PM, Charlie Dickman wrote: > I'll have to re-architect the app. Maybe. The thing that's key is that you do not run the event loop - it runs you (we're in Soviet Russia now). It also runs any timers which are attached to it. Timers do not (and can not) run the event lo

Re: Modal event processing

2012-07-06 Thread Charlie Dickman
Uli, Thanks for the education. The way you suggest is what I did pre-OS X and Xcode/Cocoa and I didn't have this problem Being self taught (by books, sample code and documentation) in programming in Xcode/Cocoa for OS X and IOS it sounds like I started off on the wrong foot with the versatility

Re: Modal event processing

2012-07-06 Thread Charlie Dickman
Actually, no, I'm not trying to mimic user interaction but that's an idea worth thinking about. The program demonstrates how to play Chinese Mah-Jong as described in A.D. Millington's (excellent) book "The Complete Book of Mah-Jong so it runs on a timer driven dispatcher to have each player in

RE: wacky image stretching on rotation (repost)

2012-07-06 Thread Julius Oklamcak
I would suspect that the UIImageView's autoresizingMask might be the culprit - if it isn't UIViewAutoresizingNone, then the frame may be resizing itself when rotated. Sometimes it is less trouble to create your own UITableViewCell subclass and have full control over your subviews instead of trying

Re: Modal event processing

2012-07-06 Thread Uli Kusterer
On 05.07.2012, at 21:57, Charlie Dickman wrote: > I have a demonstration app that is basically operating on a 0.15 second timer > loop. The problem I am having is that even with a periodic timer going off it > is very difficult to get menu events and mouse clicks in window controls > through to

Re: wacky image stretching on rotation (repost)

2012-07-06 Thread Gavin Stokes
Thanks for the reply, Julius. I had the mode set to UIViewContentModeScaleToFill. Setting it to UIViewContentModeCenter does allow the image to rotate undistorted, but the frame is still ridiculously distorted. And look at the massive difference in distortion for a tiny difference in angle betwe

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread ecir hana
On Fri, Jul 6, 2012 at 11:56 AM, Ken Thomases wrote: > > Is there a way to get NSApplicationDelegate protocol besides the > > compile-time "@protocol()"? > > No. The run-time information about the protocol is obtained from > information that would have to have been baked into the executable at b

RE: Xcode 4.3, XIB files and deployment target iOS 3.1

2012-07-06 Thread Julius Oklamcak
Presuming that the firstgen iPod touch has iOS 3.x on it, it is probably crashing here: > self.window.rootViewController = self.tabBarController; Since rootViewController was introduced to UIWindow in iOS 4.0. Pre-iOS 4.0 you need to use (from what I recall): [self.window addSubview:self.tabBarC

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread Ken Thomases
On Jul 6, 2012, at 3:30 AM, ecir hana wrote: > I'm trying to get the methods a protocol specifies and just stumbled upon > one problem: the following code returns NULL: > >Protocol *protocol = objc_getProtocol("NSApplicationDelegate"); > > I saw ( > http://stackoverflow.com/questions/1021211

RE: wacky image stretching on rotation (repost)

2012-07-06 Thread Julius Oklamcak
Check self.thumbImageView.contentMode - it's probably the default UIViewContentModeScaleToFill (should be UIViewContentModeCenter). Also ensure that the UIImage that you provide really has square dimensions. I had the exact same issue when rotating the UIImageView of a UIButton... > I have a UIIma

Xcode 4.3, XIB files and deployment target iOS 3.1

2012-07-06 Thread John Michael Zorko
Hello, all ... I'm working on an app that has to work on first-gen iPod touch devices. I set the deployment target to 3.1 and made sure armv6 was specified such that my app now at least launches on said firstgen iPod touch. However, it hangs before showing the tab bar or first view controller:

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread ecir hana
Sorry I should've said that before: no, I'm on 10.6. But thanks for the reply! On Fri, Jul 6, 2012 at 11:14 AM, Stephen J. Butler wrote: > On Fri, Jul 6, 2012 at 3:30 AM, ecir hana wrote: > > I'm trying to get the methods a protocol specifies and just stumbled upon > > one problem: the followi

Re: Getting NSApplicationDelegate protocol

2012-07-06 Thread Stephen J. Butler
On Fri, Jul 6, 2012 at 3:30 AM, ecir hana wrote: > I'm trying to get the methods a protocol specifies and just stumbled upon > one problem: the following code returns NULL: > > Protocol *protocol = objc_getProtocol("NSApplicationDelegate"); Are you trying this on 10.5? Or are you building thi

Getting NSApplicationDelegate protocol

2012-07-06 Thread ecir hana
Hello, I'm trying to get the methods a protocol specifies and just stumbled upon one problem: the following code returns NULL: Protocol *protocol = objc_getProtocol("NSApplicationDelegate"); I saw ( http://stackoverflow.com/questions/10212119/objc-getprotocol-returns-null-for-nsapplicationde

wacky image stretching on rotation (repost)

2012-07-06 Thread Gavin Stokes
I have a UIImageView in a custom TableViewCell that I want to rotate to arbitrary angles. When I apply a rotation transformation like so: CGAffineTransform rotation = CGAffineTransformMakeRotation(15 * (M_PI / 180)); [self.thumbImageView setTransform:rotation]; The image is not only rotated but

Re: Tab Bar Item naming convention?

2012-07-06 Thread Takeichi Kanzaki Cabrera
On Fri, Jul 6, 2012 at 7:31 AM, Laurent Daudelin wrote: > I've read all the documentation about the subject, did google everything I > could think of, but I still don't know how to name tab bar item icons. The > documentation recommends a standard icon of 20 x 20 and a high resolution one > at