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

2008-11-19 Thread Brian Stern
indeed correct. The official guideline is, AFAIK, to not call through your properties in init / dealloc. For whatever reason UIViewController sets its view property to nil from its dealloc method. Greg's override of setView is based on this behavior. -- Bri

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

2008-11-19 Thread Brian Stern
warnings for the life of the app and may be unloaded many times. And that's all fine. It just doesn't make any sense to load it in response to a memory warning. That's why I said upthread that self.view will never be non-nil. I'm starting to think that maybe using the assig

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

2008-11-19 Thread Brian Stern
On Nov 19, 2008, at 10:29 AM, Greg Titus wrote: On Nov 19, 2008, at 7:00 AM, Brian Stern wrote: This leaves us for now with two solutions: (a) Greg's (override setView:) which is more future-proof but is in many respects academically unsatisfying. (b) For non-top-level-object, speci

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

2008-11-19 Thread Brian Stern
On Nov 19, 2008, at 3:59 AM, mmalcolm crawford wrote: On Nov 18, 2008, at 10:01 AM, Brian Stern wrote: OK Erik, I'll bite. What you describe above is correct as far as it goes. However, when you say all the memory management is handled in one place, of course it's two. The

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

2008-11-18 Thread Brian Stern
r the UIViewController unloads its view, and not otherwise. Hope this helps, - Greg On Nov 18, 2008, at 10:01 AM, Brian Stern wrote: OK Erik, I'll bite. What you describe above is correct as far as it goes. However, when you say all the memory management is handled in one place, of cours

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

2008-11-18 Thread Brian Stern
ory of these outlets. The problem is that the base class doesn't always release its view in response to a memory warning and as far as I can tell the subclass has no clean way of telling if the view will be released or has been released. That's the problem. -

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

2008-11-18 Thread Brian Stern
ntroller implementation. In my code I would hardly ever have a reason to want to retain an outlet. Having outlets be retained by default gives my code no benefit, and causes some complications. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mai

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

2008-11-17 Thread Brian Stern
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 exist, the instance variable is looked up and set

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

2008-11-17 Thread Brian Stern
On Nov 18, 2008, at 1:00 AM, Jonathan Hess wrote: 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 matt

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

2008-11-17 Thread Brian Stern
th platforms, or are planning to, you should always use properties on both platforms since it makes the decision to retain outlets explicit and obvious. How come the documentation that mmalc quoted doesn't have this clear statement? Jon Hess -- Bri

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

2008-11-17 Thread Brian Stern
nored. The fact that it works differently from Mac OS makes it worse. Thanks for the help guys. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to t

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

2008-11-17 Thread Brian Stern
o all the deallocs to match those retains. -- Brian Stern [EMAIL PROTECTED] ___ 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-admi

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

2008-11-17 Thread Brian Stern
On Nov 18, 2008, at 12:13 AM, mmalcolm crawford wrote: On Nov 17, 2008, at 8:53 PM, Brian Stern wrote: Here's my test project: http://bellsouthpwp2.net/b/r/brians99/projects/TestPropertiesAndOutlets.zip There are three labels that are outlets. One has a retain property, one an a

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

2008-11-17 Thread Brian Stern
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 property for an outlet that is assign, and not r

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

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 11:51 PM, mmalcolm crawford wrote: On Nov 17, 2008, at 7: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

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

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 11:58 PM, mmalcolm crawford wrote: On Nov 17, 2008, at 8:34 PM, Brian Stern wrote: Don't you find it odd that you need to release outlets in didReceiveMemoryWarning? Not at all -- assuming that you have a reference -- strong or weak -- to an item in the

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

2008-11-17 Thread Brian Stern
they are released they are never dealloced. All three act the same. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators

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

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 11:20 PM, Luke the Hiesterman wrote: On Nov 17, 2008, at 8:17 PM, Brian Stern wrote: I think it makes more sense to release the Outlets in viewDidLoad. Why would you be releasing outlets when the view just loaded? Generally releasing happens when you're read

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

2008-11-17 Thread Brian Stern
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 UIViewController whose view is released in didReceiveMemoryWarn

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

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 11:05 PM, Roland King wrote: OK, this issue has come up for me very recently. It appears that on iPhoneOS IBOutlets are retained, regardless of the presence of properties. Even worse, in the presence of an assign property the outlet is still retained. Whatever c

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

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 10:53 PM, Luke the Hiesterman wrote: On Nov 17, 2008, at 7:46 PM, Brian Stern wrote: On Nov 17, 2008, at 10:17 PM, Luke the Hiesterman wrote: On Nov 17, 2008, at 7:12 PM, Brian Stern wrote: OK, this issue has come up for me very recently. It appears that on

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

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 10:17 PM, Luke the Hiesterman wrote: On Nov 17, 2008, at 7:12 PM, Brian Stern wrote: OK, this issue has come up for me very recently. It appears that on iPhoneOS IBOutlets are retained, regardless of the presence of properties. Even worse, in the presence of an

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

