Re: Dumb question about view controllers

2015-05-04 Thread Uli Kusterer
On 02 May 2015, at 20:18, William Squires wrote: > This is sort of in response to the thread, "Parent/child view controllers: > when shall we use it?". > > Since, in both iOS and Mac OS X, a control IS a view, why don't controls have > their own dedicated view controllers? i.e. If I make a new

Re: Dumb question about view controllers

2015-05-02 Thread Quincey Morris
On May 2, 2015, at 11:18 , William Squires wrote: > > Since, in both iOS and Mac OS X, a control IS a view, why don't controls have > their own dedicated view controllers? There’s a philosophy about containment, referring not the parent/subview relationship, but the geometric and behavioral ma

Re: Dumb question about view controllers

2015-05-02 Thread Jens Alfke
> On May 2, 2015, at 11:18 AM, William Squires wrote: > > why doesn't Xcode generate a template view controller (code) for the UILabel > (that is, UILabelViewController), just like there's a view controller for the > main view (usu. ViewController.h and ViewController.m, or - in swift, just >

Dumb question about view controllers

2015-05-02 Thread William Squires
This is sort of in response to the thread, "Parent/child view controllers: when shall we use it?". Since, in both iOS and Mac OS X, a control IS a view, why don't controls have their own dedicated view controllers? i.e. If I make a new single-view iOS project, and I put a UILabel in the main vi

Re: Another dumb question about NSWindowController(s)

2014-06-08 Thread Eric Shepherd
Anyone have awesome templates to share? :) Eric Shepherd Sent from my iPhone > On Jun 8, 2014, at 9:04 PM, Shane Stanley wrote: > >> On 9 Jun 2014, at 10:16 am, Graham Cox wrote: >> >> I really wish Xcode would allow us to make our own templates, even for NSxxx >> classes. > > You can. Copy

Re: Another dumb question about NSWindowController(s)

2014-06-08 Thread Graham Cox
On 9 Jun 2014, at 11:04 am, Shane Stanley wrote: > You can. Thanks! There's my morning's productivity gone, but I fully expect it to pay itself back. --Graham ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requ

Re: Another dumb question about NSWindowController(s)

2014-06-08 Thread Shane Stanley
On 9 Jun 2014, at 10:16 am, Graham Cox wrote: > I really wish Xcode would allow us to make our own templates, even for NSxxx > classes. You can. Copy this: /Applications/Xcode.app/Contents/Developer/Library/Xcode/Templates/File Templates/Cocoa/Objective-C class.xctemplate To here: ~/Librar

Re: Another dumb question about NSWindowController(s)

2014-06-08 Thread Eric Shepherd
On Jun 8, 2014, at 8:16 PM, Graham Cox wrote: > > >> On 8 Jun 2014, at 7:32 am, Lee Ann Rucker wrote: >> >> Delete that init method. Xcode has a standard template and doesn't change it >> when you tick the "make a xib file" checkbox. > > > I really wish Xcode would allow us to make our own

Re: Another dumb question about NSWindowController(s)

2014-06-08 Thread Graham Cox
On 8 Jun 2014, at 7:32 am, Lee Ann Rucker wrote: > Delete that init method. Xcode has a standard template and doesn't change it > when you tick the "make a xib file" checkbox. I really wish Xcode would allow us to make our own templates, even for NSxxx classes. The templates they do come wit

Re: Another dumb question about NSWindowController(s)

2014-06-07 Thread Seth Willits
initWithWindow: is the designated initializer which is why the template has it vs one other of the init methods, but it doesn't mean you have to use it. It's not there to tell you that you need to call it, it's there so you can add initialization-time code as needed. The easiest thing to do to

Re: Another dumb question about NSWindowController(s)

