Re: ibtool and genstrings do nothing

2014-01-31 Thread Jonathan Hess
___ 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-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.co

Re: Outlets Not Connected In awakeFromNib

2011-03-09 Thread Jonathan Hess
On Mar 3, 2011, at 3:31 AM, Uli Kusterer wrote: > On 02.03.2011, at 10:54, Andreas Grosam wrote: >> I have a very basic custom UIViewController with its own associated nib >> file. This view controller is the "root view controller" of a Navigation >> Controller which is itself embedded within a

Re: Cocoa/Objective-C flat name space problems

2010-12-05 Thread Jonathan Hess
On May 6, 2010, at 7:27 PM, Stephen Blinkhorn wrote: > Thanks Isaac, > > On 6 May 2010, at 16:35, Isaac Wankerl wrote: > >> With #2, you might want to investigate using ibtool and the --convert option >> to modify the nibs. Just from reading the man page, it looks like that >> might work if

Re: Cocoa/Objective-C flat name space problems

2010-05-06 Thread Jonathan Hess
On May 6, 2010, at 7:27 PM, Stephen Blinkhorn wrote: > Thanks Isaac, > > On 6 May 2010, at 16:35, Isaac Wankerl wrote: > >> With #2, you might want to investigate using ibtool and the --convert option >> to modify the nibs. Just from reading the man page, it looks like that >> might work if

Re: How to find all clipping siblings for a view?

2010-04-17 Thread Jonathan Hess
On Apr 17, 2010, at 12:50 PM, Alexander Bokovikov wrote: > > On 18.04.2010, at 1:29, Jonathan Hess wrote: > >> >> On Apr 16, 2010, at 10:47 AM, Kyle Sluder wrote: >> >>> On Fri, Apr 16, 2010 at 10:37 AM, Corbin Dunn wrote: >>>> You can&#x

Re: How to find all clipping siblings for a view?

2010-04-17 Thread Jonathan Hess
On Apr 16, 2010, at 9:48 AM, Kyle Sluder wrote: >> It works OK with non layer-backed views in my experience, but you do get a >> build warning if sibling views overlap in a nib. Sibling views are drawn in >> the order they appear in the parent's list of subviews (or possibly the >> inverse or

Re: How to find all clipping siblings for a view?

2010-04-17 Thread Jonathan Hess
On Apr 16, 2010, at 10:47 AM, Kyle Sluder wrote: > On Fri, Apr 16, 2010 at 10:37 AM, Corbin Dunn wrote: >> You can't control it in IB (short of removing the view and adding it back >> in). But in code, you can just call -addSubview:positioned:relativeTo: to >> move views around in the Z order.

Re: Unembed Objects

2010-01-18 Thread Jonathan Hess
On Jan 18, 2010, at 3:50 PM, David Blanton wrote: > I have embeded two views in a split view then embeded that result with > another view in a split view to get a resulting vert splitter and horz > splitter. > > Now I would like to Uembed an cannot no matter what selections I do get > Uembed

Re: Strange Problems with IBPlugin

2009-12-28 Thread Jonathan Hess
On Dec 26, 2009, at 9:38 PM, Carter Allen wrote: > Hello! > > Thanks in advance, I know this is a lot to ask. I am working on a framework > of custom classes for my own personal use, and it was going very well until > I started to work on the Interface Builder plugin part. Download the > non-wor

Re: pump event

2009-10-26 Thread Jonathan Hess
Perhaps you're looking for these methods: -[NSApplication currentEvent] -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] Documented here: http://developer.apple.com/mac/library/documentation/Cocoa/Reference/ApplicationKit/Classes/NSApplication_Class/Reference/Reference.html Goo

Re: Problems calling a method from an IB-created instance...

2009-10-08 Thread Jonathan Hess
On Oct 5, 2009, at 12:59 PM, Jeff Diamond wrote: This concept is so fundamental, but I've seen no specific docs about it, and I haven't succeeded with this after almost 2 years of trying an reading every tutorial and mail list on the web. As near as I understand it, what Cocoa calls "outl

Re: Cannot get pixel color from NSBitmapImageRep

2009-10-01 Thread Jonathan Hess
On Oct 1, 2009, at 1:22 AM, David Hirsch wrote: > In the code below, the TIFF gets saved correctly (transparent but for the red > square), but when I query the pixel at (40,40) which should be in the middle > of the red square, I get a black pixel (r==g==b==a==0.0): > offscreenRep = [[NSB

Re: NSApplication's behavior

2009-10-01 Thread Jonathan Hess
On Sep 30, 2009, at 7:50 PM, Mark Hurley wrote: > Still learning the Cocoa Window Architecture... > Goal: I want to separate my MainWindow out of MainMenu.xib into its own > .xib: MainView.xib. > > 1) I create a new Cocoa Application (not document-based) > > 2) I create a MainWindow.xib and M