2008-11-17 Thread Brian Stern
pens. Actually this isn't (only) related to didReceiveMemoryWarning (which I hadn't considered related to this problem until you raised it). Is this the way that things are supposed to work on iPhone OS? -- Brian Stern [EMAIL PROTECTED] __

Re: Question about interface builder

2008-11-17 Thread Brian Stern
On Nov 17, 2008, at 6:19 PM, Kyle Sluder wrote: On Mon, Nov 17, 2008 at 5:25 PM, Brian Stern <[EMAIL PROTECTED]> wrote: I can tell you that the majority of iPhone developers are refusing to use IB. The reasons I usually see are I didn't get the implication that the OP was d

Re: Question about interface builder

2008-11-17 Thread Brian Stern
Apple spending months diddling over its NDA meant that most iPhone developers found non-Apple forums to discuss iPhone development so any guidance that Apple might have had over how to write proper apps has been very late in coming. I do use IB for a lot of my UI on iPhone but quite a bi

Re: Compare images in Cocoa

2008-10-31 Thread Brian Stern
mages and compare them. This could give a kind of simplistic % difference. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contac

Re: Can we ask iPhone questions yet?

2008-10-27 Thread Brian Stern
Apple has made an iPhone forum for iPhone developers available here On Oct 27, 2008, at 6:19 PM, Karan, Cem (Civ, ARL/CISD) wrote: Like the subject says, can we ask iPhone questions yet? I'm stumped and I need help. _

Re: Apple Developer Forums

2008-10-24 Thread Brian Stern
rials, all of this for the last six months. Apple has been peeing in the iPhone development pool for a while. Until now they haven't taken a dump in the pool. I'll say that this new forum is a baby-step in the right direction. But it all remains to be seen.

Re: Wasted Space and Kernighan

2008-10-07 Thread Brian Stern
the first place. Also, debugging my own clever code is rarely a problem. Debugging someone else's clever code is another story. Where do bindings fall in all this? It's often like debugging someone else's clever code. -- Bri

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-06 Thread Brian Stern
eds. Thanks for the input. Brian On Oct 5, 2008, at 6:08 PM, Jim Correia wrote: On Oct 5, 2008, at 5:41 PM, Brian Stern wrote: My main reason was just cleanliness. Looking more closely at the code however, most of which I didn't write, there are some runloop source

Re: How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Brian Stern
On Oct 5, 2008, at 4:52 PM, Jim Correia wrote: On Oct 5, 2008, at 4:43 PM, Brian Stern wrote: This is the question I really wanted to ask: I have an object X that is alloc/inited on the main thread. This object creates some NSThreads with detachNewThreadSelector:toTarget:withObject

How do I guarantee that an object is dealloced on the main thread?

2008-10-05 Thread Brian Stern
by the threads that happens after the release of their target or after the die entirely. I couldn't figure out what to wait for. This question of stopping threads has been mentioned numerous times in the archives but I didn't see this issue addressed. Any tho

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

2008-10-05 Thread Brian Stern
alloc]; } What prevents the tableview from being dealloced before the datasource? In that case the datasource is messaging a stale pointer. I think that something higher up in the ownership graph needs to manage this, like the window controller. -- Brian Stern [EMAIL PROT

Re: External C function and duplicate symbol

2008-10-03 Thread Brian Stern
It seems that what you want is an inline C function. I don't think this is part of the C language standard but gcc seems to have its own method of doing this. Just do a find on 'inline' in the Frameworks to see how it's done. Look at CGBase.h for instance. On Oct 3, 2008, at 8:32 AM, S

Re: NSString's "mutableCopy" creating a leak?

2008-10-01 Thread Brian Stern
owever, everyone on this list moves on internet time. Apple needs to keep up. The time to decide what new lists should exist is quickly passing. The people that this affects most are the subscribers to this list and we should have a say in what happens. It sounds like the l

Re: [Moderator] Please hold off on iPhone SDK discussions until the rules are clarified later today

2008-10-01 Thread Brian Stern
On Oct 1, 2008, at 12:47 PM, James wrote: Quick question, what do they mean by Released and Unreleased software (just want the terminology correct). While I'm not a lawyer I read those sentences several times also. What I believe it means is that released versions of the iPhone OS are n

Re: Problem with NSUserDefaultsController

2008-09-01 Thread Brian Stern
Apparently NSUserDefaults delays its saving until the next time through the event loop, perhaps by using one of the performSelector:afterDelay calls, or something like that. Is it possible that this is what's causing your issues? I ran into this problem when trying to save user defaults at

Re: array segment

2008-09-01 Thread Brian Stern
Is there an obj-C equivalent to Java's System.arraycopy() which will allow me to easily copy a segment of an NSArray into a new array? subarrayWithRange: Returns a new array containing the receiver’s elements that fall within the limits specified by a given range. http://developer.a

Re: Should I retain a variable returned from this accessor?

2008-08-12 Thread Brian Stern
view:) followed by release. Usually the release is the next line after the addObject:, not at the end of the method as the OP used. You can count this as 'a really good reason' or not but IMO the OP has no reason to autorelease the object as you suggest. -

