How do you enable a view controller to be instantiated programmatically or from a XIB?

2011-09-23 Thread G S
As a follow-up to my question about objects not being loaded from a XIB: The view controller class I was using was not designed to be stored in a XIB; it had no initWithNibName method and did have a loadView method. The Apple doc makes it clear that these can't coexist in the same class. So is i

Getting a UITextview to accept a double tap

2011-09-23 Thread Donald Hall
I have a subclass of UITextview that I want to recognize a double tap, and then to pass the event onto the controller of its superview. (The superview's controller is a subclass of UIViewController.) The responder chain works as expected, however, the tap count does not. I have tried using tou

Re: What is the likely reason why objects aren't being loaded from a XIB?

2011-09-23 Thread G S
Thanks for the responses. The problem turned out to be that my view controller's parent class had defined loadView, which didn't call the base (UIViewController) loadView (and indeed, the documentation says that a loadView method should NOT call the base). Thus the XIB-loading mechanism was never

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Jerry Krinock
On 2011 Sep 23, at 15:57, Quincey Morris wrote: > a. What do you mean by "unnecessary"? Your choices for an outlet are pretty > much ivar or property. Are you suggesting the property is "unnecessary" > because it could be an ivar instead? Yes. After studying this some more I see that, in olde

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 9:30 PM, Greg Parker wrote: > On Sep 23, 2011, at 7:21 PM, Charles Srstka wrote: >> On Sep 23, 2011, at 6:06 PM, Greg Parker wrote: >>> >>> Nib connection on iOS uses KVC. Nib connection on OS X does not use KVC >>> itself, but it does use a similar "call method if it exists,

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Greg Parker
On Sep 23, 2011, at 7:21 PM, Charles Srstka wrote: > On Sep 23, 2011, at 6:06 PM, Greg Parker wrote: >> >> Nib connection on iOS uses KVC. Nib connection on OS X does not use KVC >> itself, but it does use a similar "call method if it exists, set ivar >> directly if it does not" algorithm. > >

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 6:06 PM, Greg Parker wrote: > On Sep 23, 2011, at 3:47 PM, Charles Srstka wrote: >> On Sep 23, 2011, at 5:24 PM, Jerry Krinock wrote: >>> When creating a new project in Xcode 4.1, I get a window which is declared >>> in the app delegate as: >>> >>> @property (assign) IBOutlet

Re: What is the likely reason why objects aren't being loaded from a XIB?

2011-09-23 Thread Jamie Pinkham
I've made the mistake of having to same named nib files in my project, and it caused weird behavior. It's pretty easy to overlook, too. However, in my case, the nib would load correctly every other time I ran the app. On Sep 23, 2011, at 8:52 PM, G S wrote: > Hi all. > > I have a pretty simp

What is the likely reason why objects aren't being loaded from a XIB?

2011-09-23 Thread G S
Hi all. I have a pretty simple iPhone XIB with of course the main view, then a toolbar, a UITableView, and a custom grid view. The controller (owner of this file) handles an initWithNibName and calls up through one superclass to UIViewController's initWithNibName. I've verified that this is bein

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Greg Parker
On Sep 23, 2011, at 3:47 PM, Charles Srstka wrote: > On Sep 23, 2011, at 5:24 PM, Jerry Krinock wrote: >> When creating a new project in Xcode 4.1, I get a window which is declared >> in the app delegate as: >> >> @property (assign) IBOutlet NSWindow *window; >> >> and defined as >> >> @synth

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Quincey Morris
On Sep 23, 2011, at 15:24 , Jerry Krinock wrote: > When creating a new project in Xcode 4.1, I get a window which is declared in > the app delegate as: > > @property (assign) IBOutlet NSWindow *window; > > and defined as > > @synthesize window ; > > Is this not going to create unnecessary

Re: Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 5:24 PM, Jerry Krinock wrote: > When creating a new project in Xcode 4.1, I get a window which is declared in > the app delegate as: > > @property (assign) IBOutlet NSWindow *window; > > and defined as > > @synthesize window ; > > Is this not going to create unnecessar

Re: UTI in Lion

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 5:36 PM, Jayson Adams wrote: > > On Sep 23, 2011, at 2:33 PM, Charles Srstka wrote: > >> I maintain that the better solution is for LS to keep both options open in >> the case of a conflict. Instead of guessing one or another, internally >> consider it something like “eithe

Re: Document opening in Lion

2011-09-23 Thread Lee Ann Rucker
On Sep 23, 2011, at 3:11 PM, Laurent Daudelin wrote: > On Sep 23, 2011, at 14:32, Sean McBride wrote: > >> There were some useful replies, but my "solution" was to opt out of Resume >> entirely. I might try again in 10.7.biggernumber. > > Thank you for opting out. Personally, it's been really

Re: UTI in Lion

2011-09-23 Thread Jayson Adams
On Sep 23, 2011, at 2:33 PM, Charles Srstka wrote: > I maintain that the better solution is for LS to keep both options open in > the case of a conflict. Instead of guessing one or another, internally > consider it something like “either public.objective-c-source or > com.matlab.whatever” and

Why does Xcode define IBOutlet with @synthesize?

2011-09-23 Thread Jerry Krinock
When creating a new project in Xcode 4.1, I get a window which is declared in the app delegate as: @property (assign) IBOutlet NSWindow *window; and defined as @synthesize window ; Is this not going to create unnecessary unnecessary setter and getter implementations? Would not @dynamic

Re: Document opening in Lion

2011-09-23 Thread Laurent Daudelin
On Sep 23, 2011, at 14:32, Sean McBride wrote: > There were some useful replies, but my "solution" was to opt out of Resume > entirely. I might try again in 10.7.biggernumber. Thank you for opting out. Personally, it's been really annoying to me that each time I open a document in an applicati

Re: Affinity between a document (plain text) file and app-specific parameters for this document

2011-09-23 Thread Ali Ozer
Putting this info in the document (whether or not it's in the actual document itself, or as an extended attribute) is not ideal, since it bakes in the display settings of the last person to view/edit that document. If I send you that document, you should either see it in its default state, or wi

Re: UTI in Lion

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 10:27 AM, Kyle Sluder wrote: > This is not all that different from how UTIs behave now. Launch > Services employs a few extremely simple heuristics (file extension, > creator code, MIME type) and assigns a UTI to the file. > > The big difference is that the detected UTI isn't

Re: UTI in Lion

2011-09-23 Thread Kyle Sluder
On Fri, Sep 23, 2011 at 2:22 PM, Sean McBride wrote: > How does LS use MIME types?  I mean, where can LS get a file's MIME type > from?  It isn't in an xattr is it? I'm probably conflating Launch Services with Core Services here. I meant that you can use MIME types to determine a UTI. You creat

Re: Document opening in Lion

2011-09-23 Thread Sean McBride
On Thu, 22 Sep 2011 09:45:24 +1000, Graham Cox said: >I'm thoroughly confused about how to control document opening in Lion. Yes, it is confusing. >My app can optionally show a dialog at startup instead of opening a new >'untitled' document. The dialog displays templates, in the same manner >as

Re: UTI in Lion

2011-09-23 Thread Sean McBride
On Fri, 23 Sep 2011 08:27:07 -0700, Kyle Sluder said: >This is not all that different from how UTIs behave now. Launch >Services employs a few extremely simple heuristics (file extension, >creator code, MIME type) and assigns a UTI to the file. How does LS use MIME types? I mean, where can LS ge

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Greg Parker
On Sep 21, 2011, at 10:26 AM, Sean McBride wrote: > I seem to recall that with GC, one is limited to some amount of 'collectable' > memory, but I can no longer find what that limit is. IIRC, it's like 30 GB? The garbage collector's arena is 16 GB in a 64-bit process. I don't know what's wrong,

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Greg Parker
On Sep 23, 2011, at 1:04 PM, Charles Srstka wrote: > What does +[NSObject alloc] do when the process is out of memory, anyway? > Does it throw an exception, or just return nil? The docs don’t seem to > mention either way. It attempts to throw an exception (though it may have done otherwise in th

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Martin Wierschin
>> I think crashing is a fine behavior when one is really out of memory (eg: >> it's not even possible to alloc a single vanilla NSObject), or when using >> Cocoa classes that aren't memory allocators (pretty much everything besides >> NSData). But in this case, where he's requesting big chunks

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 2:40 PM, Martin Wierschin wrote: > I think crashing is a fine behavior when one is really out of memory (eg: > it's not even possible to alloc a single vanilla NSObject), or when using > Cocoa classes that aren't memory allocators (pretty much everything besides > NSData). B

Re: Deploy terminal app

2011-09-23 Thread Bruno Berisso
Thank you all for your answers. I think that PackageMaker is what I was looking for. Best regards, Bruno. On Sep 22, 2011, at 5:17 PM, Nick Zitzmann wrote: > > On Sep 22, 2011, at 9:38 AM, Bruno Berisso wrote: > >> My intention is to copy the executable and a man page to the right place and

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Martin Wierschin
>> Exceeding the available memory of the garbage collector should not crash, >> instead your allocations should fail. > > When memory allocations fail, apps crash. Like it or not, that's just the way > it is. Not sure what the alternative would be - Changing all (!) of our code > to handle out-

Asynchronous document migration use cases

2011-09-23 Thread Dave Fernandes
I have a document-based app (Core Data, but that isn't important here) that can have fairly large documents. Migrating these documents from an old format to the new one can take several seconds (to decode, transform and re-encode data), so I need to do it off the main thread. It seems to work if

Re: UTI in Lion

2011-09-23 Thread Charles Srstka
On Sep 23, 2011, at 5:56 AM, Rainer Brockerhoff wrote: > Good point, Charles. On the other hand, I was in this exact situation some > years ago - not only having to list all apps, but also having to distinguish > which were Classic and which were not (and exclude command-line apps) - and > it t

Re: UTI in Lion

2011-09-23 Thread Ross Carter
On Sep 23, 2011, at 11:27 AM, Kyle Sluder wrote: > and if the user had the ability to change that recorded > value And if the app had the ability to specify the value when the file is created or saved. ___ Cocoa-dev mailing list (Cocoa-dev@lists.appl

Re: UTI in Lion

2011-09-23 Thread Sander Stoks
On Sep 23, 2011, at 5:27 PM, Kyle Sluder wrote: > On Fri, Sep 23, 2011 at 5:01 AM, Sander Stoks wrote: >> I think the way this was solved in BeOS was pretty nice. A file had a >> type/creator code there as a special attribute. A file "inherited" from a >> different platform would be sniffed b

Re: UTI in Lion

2011-09-23 Thread Kyle Sluder
On Fri, Sep 23, 2011 at 5:01 AM, Sander Stoks wrote: > I think the way this was solved in BeOS was pretty nice.  A file had a > type/creator code there as a special attribute.  A file "inherited" from a > different platform would be sniffed by a low-priority background thread, > which employed

Re: iPad

2011-09-23 Thread koko
Yeah, that is it, In App Purchases and the Store Programming Guide. Thanks. -koko On Sep 23, 2011, at 7:49 AM, Michael Dautermann wrote: > > On Sep 23, 2011, at 12:27 AM, koko wrote: > >> I have been approached to develop an iPad app with subscription content. I >> hav elooks at the iOS De

Re: Question to support File Version in 10.7

2011-09-23 Thread Michael Dautermann
On Sep 22, 2011, at 6:32 AM, Yingshen Yu wrote: > Hi, > > I'm working on adding File Version support to my application. It's not Cocoa > document based app, so I have to add version support on my own. My question > is when should I add a new version? I know I should add a file version when > us

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Sean McBride
On Thu, 22 Sep 2011 22:33:49 -0700, Joar Wingfors said: >> Exceeding the available memory of the garbage collector should not >crash, instead your allocations should fail. > >When memory allocations fail, apps crash. Like it or not, that's just >the way it is. Not sure what the alternative would b

Re: Garbage Collection: memory limits, crash when using "lots" of memory, why?

2011-09-23 Thread Sean McBride
On Thu, 22 Sep 2011 21:04:10 -0700, Don Quixote de la Mancha said: >That just has to be a bug. Exceeding the available memory of the >garbage collector should not crash, instead your allocations should >fail. > > Failing allocations should be handled by some kind of error recovery >code. Unfortu

Re: iPad

2011-09-23 Thread Michael Dautermann
On Sep 23, 2011, at 12:27 AM, koko wrote: > I have been approached to develop an iPad app with subscription content. I > hav elooks at the iOS Development start page > (http://developer.apple.com/ipad/sdk/) > but I do not see anything about these kind of apps. > > Where can I learn best prac

Re: UTI in Lion

2011-09-23 Thread Sander Stoks
Sticking to the lowest common denominator only to cater for other filesystems sound like a bad idea to me - we'll be stuck with 8.3 filenames then. I think the way this was solved in BeOS was pretty nice. A file had a type/creator code there as a special attribute. A file "inherited" from a d

Re: UTI in Lion

2011-09-23 Thread Rainer Brockerhoff
On 22/09/2011, at 21:01, cocoa-dev-requ...@lists.apple.com wrote: > From: Charles Srstka > Date: 22 de setembro de 2011 19:19:04 BRT > To: "Gerriet M. Denkmann" > Cc: cocoa-dev@lists.apple.com > > A while ago someone posted on this list that they needed to list all files > that were applicatio

Re: Sandboxing and file references

2011-09-23 Thread Norbert M. Doerner
At 12:02 Uhr -0700 22.09.2011, cocoa-dev-requ...@lists.apple.com wrote: > One can only hope that this is because App Sandbox is currently not fully baked. Otherwise, how would something like Xcode work sandboxed? ¬ÝAn .xcodeproj contains zillions of relative paths to files that the user,