Re: Debugging IB 3.2 problem

2009-09-21 Thread Jonathan Hess
On Sep 21, 2009, at 11:54 AM, Robert Mullen wrote: I have a problem with IB 3.2 in one of my plugins. I get the following error message: ibtool failed with exception: Some objects didn't get the ibBeginArchivingDocument:withContext: callback. A class has probably overriden the method wit

Re: Interface Builder .xib deployment/development targets

2009-09-16 Thread Jonathan Hess
spinning with a beach ball? If so, have you tried asking a user to sample the problem with "sample MyProgramName" from the terminal? That will tell you what your program is doing as it hangs. Jon Hess Steve On Sep 16, 2009, at 1:22 PM, Jonathan Hess wrote: On Sep 16, 2009, at 12:46

Re: Interface Builder .xib deployment/development targets

2009-09-16 Thread Jonathan Hess
On Sep 16, 2009, at 12:46 AM, Steve Cronin wrote: Folks; Got another report today from the field also a MacBookPro5,1 running 10.5.8 2009-09-16 03:01:53.954 XYZ[329:20b] Error loading /Library/ ScriptingAdditions/QXPScriptingAdditions.osax/Contents/MacOS/ QXPScriptingAdditions: dlopen(/Lib

Re: Why would NSViewController loadView fail?

2009-08-31 Thread Jonathan Hess
I would try running with zombies. It sounds like one of the objects loaded by the NIB file is being over released. Jon Hess On Aug 31, 2009, at 1:55 PM, Eric Gorr wrote: On Aug 31, 2009, at 3:58 PM, Kyle Sluder wrote: On Mon, Aug 31, 2009 at 12:26 PM, Eric Gorr wrote: Building and runni

Re: Why would NSViewController loadView fail?

2009-08-31 Thread Jonathan Hess
On Aug 28, 2009, at 1:36 PM, Eric Gorr wrote: I am pretty sure I've got my .xib setup correctly, but when I call loadView on my View Controller, my application crashes. Unfortunately, I am not getting any useful information out of the crash. The only thing I appear to have is a stack trace

Re: devil of a time with an NSImageView

2009-08-20 Thread Jonathan Hess
c. A couple of weeks ago on this list, one of our Apple experts (Luke, maybe, but I can't remember for sure) said to use the more specialized method (such as 'windowDidLoad') *instead of* the generic 'awakeFromNib', if the class has it. I missed that thread. Do you happen to know some keywo

Re: devil of a time with an NSImageView

2009-08-19 Thread Jonathan Hess
tell it to load a NIB, but the NIB file also instantiates a second instance of the class because the File's Owner was misunderstood. Hope that helps - Jon Hess On Aug 19, 2009, at 5:28 PM, Jack Carbaugh wrote: The result is null. On Aug 19, 2009, at 8:04 PM, Jonathan Hess wrote:

Re: devil of a time with an NSImageView

2009-08-19 Thread Jonathan Hess
What happens if you include this log to your setImage method? NSLog(@"image view: %@", boxPic); Also, rather than logging you should see if you can find the time to learn to use the debugger. It's much more efficient than printf debugging. Good Luck - Jon Hess On Aug 19, 2009, at 2:31 PM,

Re: UITextView Doesn't seem to function

2009-07-16 Thread Jonathan Hess
Have you verified that the "about" pointer is actually set to point to a text field? If it was nil, it would explain the behavior your describing. Jon Hess On Jul 16, 2009, at 6:52 PM, Development wrote: Ok, I have tried: about.text = @"About text"; and [about setText:@"About Text"] but

Re: ibtool and genstrings do nothing

2009-07-16 Thread Jonathan Hess
ibtool -generate-strings-file MainWindow.nib MainWindow.xib Will invoke ibtool, and tell it to open MainWindow.xib and then read all the localizable strings out of that XIB, and then write them into the argument of the "-generate-strings-file" argument. So after running that command, ibtool

Re: Saving NSArray of custom objects

2009-07-13 Thread Jonathan Hess
Hey dkj - The method -[NSArray writeToFile: atomically:] uses property list serialization, and property lists support a fixed set of types. You want to serialize your NSArray with an NSCoder, like NSKeyedArchiver, and then read it back in with NSKeyedUnarchiver. Take a look at these two m

Re: Interface Builder Questions...

2009-07-06 Thread Jonathan Hess
On Jun 28, 2009, at 12:59 PM, Phil Hystad wrote: I am new to Interface Builder and I am still trying to figure out some subtle details of how things work. And, my frustration level is growing because although I have access to a very rich set of documentation, a number of questions I have

Re: selecting tab in a tabless NSTabView in IB

2009-06-07 Thread Jonathan Hess
On Jun 7, 2009, at 9:13 PM, Rob Keniger wrote: On 06/06/2009, at 6:08 AM, Stephen Blinkhorn wrote: Does anyone know if it is possible to change the current tab in a tabless NSTabView from within Interface Builder without having to go into the inspector and change tabless style to top tabs

Re: (newbie) help with combining navigation controller and tab bar controller

2009-06-05 Thread Jonathan Hess
Hey Beth - You should be able to drag a navigation controller from IB's Library directly into the on screen editor (window) for the UITabBarController. Assuming you started with the default tab bar controller, at this point you will have produced a document with this structure: MainWind

Re: XIB and AppleGlot

2009-06-05 Thread Jonathan Hess
On Jun 5, 2009, at 3:38 AM, Eric Slosser wrote: On Jun 4, 2009, at 8:46 PM, Jonathan Hess wrote: On Jun 4, 2009, at 6:28 AM, Eric Slosser wrote: (Sorry if this is OT, I couldn't find a better apple-hosted list...) How does one use AppleGlot and XIBs? I have an app, "My.app&

Re: Should touch events related to a given view be implemented in the view or the view controller?

2009-06-04 Thread Jonathan Hess
Hey Michael - It might help to approach this problem with the idea of "If I had multiple view controllers using this view, how would I make that work best". Event handling is something you would normally manage at the UIView layer. After those events are handled, they're typically transla

Re: XIB and AppleGlot

2009-06-04 Thread Jonathan Hess
On Jun 4, 2009, at 6:28 AM, Eric Slosser wrote: (Sorry if this is OT, I couldn't find a better apple-hosted list...) How does one use AppleGlot and XIBs? I have an app, "My.app", that was previously localized. I'm working on version 2.0. My app is starting to use XIB files. These get co

Re: Adding NSMenuItem in IB

2009-06-01 Thread Jonathan Hess
On Jun 1, 2009, at 2:59 AM, Vijay Kanse wrote: Sorry for My Question, Actually i was dragging NSMenu from Library and I was trying to Add it as Sub Menu. Ah, the problem here is that NSMenu instances contain an array of NSMenuItem instances. NSMenuItem instances can each contain a single

Re: Fixing logged error that doesn't throw exception

2009-05-27 Thread Jonathan Hess
The technique I typically use to debug these types of log messages is a breakpoint on NSLog. If that isn't hit, you could try a breakpoint on write. After you hit the breakpoint, verify that it's for the log message you're trying to debug, and then use the backtrace to get an idea of what e

Re: What's the differnece between API and Framework?

2009-05-21 Thread Jonathan Hess
An API is a set of functions, classes, methods, and other bits that give you a method to interface with a piece of software. A framework is one concrete way to package a body of software with a set of header files that describe its API. A web service is another way to give clients an API to

Re: initWIthFrame or awakeFromNib

2009-05-14 Thread Jonathan Hess
On May 13, 2009, at 9:32 PM, Joar Wingfors wrote: ...to follow up on that a bit: When you're instantiated from nib loading you will not see "-initWithFrame:" being called, but rather "-initWithCoder:". You can read more about that in the NSCoding & Nib Loading documentation. Depending on

Re: Getting "Unknown class 'someClassName' in nib file" message

2009-05-13 Thread Jonathan Hess
Hey Stuart - Try putting a breakpoint on NSLog, and then run your app. When you hit the breakpoint, look at the backtrace. It will give you an idea of which NIB is being loaded. After you figure that out, open the NIB/XIB file in IB and in the object outline view make sure the class name

Re: Questions about the xib file downgrade from Leopard to Tiger

2009-05-13 Thread Jonathan Hess
Hey Daniel - What you're trying will probably work. IB is issuing a warning because it sees that MYCollectionView is a subclass of NSCollectionView, and it knows that NSCollectionView doesn't exist on Tiger. You can either ignore the warning, create the MYCollectionView in code, or tell IB

Re: instance management in IB

2009-05-12 Thread Jonathan Hess
On May 11, 2009, at 10:24 PM, Patrick Mau wrote: Hallo Chris The NIB loading guide states that custom objects, like your model object, are created using 'initWithCoder' and not plain 'init'. For many objects that is the case, but instances of "Custom View" and "Custom Object" will be cr

Re: instance management in IB

2009-05-11 Thread Jonathan Hess
Hey Chris - This line "pointPath = [NSBezierPath bezierPath];" in the init method creates an NSBezierPath instance that may (will!) be destroyed with the next autorelease pool flush. You should be creating your bezier path with "pointPath = [[NSBezierPath alloc] init];" and then add a "[p

Re: NSToolbarItem with custom view in Interface Builder 3 (Leopard)

2009-05-11 Thread Jonathan Hess
he Size pane of the inspector, not directly. If you drag a Custom View object into the allowed-items set, click it twice and set the name of the custom NSView class in the Identity pane of the inspector (Command-6)." Gunnar - Original Message From: Jonathan Hess To: Gunnar

Re: NSToolbarItem with custom view in Interface Builder 3 (Leopard)

2009-05-11 Thread Jonathan Hess
Hey Gunnar - You won't be able to make this work with an instance of "custom view" dragged from the library. Here are a couple of suggestions for workarounds: You could add an outlet to the toolbar item you'd like to use a custom view with, and then place the custom view at the top level

Re: Calling a super call method from and instance

2009-05-07 Thread Jonathan Hess
Hey Dave - Usually wanting to do something like this points to some design flaw, but if you really want to invoke classA's implementation there are a number of ways to do it. One way would be to put a category on MyClassB like this: @implementation MyClassB(PassThrough) - (void)aboutMySupe

Re: instantiateNibWithOwner: fails due to "mutated while enumerated"

2009-05-05 Thread Jonathan Hess
Hey Philip - Have you tried running with a breakpoint on objc_exception_throw? Looking at the backtrace when you hit the exception could shed some light on what is happening. If that doesn't work, you could try a breakpoint on NSLog(), or even write(). After you hit the breakpoint, a quic

Re: Integer as key in NSMutableDictionary

2009-05-04 Thread Jonathan Hess
Hey Weydson - NSDictionary equates keys by using -[NSObject isEqual:] and -[NSObject hash], so a number with a different pointer address but the same value as determined by isEqual: is fine. If identity vs value does become an important distinction for you, CFDictionary gives you control

Re: Correct memory management in -awakeAfterUsingCoder: ?

2009-05-04 Thread Jonathan Hess
Hey Graham - I believe the expectation is that you return a retained instance from an override of awakeAfterUsingCoder:. This isn't clearly documented, so I would recommend filing a documentation bug. Good Luck - Jon Hess On May 4, 2009, at 9:45 PM, Graham Cox wrote: I am trying to track

Re: Adding objects to NSMutableArray out of order?

2009-05-04 Thread Jonathan Hess
Hey Colin - It sounds like you are going to get results 1-n, out of order, here's what I would do: - (void)start { myArray = [[NSMutableArray alloc] init]; for(NSInteger idx = 0; idx <= n; idx += 1) { [myArray addObject:[NSNull null]]; } } - (void)processResult:(id)result

Re: create object from class name held in String?

2009-04-30 Thread Jonathan Hess
Hey Darren - Try NSClassFromString. Animal* anAnimal = [[NSClassFromString(@"Dog") alloc] init] Jon Hess On Apr 30, 2009, at 12:50 PM, Darren Minifie wrote: Hi everyone. I have the situation where I need to dynamically create an object based on the value held in a string at runtime. I'm

Re: starting positions of the windows

2009-04-27 Thread Jonathan Hess
Hey Tony - Here's a link the Interface Builder User Guide which explains the sizing of NSWindow's and where they appear at runtime. http://tuvix.apple.com/documentation/DeveloperTools/Conceptual/IB_UserGuide/Layout/Layout.html#//apple_ref/doc/uid/TP40005344-CH19-SW14 ) Hopefully you'll fin

Re: figuring out which TableView I am?

2009-04-27 Thread Jonathan Hess
On Apr 27, 2009, at 2:10 AM, WT wrote: On Apr 27, 2009, at 6:44 AM, Michael Ash wrote: The correct approach here is to define a property, or a set of properties, on your table view subclass to control its appearance, then set up those properties in your controller in awakeFromNib. It is enti

Re: figuring out which TableView I am?

2009-04-26 Thread Jonathan Hess
On Apr 26, 2009, at 5:19 PM, Greg Guerin wrote: Jonathan Hess wrote: Why not have a property/instance-variable that controls this directly and then set that in awakeFromNib from one of the controller classes that has an outlet to each of the table views? If you needed a fully scalable

Re: figuring out which TableView I am?

2009-04-26 Thread Jonathan Hess
Why not have a property/instance-variable that controls this directly and then set that in awakeFromNib from one of the controller classes that has an outlet to each of the table views? If I maintained your project after you, the tag variable inherited from a distant superclass would not be

Re: NSArray merge sorting

2009-04-20 Thread Jonathan Hess
On Apr 20, 2009, at 5:32 PM, Greg Guerin wrote: Would NSSet cut the mustard here? NSArray allows duplicate items; NSSet does not. What do you propose happen if one or both NSArray inputs have items that compare as equal? Algorithmically speaking, a merge sort from two inputs into a new

Re: Compiling a XIB creates a different NIB file everytime

2009-04-20 Thread Jonathan Hess
On Apr 20, 2009, at 1:44 PM, Lyndsey Ferguson wrote: On Apr 20, 2009, at 4:17 PM, Jonathan Hess wrote: A NIB file contains many hash based unordered data structures, and won't have a byte for byte identical representation from one save/ compile operation to the next - even whe

Re: Compiling a XIB creates a different NIB file everytime

2009-04-20 Thread Jonathan Hess
Hey Lyndsey - A NIB file contains many hash based unordered data structures, and won't have a byte for byte identical representation from one save/ compile operation to the next - even when the represented interface is identical. Jon Hess On Apr 20, 2009, at 10:47 AM, Lyndsey Ferguson wro

Re: How to hook up IB actions to existing object (like File's Owner)?

2009-04-18 Thread Jonathan Hess
On Apr 15, 2009, at 2:08 PM, Sidney San Martín wrote: I want to hook up actions and bindings in a nib (loaded with +[NSBundle loadNibNamed:owner:]) to an object other than File's Owner (one which will already exist when the nib is loaded). Can I create a reference to a second object in Interfac

Re: initializer for NSTextView subclass not being invoked on Nib instantiation

2009-04-08 Thread Jonathan Hess
Hey Stuart - This link should cover your questions: http://developer.apple.com/documentation/Cocoa/Conceptual/LoadingResources/CocoaNibs/CocoaNibs.html#//apple_ref/doc/uid/1051i-CH4-SW19 You're using awakeFromNib for its intended purpose. Good Luck - Jon Hess On Apr 8, 2009, at 1:15 AM, S

Re: IB 3.1 Panel Has Maximum Size funky - workaround?

2009-04-05 Thread Jonathan Hess
Hey Steve - Is this IB 3.1? Or is it possibly 3.1.1 or 3.1.2? You may want to try this with the 3.1.2 tools. Jon Hess On Apr 5, 2009, at 3:11 PM, Steve Cronin wrote: Folks; I have a panel which I want to allow the user to extend vertically up to 100 pixels. IB 3.1 (xib) Resize flag -

Re: IB Plugin help

2009-04-04 Thread Jonathan Hess
On Apr 4, 2009, at 1:48 PM, jmun...@his.com wrote: However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Hey Jon - Could you describe the failure in a little more detail? Are you running your p

Re: Loading a view controller from a tab bar controller

2009-04-02 Thread Jonathan Hess
Are you saying that you want to load the view controller's view from a separate NIB/XIB? If so, you can use the inspector for that view controller to set the NIB Name property to the name of an XIB file in your project. In that XIB file, the file's owner's class should be set to your view c

Re: Huge and weird problem with NSScanner

2009-04-02 Thread Jonathan Hess
Hey Gustavo - This is probably auxiliary to your problem, but are you running 32-bit or 64-bit? The reason I ask is that the %i format specifier is for an 'int', but NSUInteger is a 'unsigned long' when running 64 bit. You should probably change that NSLog line to NSLog(@"initial %lu", (un

Re: IB instantiating objects

2009-03-23 Thread Jonathan Hess
Hey Josef - When IB instantiates an object in a NIB file that has the custom class set, it will instantiate it with either init, initWithFrame:, or initWithCoder: depending on the type of object. Here's a link tot he relevant documentation: http://developer.apple.com/documentation/Cocoa/Con

Re: NSString to Integer

2009-03-07 Thread Jonathan Hess
When using a 64-bit architecture, Mac OS X uses 32 bit integers, but 64 bit longs. NSInteger is defined as a long for 64, not an integer. When running 64-bit, you need to use %ld as the format option. Try this and see if it works any beter: NSInteger d = [@"43253234929732" integerValu

Re: Responding to view controller memory warnings (was Re: Outlets / IBOutlet declarations)

2009-02-24 Thread Jonathan Hess
On Feb 20, 2009, at 1:05 AM, Alexander Spohr wrote: Am 20.02.2009 um 04:18 schrieb mmalc Crawford: On Feb 19, 2009, at 12:34 PM, mmalc Crawford wrote: See also updated: The Doc states: Y

Re: Quicktime Movie View error

2009-02-06 Thread Jonathan Hess
On Feb 6, 2009, at 8:21 AM, elliott cable wrote: On Thu, Feb 5, 2009 at 11:02 PM, Kyle Sluder wrote: On Fri, Feb 6, 2009 at 1:05 AM, elliott cable wrote: today, and I'm running into the same problem. Does anybody know how I can fix it *without* switching away from XIBs? (I'm versioning

Re: Interface Builder Nested Object Selection

2009-02-04 Thread Jonathan Hess
Hey Richard - Try "shift-right-click" or "shift-control-left-click" to see a context menu of everything under the mouse. Alternatively, see the "Tools->Select Parent" menu item with a key equivalent of command+control+Up Arrow. Good Luck - Jon Hess On Feb 4, 2009, at 5:24 PM, Richard Som

Re: Interface Builder Plugin Dependency

2009-01-29 Thread Jonathan Hess
Hey Bridger - Does your plug-in and framework really need to create and crop an image while being unarchived and re-archived by ibtool? Perhaps you could retool your class so that the work happens lazily, and doesn't occur durring XIB compilation. As Joey said, ibtool to runs with no wind

Re: NSTableView Grows with # of rows

2009-01-28 Thread Jonathan Hess
On Jan 28, 2009, at 4:24 PM, Sean McBride wrote: On 1/28/09 7:26 PM, I. Savant said: Smiley aside, I think it's more than just 'typical'. Unless I'm missing some magic incantation, IB does not let you remove a tableview from its scrollview. No doubt it's possible programatically... Selec

Re: Multiple Nib Question

2009-01-28 Thread Jonathan Hess
- (NSString *)appSupportFolder { NSArray *paths = NSSearchPathForDirectoriesInDomains (NSApplicationSupportDirectory, NSUserDomainMask, YES); NSString *basePath = ([paths count] > 0) ? [paths objectAtIndex: 0] : NSTemporaryDirectory(); return [basePath stringByAppendingPathComponent:@"Tom

Re: NSTextField line breaking

2009-01-26 Thread Jonathan Hess
Hey John - Here are the methods you're looking for: - (void)setWraps:(BOOL)flag; - (void)setScrollable:(BOOL)flag; - (void)setScrollable:(BOOL)flag; They're from NSCell. Good Luck - Jon Hess On Jan 26, 2009, at 9:53 AM, John Nairn wrote: In a nib file I can set line breaking mode of an NSTex

Re: Problem setting up custom toolbar item in IB

2009-01-20 Thread Jonathan Hess
Hey Chunk - These are two distinct problems. The problem you are describing is that the z-order of the subviews of a custom view are reversed at runtime. Jon Hess On Jan 19, 2009, at 11:21 PM, Chunk 1978 wrote: not sure if it's related to a problem i've recently solved with custom views:

Re: A Question on estimating +arrayWithCapacity

2009-01-09 Thread Jonathan Hess
+[NSMutableArray array] returns a mutable array. That's the reason the return type is + (id) and not + (NSArray *). When implementing connivence initializers, you should invoke [self alloc], not [ASpecificClass alloc]. Cocoa uses this pattern frequently, and you can safely depend on it. O

Re: [iPhone] Search control like in App Store

2009-01-07 Thread Jonathan Hess
Hey Martijn - If you could file bugs at http://bugreport.apple.com/ about the concepts that you find confusing it would help us improve the usability of the tools. Thanks - Jon Hess On Jan 6, 2009, at 11:47 PM, Martijn van Exel wrote: Thanks - I looked into the TableSearch sample project

Re: Custom NSControl is not visible when dropped on a window from IB3.1 Library

2009-01-06 Thread Jonathan Hess
Hey Richard - Did you implement encodeWithCoder: and initWithCoder: in your two classes? If so, did you remember to call through to super's implementation in each case? Also, does your cell correctly implement copyWithZone? I'd put a breakpoint in the drawing functions of the cell to see

Re: NSDictionary mutability test

2008-12-08 Thread Jonathan Hess
On Dec 8, 2008, at 2:05 PM, I. Savant wrote: On Mon, Dec 8, 2008 at 1:53 PM, Sherm Pendley <[EMAIL PROTECTED]> wrote: I was using this assertion (written some time ago in ignorance) and wasted an afternoon tracking down the fact that it didn't work. It does "work" - it does the job it's

Re: NSDictionary mutability test

2008-12-08 Thread Jonathan Hess
On Dec 8, 2008, at 2:59 PM, Michael Ash wrote: On Mon, Dec 8, 2008 at 12:29 PM, Charles Steinman <[EMAIL PROTECTED]> wrote: This is explained in the thread you referenced. All NSDictionary objects are instances of NSCFDictionary. Thus the only way to check if they are mutable through public

Re: How to use IB to create a viewcontroller which actually linking to another nib file?

2008-11-26 Thread Jonathan Hess
Hey Hu - You can drag a view controller into your document from the library, and then set the NIB name in the attributes inspector (command + 1). When the outer NIB is loaded, the view controller will be immediately created but will lazily load its view from the specified NIB/XIB. Good lu

Re: Crash when "loading" window second time

2008-11-23 Thread Jonathan Hess
Hey Ulai - Do you have a backtrace for the crash? If you think the problem has to do with the aboutWindow outlet being referenced after the window has been dealloced, you could nil out the aboutWindow outlet in response to a windowDidCloseClose: delegate method. Jon Hess On Nov 21, 2008

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 18, 2008, at 1:14 AM, Brian Stern wrote: On Nov 18, 2008, at 12:59 AM, Roland King wrote: Hey Brian - Outlets for iPhone OS are established by calling setValue:forKeyPath:. The behavior of setValue:forKeyPath: is that if a setter exists, it is called. If a setter does not

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 18, 2008, at 12:49 AM, Brian Stern wrote: On Nov 18, 2008, at 12:35 AM, Jonathan Hess wrote: Perhaps the new @property() syntax makes it easy to forget about object lifetimes because it does the set/get/change automagically. These days when I add any property I go right to the

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 18, 2008, at 12:49 AM, Brian Stern wrote: On Nov 18, 2008, at 12:35 AM, Jonathan Hess wrote: Normally instance variables and properties share the same name, Normally in your code maybe, not mine. so it doesn't matter to Interface Builder where the 'IBOutlet' tex

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 18, 2008, at 12:43 AM, Brian Stern wrote: On Nov 18, 2008, at 12:34 AM, Jonathan Hess wrote: The solution to a memory leak should never be an unbalanced release. What I did to fix this was to add all of the properties to all of the outlets so they'd all be retained through

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 18, 2008, at 12:32 AM, Brian Stern wrote: On Nov 18, 2008, at 12:11 AM, Roland King wrote: Brian Stern wrote: On Nov 17, 2008, at 11:35 PM, Roland King wrote: Yes, but this is exactly the point. If I have no property for an Outlet it's still retained. If I have a propert

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
I simply don't need properties for all my Outlets, except for this issue. I also don't really like making all my outlets implicitly public. But I'm forced to do that. Here's one way to avoid making your outlets public: // Header @interface MyClass : NSObject { @private IBOutlet UIL

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 18, 2008, at 1:11 PM, Roland King wrote: Brian Stern wrote: On Nov 17, 2008, at 11:35 PM, Roland King wrote: Yes, but this is exactly the point. If I have no property for an Outlet it's still retained. If I have a property for an outlet that is assign, and not retain th

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
Perhaps the new @property() syntax makes it easy to forget about object lifetimes because it does the set/get/change automagically. These days when I add any property I go right to the dealloc method (and init if I have one) and ensure I've managed that property before I forget. Yes, but

Re: Outlets / IBOutlet declarations (was Re: Interface Builder & Wiring Objects)

2008-11-17 Thread Jonathan Hess
On Nov 17, 2008, at 10:12 PM, Brian Stern wrote: On Nov 17, 2008, at 9:11 PM, mmalcolm crawford wrote: One other consideration, particularly in iPhone applications, is where you might have outlets to subviews of a main view that might be released in sime situations -- e.g. a UIViewControl

Re: Weird bug in IB...

2008-11-13 Thread Jonathan Hess
There is a bug that causes "custom views", the blue ones, to reverse the z-order of their subviews when decoded. You can workaround this by re-ordering the subviews in awakeFromNib, or, you can use an instance of NSView instead of "custom view". To create an instance of NSView instead of "c

Re: Underlining text in Interface Builder

2008-11-04 Thread Jonathan Hess
Hey Adil - A text label in Interface Builder is an NSTextField, which has an NSTextFieldCell. NSTextFieldCell has three related properties, stringValue, font, and attributedStringValue. When the cell has just a stringValue, and a font, it combines the two during drawing to draw the string

Re: Desired Tabbing order not working

2008-10-16 Thread Jonathan Hess
Hey Adil - Do you happen to have the "Auto Recalculates View Loop" checkbox checked in the containing window's attributes inspector? Jon Hess On Oct 16, 2008, at 1:31 PM, Adil Saleem wrote: Hi, There is a small problem i am having while using Interface Builder. I have multiple text fiel

Re: NSView subclass

2008-10-15 Thread Jonathan Hess
On Oct 15, 2008, at 2:30 PM, Scott Andrew wrote: If its a delegate you would want to check if the delegate handles the selector with respondsToSelector and the use performSelector to make the call. For example if ([delegate respondsToSelector:@selector(pointClicked:)]) [delegate perfo

Re: Trouble with NSSplitView

2008-10-08 Thread Jonathan Hess
Cocoa/Reference/ApplicationKit/Classes/NSSplitView_Class/Reference/Reference.html#//apple_ref/occ/instm/NSObject/splitView:canCollapseSubview: Good Luck - Jon Hess Dave On Oct 7, 2008, at 10:43 PM, Jonathan Hess wrote: On Oct 7, 2008, at 4:44 PM, Dave Fernandes wrote: I had the same problem.

Re: Trouble with NSSplitView

2008-10-07 Thread Jonathan Hess
On Oct 7, 2008, at 4:44 PM, Dave Fernandes wrote: I had the same problem. The fix was to recreate the view in IB. Seems to be a bug in IB, but I never tried to repeat the problem once it was fixed. This isn't a problem with IB, it also isn't unique to split views. The problem has to do wit

Re: premature dealloc of the datasource of a NSTableView crashes my application

2008-10-05 Thread Jonathan Hess
On Oct 5, 2008, at 6:32 AM, Dr. Rolf Jansen wrote: Am 05.10.2008 um 00:36 schrieb Michael Ash: On Sat, Oct 4, 2008 at 4:01 PM, Dr. Rolf Jansen <[EMAIL PROTECTED]> wrote: Mac OS X 10.5.5, Xcode 3.1.1, PowerBook G4. ... In order to prevent my application from crashing, I overwrote -[NSObje

Re: NSWindowController retain count confusion

2008-09-30 Thread Jonathan Hess
On Sep 30, 2008, at 12:01 PM, James Walker wrote: Jonathan Hess wrote: The method -[NSObject retainCount] only exists to aid in debugging. You shouldn't be making any runtime decisions based on the return value of retainCount. You should only release something you previously ret

Re: NSWindowController retain count confusion

2008-09-29 Thread Jonathan Hess
Hey James - The method -[NSObject retainCount] only exists to aid in debugging. You shouldn't be making any runtime decisions based on the return value of retainCount. You should only release something you previously retained/alloced/newed/copied or are for some other reason explicitly re

Re: [Q] Custom NSFormatter and IB's Cocoa Simulator

2008-09-22 Thread Jonathan Hess
On Sep 22, 2008, at 4:01 PM, JongAm Park wrote: Hello. I tried making my own custom NSFormatter by following the guide, "Interface Builder Plug-In Programming Guide" However, when I tried my NSFormatter subclass using the "Simulate Interface" menu item of the Interface Builder, it rasied

Re: Swapping IB-created views and keeping IBOutlets hooked up

2008-09-16 Thread Jonathan Hess
Hey Alex - If your controller is the File's Owner, and in your NIB there is a connection connecting the the File's Owner's 'myButton' outlet to a button, then when you load the nib, the controller's myButton instance variable will be connected to the button in the nib. So far, everything

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
ller containing the buttons through its window, to that window's controller and then to NSApp. I don't know how to cause it to jump to the main window's window controller. On Sep 12, 2008, at 5:15 PM, Jonathan Hess wrote: On Sep 12, 2008, at 3:07 PM, Brad Gibbs wrote: T

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
I couldn't get to work, either). On Sep 12, 2008, at 2:43 PM, Jonathan Hess wrote: On Sep 12, 2008, at 2:25 PM, Brad Gibbs wrote: If I'm reading your mail correctly, I've tried that without success. I have a MainWindowController controlling MainWindow. On MainWindow.x

Re: Newb: Targeting an instance of a class instantiated by a NIB file

2008-09-12 Thread Jonathan Hess
e code inside of your view controller. If your document is holding onto a reference to the main window controller, perhaps your view controller can do something like 'self window] windowController] document] mainWindowController]'. Good Luck - Jon Hess Thanks again. Brad On Se

Re: App name from Bundle Identifier?

2008-09-12 Thread Jonathan Hess
Hey Dave - You could start with -[NSWorkspace absolutePathForAppBundleWithIdentifier:] to get a path. Use that path to create an NSBundle instance with +[NSBundle bundleWithPath:], and then use the NSBundle to find the name. -[NSBundle objectForInfoDictionaryKey:] and -[NSBundle localized

  1   2   >