Re: How to debug a corrupted stack

2008-08-07 Thread Brian Stern
. With a few utility routines to handle this for you this should be simple and safe. Or: Use NSData, add a category to NSData containing: dataWithUTCDateTime:, add the appropriate accesor for UTCDateTime and/or for the members of UTCDateTime. -- Brian Stern [EMAIL PROTECTED

Re: help linking sqlite3 wrapper

2008-08-04 Thread Brian Stern
On Aug 4, 2008, at 11:56 AM, John Velman wrote: After making changes to move the download from sqlite to sqlite3, and checking that I have /usr/local/lib/libsqlite3.a, and putting /usr/local/lib in the library search path of the project, the source for the Demo compiles but does not link.

Re: Why can't I name a property `tag'?

2008-07-10 Thread Brian Stern
d parameters are identical with the already existing method." Obviously there is some potential for new versions of Cocoa to add new methods that conflict with your own methods. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (

Re: Does this caution need fixed? (newb)

2008-07-09 Thread Brian Stern
On Jul 9, 2008, at 10:44 AM, Chris Paveglio wrote: I'm trying to make sure that this part of my code is good and clean and not leaking. I believe that I have it right (but still think I have something wrong). This code makes a list of file paths, and then copies the files or folders from t

Re: Crashes with no backtrace when printing

2008-07-03 Thread Brian Stern
bug report against gdb and the debugger. Maybe they'll fix it. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderato

Re: re-factoring a category into a class instance

2008-06-10 Thread Brian Stern
On Jun 10, 2008, at 5:05 PM, Paul Archibald wrote: Comrades: I am working on a file-handling Cocoa app that (at this point) has a single window. We are adding a second window (really sort of a non- modal dialog) to do some extra processing of the target files. The interface for the new wi

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-06 Thread Brian Stern
On Jun 6, 2008, at 1:58 AM, Graham Cox wrote: I agree, the compiler ought to be able to use the return type to disambiguate two otherwise identically named methods (or warn of the mismatch) - but it clearly doesn't. My experimentation reveals, with the Xcode 2.5 tools, that the return ty

Re: App hangs when displaying any sheet in 10.5 [SOLVED]

2008-06-05 Thread Brian Stern
rily because cause and effect were completely unrelated!) Thanks to everyone who pitched in - very grateful. cheers, Graham -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests o

Re: NSTableView

2008-05-23 Thread Brian Stern
, rowIndex); NSString *file = [arrayOfFiles objectAtIndex:rowIndex]; return [file self]; } Your line return [file self] is odd. Just: return file; -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please d

Re: File's Owner

2008-05-23 Thread Brian Stern
Owner for a given nib. The File's Owner icon in the IB window is there so you can set the outlets and actions of it so that you can make the connections between the new objects in the nib and the already existing objects in the application. It's a representation, or a title, of the

Re: Loading a .nib?

2008-05-02 Thread Brian Stern
k so exceptions don't propagate back through your C code and to the host app. Isn't there some sample code for building Cocoa iTunes plugins available somewhere that will answer these questions for you? -- Brian Stern [EMAIL PROTECTED] _

Re: Tight loop processing

2008-04-10 Thread Brian Stern
.html -- Brian Stern [EMAIL PROTECTED] ___ 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

Re: Adding commandline batch mode to Cocoa app

2008-03-23 Thread Brian Stern
target audience for your application? If it at all includes "regular Mac users" then any solution that involves the Terminal and /usr/bin is not a good solution. -- Brian Stern [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@l

Re: fileExistsAtPath with * to indicate random

2008-03-10 Thread Brian Stern
s function LSFindApplicationForInfo locates an application based on its name, creator signature, bundle ID, or any combination of these characteristics." Look at LSGetApplicationForInfo, LSFindApplicationForInfo, LSGetApplicationForURL and related APIs. -- Brian Stern [