2014-06-07 Thread Lee Ann Rucker
ind some useful sample and start modifying it. - Original Message - From: "William Squires" To: "Cocoa Developers" Sent: Saturday, June 7, 2014 12:24:02 PM Subject: Another dumb question about NSWindowController(s) Okay, if I create a new NSWindowController subclass (and t

Another dumb question about NSWindowController(s)

2014-06-07 Thread William Squires
Okay, if I create a new NSWindowController subclass (and tell Xcode to generate the .xib as well), it gives me simple (too simple, I think) template code, whose init... method takes an NSWindow reference. Where does this come from (the reference)? • Is the code instantiating the custom NSWind

'nuther dumb question

2014-05-19 Thread William Squires
Why doesn't NSData have a +[NSData dataWithString:(NSString *)] or -[NSData initWithString:(NSString *)] method? i.e. how do I convert the contents of an NSString object into an NSData object? Why? Because -[NSFileHandle writeData:(NSData *)] takes an NSData object, not an NSString object. Ar

Re: 'nuther dumb question

2014-05-16 Thread Graham Cox
On 17 May 2014, at 9:46 am, William Squires wrote: > how do I convert the contents of an NSString object into an NSData object? > Why? Because -[NSFileHandle writeData:(NSData *)] takes an NSData object, not > an NSString object. Arrrgg. :( BTW, is there some reason you can't just use [N

Re: 'nuther dumb question

2014-05-16 Thread Graham Cox
On 17 May 2014, at 9:46 am, William Squires wrote: > Also, how come NSFileHandle doesn't have a -[NSFileHandle > readFileWithSeparator:(NSString *)] method so one can read in only chunks of > a file (of varying size, such as CSV records, or lines in a text file, > separated by \n, as opposed

Re: 'nuther dumb question

2014-05-16 Thread Graham Cox
[NSString dataUsingEncoding:] sometimes you have to look at the source object, not the destination (in fact usually, I'd say). Also, in this case, [NSData initWithString:] would lack the information needed to perform the conversion - you need to pass in what encoding you require. --Graham

Re: 'nuther dumb question

2014-05-16 Thread Sixten Otto
On Fri, May 16, 2014 at 4:46 PM, William Squires wrote: > Why doesn't NSData have a +[NSData dataWithString:(NSString *)] or > -[NSData initWithString:(NSString *)] method? i.e. how do I convert the > contents of an NSString object into an NSData object? Try -[NSString dataUsingEncoding:] or -

Re: 'nuther dumb question

2014-05-16 Thread Quincey Morris
On May 16, 2014, at 16:46 , William Squires wrote: > Why doesn't NSData have a +[NSData dataWithString:(NSString *)] or -[NSData > initWithString:(NSString *)] method? Because strings consist of *encoded* data, which (in principle) has no meaning outside the internals of the string itself**,

Re: Dumb question about unit testing

2012-11-20 Thread Graham Cox
On 21/11/2012, at 12:55 AM, William Squires wrote: > I was just wondering if there was some way to make an app that could > create/edit these saved objects directly at the binary level so I could make > sure of the intermediate results from option #1! The Property List Editor utility that co

Re: Dumb question about unit testing

2012-11-20 Thread William Squires
In other words, you bootstrapped the process, right? You generated a class that had encodeWithCoder:, wrote out the results, then went back and coded initWithCoder:, using the written out stuff to pull it back in? That's what I was thinking, too. I was just wondering if there was some way to m

Re: Dumb question about unit testing

2012-11-19 Thread Sean McBride
On Sun, 18 Nov 2012 21:26:09 -0600, William Squires said: >What's the recommended procedure for (unit) testing the initWithCoder: >and encodeWithCoder: methods of a class that conforms to NSCoding protocol? I do two things: 1) a test that encodes then immediately decodes, then compares the origi

Dumb question about unit testing

2012-11-18 Thread William Squires
What's the recommended procedure for (unit) testing the initWithCoder: and encodeWithCoder: methods of a class that conforms to NSCoding protocol? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator c

Re: Dumb question about radio buttons

2012-02-24 Thread William Squires
That's what I was looking for - now, back to my project... tomorrow! :) On Feb 23, 2012, at 2:04 PM, Seth Willits wrote: > On Feb 23, 2012, at 5:58 AM, William Squires wrote: > >> I have a custom view with an NSBox containing an NSMatrix of button cells >> (radio buttons) When I created the NSM

Re: Dumb question about radio buttons

2012-02-24 Thread Gideon King
Not sure about your number of items in your matrix, but you are wanting [sender selectedTag] to get the user's choice. Regards Gideon On 23/02/2012, at 11:58 PM, William Squires wrote: > > -(IBAction)baseChanged:(id)sender > { > int choice = [sender tag]; > } > > I always get, "user chose h

Re: Dumb question about radio buttons

2012-02-23 Thread Graham Cox
On 24/02/2012, at 12:58 AM, William Squires wrote: > I have a custom view with an NSBox containing an NSMatrix of button cells > (radio buttons) When I created the NSMatrix, I told it I wanted 3 of them, > but in the view hierarchy, I can see the NSMatrix under the NSBox, but it has > 4 butto

Re: Dumb question about radio buttons

2012-02-23 Thread Keary Suska
On Feb 23, 2012, at 6:58 AM, William Squires wrote: > I have a custom view with an NSBox containing an NSMatrix of button cells > (radio buttons) When I created the NSMatrix, I told it I wanted 3 of them, > but in the view hierarchy, I can see the NSMatrix under the NSBox, but it has > 4 butto

Re: Dumb question about radio buttons

2012-02-23 Thread Seth Willits
On Feb 23, 2012, at 5:58 AM, William Squires wrote: > I have a custom view with an NSBox containing an NSMatrix of button cells > (radio buttons) When I created the NSMatrix, I told it I wanted 3 of them, > but in the view hierarchy, I can see the NSMatrix under the NSBox, but it has > 4 butto

Dumb question about radio buttons

2012-02-23 Thread William Squires
I have a custom view with an NSBox containing an NSMatrix of button cells (radio buttons) When I created the NSMatrix, I told it I wanted 3 of them, but in the view hierarchy, I can see the NSMatrix under the NSBox, but it has 4 button cells under it, not the three I asked for - Is this an Xco

Re: Dumb question about multi-column NSTableViews

2011-07-04 Thread Scott Ribe
On Jul 4, 2011, at 5:29 PM, William Squires wrote: > Do individual table columns have a 'Tag' value that can be set so I can find > out which column the tableview delegate/datasource is working with? (I want > to set the tag value to an NSString that's the key value in an NSDictionary, > then f

Dumb question about multi-column NSTableViews

2011-07-04 Thread William Squires
Do individual table columns have a 'Tag' value that can be set so I can find out which column the tableview delegate/datasource is working with? (I want to set the tag value to an NSString that's the key value in an NSDictionary, then fetch the value for that key-value pair to set the contents o

Re: Dumb question about Core Data

2010-02-04 Thread John Bishop
uot; process). It's perfectly legal to populate relationships there too (ie: maybe every "Player" needs an array of "Things" when they're er. hatched). On Feb 4, 2010, at 8:04 PM, cocoa-dev-requ...@lists.apple.com wrote: > Message: 11 > Date: Thu, 4 Feb 2010

Re: Dumb question about Core Data

2010-02-04 Thread Hank Heijink (Mailinglists)
If you create your data model in Xcode with its data modeling facility, you can give it a default value right there, when you select the attribute (no need to recreate the Player.m and Player.h files). If you need to set different default values each time, just create the Player instance and set

Re: Dumb question about Core Data

2010-02-04 Thread Dave Carrigan
On Feb 4, 2010, at 5:13 PM, William Squires wrote: > Let's say I have an entity, "Player" that has some attributes (Name, Level, > XP, FightStr, DefenseStr, etc...) for a role-playing game. How do I > pre-initialize an entity with known values, when their properties are > @dynamic? I need for

Dumb question about Core Data

2010-02-04 Thread William Squires
Let's say I have an entity, "Player" that has some attributes (Name, Level, XP, FightStr, DefenseStr, etc...) for a role-playing game. How do I pre-initialize an entity with known values, when their properties are @dynamic? I need for a "blank" player to start out on level 1 with 0 XP, 0 Fi

Re: How do I get the version of AppKit.framework available in Cocoa Application Framework 10.5? Probably a dumb question I know..

2009-07-03 Thread Dave DeLong
there's been a long discussion recently on how to determine the OS version at runtime: http://www.cocoabuilder.com/archive/message/cocoa/2009/7/2/240095 HTH, Dave On Jul 3, 2009, at 2:41 AM, maxwellma...@gmail.com wrote: Hi Folks, sorry I know this is probably a dumb question. I'

How do I get the version of AppKit.framework available in Cocoa Application Framework 10.5? Probably a dumb question I know..

2009-07-03 Thread maxwellmac99
Hi Folks, sorry I know this is probably a dumb question. I'm new to Mac OS X development being a jaded Java bod coming over to the light. Very nice it is too. My problem is I need to call this method that seems to be in a later version of the AppKit.framework than is on my machine. The meth

Re: dumb question

2009-06-12 Thread Arie Pieter Cammeraat
do you also use it across several classes? Op 12-jun-2009, om 12:36 heeft Chunk 1978 het volgende geschreven: maybe this coffee hasn't kicked in yet and undoubtedly there is a simple solution, but i'm trying unsuccessfully to refactor some code, and i'd like to set the following as a static or

Re: dumb question

2009-06-12 Thread WT
I have the following in a project of mine, in a file Constants.h, which I import as needed from other source files: #define kAppFrame ([UIScreen mainScreen].applicationFrame) #define kScreenWidth([UIScreen mainScreen].bounds.size.width) #define kScreenHeight

Re: dumb question

2009-06-12 Thread Chunk 1978
not yet, just the one class... i assume to use it in other classes i would simply import the class that has the static definition... just don't know how to write the static definition. On Fri, Jun 12, 2009 at 6:41 AM, Arie Pieter Cammeraat wrote: > do you also use it across several classes? > > >

dumb question

2009-06-12 Thread Chunk 1978
maybe this coffee hasn't kicked in yet and undoubtedly there is a simple solution, but i'm trying unsuccessfully to refactor some code, and i'd like to set the following as a static or define instead of having it written several times in several methods -=-=-=- CGRect fullScreenRect = [[UIScreen m

Re: Potentially dumb question

2008-11-18 Thread I. Savant
On Tue, Nov 18, 2008 at 4:32 PM, Robert Mullen <[EMAIL PROTECTED]> wrote: > My application is not document based but does create certain files as a > byproduct and needs to be the default application for these file types as > well. If they are clicked or dragged to the dock icon of my application I

Potentially dumb question

2008-11-18 Thread Robert Mullen
My application is not document based but does create certain files as a byproduct and needs to be the default application for these file types as well. If they are clicked or dragged to the dock icon of my application I need to be able to display the contained information in a special displ

Re: A bit of a dumb question, but I need to know...

2008-11-11 Thread Shawn Erickson
On Tue, Nov 11, 2008 at 4:54 PM, Andrew Farmer <[EMAIL PROTECTED]> wrote: > On 11 Nov 08, at 15:17, Charles Steinman wrote: >> >> If you look at the QTKit documentation, it will tell you what's been >> available since when. Some things have been there since 10.3, while others >> were added in 10.5.

Re: A bit of a dumb question, but I need to know...

2008-11-11 Thread Andrew Farmer
On 11 Nov 08, at 15:17, Charles Steinman wrote: If you look at the QTKit documentation, it will tell you what's been available since when. Some things have been there since 10.3, while others were added in 10.5. However, I would not recommend distributing Apple's (or anyone else's) software

Re: A bit of a dumb question, but I need to know...

2008-11-11 Thread Charles Steinman
heir permission. Cheers, Chuck - Original Message > From: Jean-Nicolas Jolivet <[EMAIL PROTECTED]> > To: cocoa-dev@lists.apple.com > Sent: Tuesday, November 11, 2008 2:28:59 PM > Subject: A bit of a dumb question, but I need to know... > > I'm using the quick

Re: A bit of a dumb question, but I need to know...

2008-11-11 Thread Jean-Nicolas Jolivet
Thanks to both of you! I guess I don't have to copy it after all! :) Jean-Nicolas Jolivet Jean-Nicolas Jolivet wrote: I'm using the quick time framework in my App (QTKit/QTKit.h) for QTMovies and QTMovieView etc... Do I need to distribute it with my app (i.e. add a new Copy build phase), o

Re: A bit of a dumb question, but I need to know...

2008-11-11 Thread Nick Zitzmann
On Nov 11, 2008, at 3:28 PM, Jean-Nicolas Jolivet wrote: Do I need to distribute it with my app (i.e. add a new Copy build phase), or can I safely assume that everyone with OS X Tiger has the framework already?? (My app will require Tiger at least)... If a framework is in /System/Library/

Re: A bit of a dumb question, but I need to know...

2008-11-11 Thread Nathan
If I'm correct, it's a standard framework that everyone has. That being said, I've never used it myself so wait until an expert confirms or rebuked what said. Nate On Nov 11, 2008, at 5:28 PM, Jean-Nicolas Jolivet <[EMAIL PROTECTED] > wrote: I'm using the quick time framework in my App (QT

A bit of a dumb question, but I need to know...

2008-11-11 Thread Jean-Nicolas Jolivet
I'm using the quick time framework in my App (QTKit/QTKit.h) for QTMovies and QTMovieView etc... Do I need to distribute it with my app (i.e. add a new Copy build phase), or can I safely assume that everyone with OS X Tiger has the framework already?? (My app will require Tiger at least)...

Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?

2008-07-23 Thread Graham Cox
For zooming, check out NSView's -scaleUnitSquareToSize: which changes the scale factor of the view's transform. Together with -setFrame: (or -setFrameSize:) you can implement arbitrary zooming. If the view is enclosed by a scroller, it will adjust the scrollbars automatically, as well as an

Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?

2008-07-23 Thread Rick Mann
Thanks to everyone for their informative answers. I gotta say, I think the docs are a bit lacking, but maybe I just had certain assumptions going in (that a subview's frame should be contained within a superview's bounds, etc.) -- Rick ___ Cocoa

Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?

2008-07-23 Thread Erik Buck
As is the case with all NSViews, the frame of the view defines the area occupied by the view in its superview's coordinate system. The bounds of a view defines that view's own coordinate system irrespective of the frame. Therefore, if the frame size and bounds size for a particular view are d

Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?

2008-07-23 Thread Gordon Apple
You can look at the Sketch sample code for one way. You can lift SKTZoomingScrollView intact, although you may need to implement your own controller to extract related code from the Sketch document class. However, I have still to get it to work properly when using CALayers. Sketch scales the bou

Re: Dumb question: How does NSScrollView know the size of the thing it's scrolling?

2008-07-23 Thread Quincey Morris
On Jul 23, 2008, at 10:43, Rick Mann wrote: What attribute of the contained views does NSScrollView (or the NSScroller, whatever) use to determine what the scroll bars look like? I read the doc a couple times, but I couldn't quite figure it out. Is it the bounds.size of my contained view? W

Dumb question: How does NSScrollView know the size of the thing it's scrolling?

2008-07-23 Thread Rick Mann
What attribute of the contained views does NSScrollView (or the NSScroller, whatever) use to determine what the scroll bars look like? I read the doc a couple times, but I couldn't quite figure it out. Is it the bounds.size of my contained view? What if I'm setting a CoreGraphics CTM to zoo