Re: drawRect not getting called when needed under OS X
On Jul 23, 2011, at 9:33 PM, Tom Jeffries wrote: The code in the graphics module that displays the window is working perfectly, but somehow drawRect never gets called after it is called during initialization. Are you certain it never gets called? Put an NSLog(@“drawRect!”); call into the drawRect: method and see if that message gets logged when you expect or not. Put a breakpoint in the button’s action method and see whether that gets called. Check the value of the variable you call setNeedsDisplay: on — if it’s nil, nothing will happen. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: drawRect not getting called when needed under OS X
On Sat, Jul 23, 2011 at 11:33 PM, Tom Jeffries tjeffries@gmail.com wrote: When I run the code that displays the graphics in question on initialization it works fine, but when I call it later in the program it the new graphics are not displayed. The code in the graphics module that displays the window is working perfectly, but somehow drawRect never gets called after it is called during initialization. Just to be clear, you're doing one of these two things: 1) all of your drawing *inside the drawRect:* of your subclass. 2) all of your drawing to some sort of temporary context, then copying it *inside the drawRect:* of your subclass. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: drawRect not getting called when needed under OS X
Tom, if you want to draw in a view from somewhere else, I think you need to bracket that drawing with calls to [targetView lockFocus] and [targetView unlockFocus]. Or, you could have a condition of some sort, a BOOL I suppose, in the targetView which it checks every time it redraws to see if it needs to draw the extra stuff. That way you can keep the all the drawing in the one view. Then you'd just, in your button code, [targetView setBOOL:YES] and [targetView setNeedsDisplay:YES]; Ron On 24/07/2011, at 2:33 PM, Tom Jeffries wrote: Graham, I'm not calling drawRect. The button click goes to another module in the program, all the code in that module works fine, then it calls the module that has the NSView, executes the code for creating all the lines and shapes, and then tries to get the new graphics to display. I've tried (among other things): [super setNeedsDisplay : YES]; [SequeraStepWindow setNeedsDisplay : YES]; [self setNeedsDisplay : YES]; [SequeraStepWindow display]; [self display]; [super display]; When I run the code that displays the graphics in question on initialization it works fine, but when I call it later in the program it the new graphics are not displayed. The code in the graphics module that displays the window is working perfectly, but somehow drawRect never gets called after it is called during initialization. On Sat, Jul 23, 2011 at 9:06 PM, Graham Cox graham@bigpond.com wrote: On 24/07/2011, at 1:46 PM, Tom Jeffries wrote: When I put both the beginning graphics and the graphics that are to be drawn later in the initial drawRect call everything is drawn without a problem. However, drawRect does not get called when the user clicks the button on the second window. I've tried awakeFromNib, setNeedsDisplay, needsDisplay, and display, but nothing I've found so far gets the NSView window to call drawRect. I am fairly new to OS X programming and appreciate any hints you can throw my way. Show your code. You don't call drawRect: - the framework does. You can tell the framework it needs to be called by calling the view's -setNeedsDisplay: method. Are you doing that? How does the button come into it? How are you responding to the button? That's the trouble - what you've said so far is far too vague, it could be a thousand different things (but probably something simple). --Graham ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/ronfleckner%40ozemail.com.au This email sent to ronfleck...@ozemail.com.au ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Core Data: I/O Error No Such Column
Well, great success - I think I've finally figured out what's wrong. I have an entity, MyEntity. I have two other entities, Foo and Bar, that both have many to many relationships with MyEntity. MyEntity has relationshipFoo and relationshipBar. Both Foo and Bar have a relationship called relationshipMyEntity. This causes Core Data to append a number to the end of the relationship, 1 (as in my error below) and 2. It looks like between 10.6 and 10.7, how these numbers get assigned is swapped. So Core Data is looking for Z_3RELATIONSHIPMYENTITY1 in Foo, but 10.6 has built that as Z_3RELATIONSHIPMYENTITY2, and vice versa for Bar. If I rename my relationships to be relationshipMyEntityA and relationshipMyEntityB and rebuild on Lion, then this problem goes away - because they no longer have clashing names which are getting their index appended in a different order. Simple as that, problem solved. Obscure! Pretty sure I haven't read in the docs anywhere that you should have unique relationship names between entities, so I hope this helps if anyone runs in to the issue. Cheers, -nick On 23/07/2011, at 11:49 AM, Nick Shore wrote: I'm getting the following error in my application: CoreData: error: (1) I/O error for database at /Users/nick/library path/blah.sqlite. SQLite error code:1, 'no such column: t1.Z_3RELATIONSHIPENTITY1 This error only occurs if I build the project in Xcode 4.1 on Lion. If I build the same project on Snow Leopard in Xcode 4.0.2, then it runs as expected. If I launch the code built on 10.6/4.0.2 then it also runs as expected on 10.7. I've narrowed it down to only many-to-many relationships that are causing the issue, too. If I comment out anywhere that accesses [someObj mutableSetValueForKey:@relationshipKey] in code and disconnect the relevant bindings in my XIBs, then the application loads and displays the rest of the data fine. The other interesting thing is that if I delete my application data and launch the code built on 10.7/4.1, then it runs as expected - data is saved/loaded correctly. Traditionally I've built against the 10.5 SDK as I supported Leopard, so the database was originally created and managed during the Leopard days. Creating a fresh one on Snow Leopard triggers the same issue. I've tried building on SL for 10.6 and it works fine too. I've searched high and low for others with this issue - I've only found a couple of similar hits, both on cocoa-dev, but unfortunately with no replies: http://www.cocoabuilder.com/archive/cocoa/275386-10-6-2-core-data-incompatibility.html And this one, which seems like a pretty similar issue: http://osdir.com/ml/cocoa-dev/2009-09/msg00709.html So it seems like there is some kind of difference in how many-to-many relationships work somewhere along the line, triggered based on whether I build on SL/4.0.2 or L/4.1. Has anyone encountered this before? I did contact both the posters of those previous threads but unfortunately it didn't lead to a solution. Of course I could stay using 10.6/4.0.2 forever, but that's not ideal. :) This is the stack trace from where I attempt to access a value from one of these relationships, though it's about what you'd expect given the error: 0 CoreFoundation 0x9b466e77 __raiseError + 231 1 libobjc.A.dylib 0x9b25e149 objc_exception_throw + 155 2 CoreData0x9233814b -[NSSQLiteConnection prepareSQLStatement:] + 1435 3 CoreData0x9235f2d0 -[NSSQLChannel selectRowsWithCachedStatement:] + 80 4 CoreData0x923562eb newFetchedRowsForFetchPlan_MT + 875 5 CoreData0x923423d5 -[NSSQLCore newRowsForFetchPlan:] + 325 6 CoreData0x9239b2f4 -[NSSQLCore newFetchedPKsForSourceID:andRelationship:] + 2644 7 CoreData0x9239a235 -[NSSQLCore newValueForRelationship:forObjectWithID:withContext:error:] + 981 8 CoreData0x92399e4e -[NSPersistentStoreCoordinator(_NSInternalMethods) newValueForRelationship:forObjectWithID:withContext:error:] + 78 9 CoreData0x92399db2 -[NSFaultHandler retainedFulfillAggregateFaultForObject:andRelationship:withContext:] + 898 10 CoreData0x923995da -[_NSFaultingMutableSet willRead] + 250 11 CoreData0x923994a3 -[_NSFaultingMutableSet countByEnumeratingWithState:objects:count:] + 35 12 CoreData0x923ba469 -[_NSNotifyingWrapperMutableSet countByEnumeratingWithState:objects:count:] + 57 Cheers, -nick ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or
does core data always call through the setPrimative methods?
Simple question but I'm not finding an answer in the docs or by googling. I have a property Foo in my managed object and I want to add code in a subclass to update some internal state when Foo's changed. Is it sufficient override the setPrimitiveFoo: method, add my update code and call the superclass' version, i.e. does core data implement setFoo: by *always* calling the primitive method, setPrimativeFoo: or do I need to add the code in both setFoo: and setPrimitiveFoo:? ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSDocument: Read-only types and autosavesInPlace
Hello again, On 23 Jul 2011, at 13:00, Daniel Vollmer wrote: Oddly enough, the TextEdit example *should* end up with the same problem when I create a .rtf-document, drag an attachment into it (so it becomes .rtfd), and then close the document. Unfortunately, it works fine for TextEdit but I cannot see anything between my example and TextEdit that could cause it to behave differently, even after having put breakpoints onto every imaginable message. Can anyone see what I'm doing wrong or differently from TextEdit? It turns out that this machinery (i.e. the auto-renaming when changing file-types) only kicks in when you use UTI type declarations. Or at least that seems to be the case. Anyhow, one riddle solved... Daniel. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: does core data always call through the setPrimative methods?
On 2011 Jul 24, at 01:46, Roland King wrote: does core data implement setFoo: by *always* calling the primitive method, setPrimativeFoo: Well, it is documented that Core Data's implementation of setFoo: is equivalent to - (void)setFoo:(id)newValue { [self willChangeValueForKey:@foo] ; [self setPrimitiveFoo:newValue] ; [self didChangeValueForKey:@foo] ; } There are no branching statements in there. or do I need to add the code in both setFoo: and setPrimitiveFoo:? It's better than either case you've proffered. I've always put my custom behaviors in setFoo:. The only time I've ever messed with setPrimitiveFoo: is when debugging. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Xcode 3.2.6 on Lion ?
On Jul 23, 2011, at 4:32 PM, Jerry Krinock wrote: The last time I looked at Services, it only allowed you to access the selected (highlighted) text. Is there any way to get and replace the text of an entire document? I don't know. On Jul 23, 2011, at 4:44 PM, Jerry Krinock wrote: Is there any way to get the position of the cursor in the document, for example, if you want to insert some text at the cursor position? I don't know. My scripts start with the current selection. Sorry. --Richard ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Lion doesn't like tricky.key.paths in bindings?
On Fri, Jul 22, 2011 at 11:26 PM, Jerry Krinock je...@ieee.org wrote: In Interface Builder, I often set a binding like this: Bind to: FooController (an NSObjectController, instantiated in nib) Controller Key: selection (an instance of Foo) Model Key Path: barDate.someFormattingMethod where 'barDate' is an NSDate attribute of 'foo' and 'someFormattingMethod is, for example, a method I've defined in a category of NSDate which formats the receiver into a string. I realize the normal way to do this is with a value transformer, but someone showed me this trick a few years ago, and I've found it to be more convenient and cohesive than value transformers. Until Lion. I've had to rip out several of these recently because, upon changing the content object of the FooController object controller, Cocoa will raise an exception and log one of these turds: Cannot remove an observer NSObjectController 0x14a2c950 for the key path barDate.someFormattingMethod from Foo 0x12ebbf50, most likely because the value for the key barDate has changed without an appropriate KVO notification being sent. Check the KVO-compliance of the Foo class. Well, is the suggestion correct? That is, is there any way that the value of barDate could have changed without sending the appropriate KVO notification (did you, for example change the value of barDate without going through the setter?) -- Clark S. Cox III clarkc...@gmail.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
More on drawRect not getting called
I appreciate the answers, so far everything that's been suggested is something I've tried. Maybe if I put the code out somebody will see what I'm doing wrong: This is the function that is called by the mouse click, it's in another module: + (BOOL) Play { // init code [SequeraStepWindow DrawCurrentBarNotes]; } It calls this function in the NSView module: - (void) DrawCurrentBarNotes { drawNotesFlag = YES; // This flag tells drawRect to draw the notes next time [self DrawNotes]; // this is where the drawing takes place I've tried all of these to invoke drawRect, no luck //[self awakeFromNib]; //[super awakeFromNib]; //[SequeraStepWindow awakeFromNib]; //[SequeraStepWindow setNeedsDisplay: YES]; //[self setNeedsDisplay: YES]; //[super setNeedsDisplay: YES]; } Here's drawRect, which gets called properly on start up but does not get called afterwards - (void)drawRect:(NSRect)dirtyRect { [self DrawStepArea]; // Always draw the step area // don't draw the notes on program startup if(drawNotesFlag == YES) // if I comment this out DrawNotes works fine [self DrawNotes]; } Somebody suggested using NSLog, which I haven't done. However I've been using breakpoints and tracing through the code, which I assume should be just as valid. Everything works perfectly- except drawRect doesn't get called. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
On Jul 24, 2011, at 10:11 AM, Tom Jeffries wrote: + (BOOL) Play It’s hard to tell what’s going on in the code when you’re not following Cocoa naming conventions. Methods should start with a lowercase letter (unless they begin with a common acronym like “URL”). I’m very strongly in favor of prefixing (or postfixing) instance variables with something like “_” or “m_” to distinguish them from other variables. This makes it a lot easier to look at code and quickly identify what a variable is, as in these snippets. (It’s not a universal convention, though, although I will note that Apple strongly follows it in its own code.) [self DrawNotes]; // this is where the drawing takes place Do you mean that the -DrawNotes method actually draws stuff? It shouldn’t; that should happen in -drawRect:. //[SequeraStepWindow awakeFromNib]; //[SequeraStepWindow setNeedsDisplay: YES]; What is SequeraStepWindow? A class or a variable? It’s capitalized so I assume a class, but both of those are instance methods, so they won’t work when called on a class (and will generate compiler warnings.) * Does your code build without warnings? If not, fix the warnings first. Very important; a lot of serious errors in Obj-C only get reported as warnings. * Have you set an all-exceptions breakpoint? There are cases in which an exception thrown from your code can be caught by AppKit and not reported back to you, so it just looks as though nothing happens. This is getting messy enough that maybe you should just upload a zip file of your whole project, or at least the relevant source files, and post the URL... —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Does anyone else dislike Xcode 4?
Hi, all, I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. I found a rather handy post on how to uninstall Xcode 4. But my thing is, I won't be able to build apps that run on the latest version of the OS right? http://www.touch-code-magazine.com/uninstalling-xcode-4/ Everything I build in 4 seems to crash... but Xcode 3 it all works fine. I almost feel like Xcode 4 is like Windows Vista. in terms of badness. Thoughts, Recommendations, Suggestions? Julie. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
There are a lot of people who don't care for Xcode 4 for a variety of reasons: its different, its a one window interface, its missing support for 3rd party NIBs, etc… Personally at my company we all are pretty much in agreement that we love Xcode 4. Its not perfect. Its slower than it should be. Sometimes the mix of 1 window and individual windows can cause a problem that should not exist. Its search/replace has no way I can find to only search in groups. But overall we the interface, the schemes, the debugger, the compiler, etc… are massive improvements to our workflow. Yes it did take some time to get used to it and relearn how to do basic things. At first I hated Xcode 4's way of dealing with libraries because I'd spend literally days trying to get it to link static libs that used to be a breeze in Xcode 3. Its not a matter of computer should deal how I work and not me learning how it works because in the first place we learned how Xcode 3 worked, not how we worked and this is engineering after all. All that rambling to say that just like Lion, just because its different doesn't mean its bad. When I moved from Visual Studio to Xcode I didn't automatically think Xcode 3 sucked. Or when I used Eclipse, etc. There are reasons why Xcode 4 changed pretty much everything - because to move forward they had to break some eggs. On Jul 24, 2011, at 7:57 PM, Julie Seif wrote: Hi, all, I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. I found a rather handy post on how to uninstall Xcode 4. But my thing is, I won't be able to build apps that run on the latest version of the OS right? http://www.touch-code-magazine.com/uninstalling-xcode-4/ Everything I build in 4 seems to crash... but Xcode 3 it all works fine. I almost feel like Xcode 4 is like Windows Vista. in terms of badness. Thoughts, Recommendations, Suggestions? ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Yes, Xcode 4 feels like a Windows app, not a Mac app. The idiotic modality it creates when all you want to do is create one file after another and leave each open to edit each as you do so, but instead it closes the one just opened prior, requiring you to go through unnecessary steps to reopen all the previously opened files precipitated both a bug and lots of emails to Apple executives and management. I suggest you do the same. It's almost as if the development team believes all developers use 11 Airs rather than the two-monitor 27 setup many prefer. - Gary L. Wade (Sent from my iPhone) On Jul 24, 2011, at 10:57 AM, Julie Seif juliethech...@gmail.com wrote: Hi, all, I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. I found a rather handy post on how to uninstall Xcode 4. But my thing is, I won't be able to build apps that run on the latest version of the OS right? http://www.touch-code-magazine.com/uninstalling-xcode-4/ Everything I build in 4 seems to crash... but Xcode 3 it all works fine. I almost feel like Xcode 4 is like Windows Vista. in terms of badness. Thoughts, Recommendations, Suggestions? Julie. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Perhaps it's just me, but it seems like this discussion would be much more appropriate on the Xcode Users list: http://lists.apple.com/mailman/listinfo/xcode-users Cheers, Dave ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 10:57, Julie Seif wrote: Hi, all, I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. I found a rather handy post on how to uninstall Xcode 4. But my thing is, I won't be able to build apps that run on the latest version of the OS right? http://www.touch-code-magazine.com/uninstalling-xcode-4/ Everything I build in 4 seems to crash... but Xcode 3 it all works fine. I almost feel like Xcode 4 is like Windows Vista. in terms of badness. Thoughts, Recommendations, Suggestions? Julie. This really made my day. It's pure phishing, but what I find so amusing is that as developers we don't get the lure of pron, or ... er ... manhood enhancement, we get phished with Xcode-uninstallation. That's beautiful. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 10:57 AM, Julie Seif wrote: I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. Hope this doesn’t sound patronizing, but: change happens, get used to it :) I felt the same way about the transition from Project Builder to Xcode, and before that from CodeWarrior to Project Builder (and before that to THINK C++, Lightspeed C, etc.) Some of these transitions really did feel like steps backwards (esp. CodeWarrior to Project Builder), but for the most part once I learned my way around the new IDE I liked it better. So far I am really, really enjoying Xcode 4’s UI — the assistant pane and the breadcrumb pop-ups are genius, I love having syntax checking as I type, and the target configuration editor is a lot smoother than before. I do wish it were less buggy, but I know that always takes a while to iron out with a totally new app of this complexity. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
Jens, I'm sorry if my naming conventions confuse you. I've been programming for 27 years on a wide variety of operating systems, and I'm afraid following Cocoa naming conventions is not high on my list. I thought [SequeraStepWindow awakeFromNib] makes it obvious that SequeraStepWindow is a class. Is there a way to use that syntax with a variable? If so, Objective C gets a major thumbs down. Draw Notes calls other routines to get the correct information and ends with: CGContextBeginPath (noteContext); CGContextAddEllipseInRect(noteContext, noteBox); CGContextFillPath(noteContext); CGContextDrawPath(noteContext, kCGPathStroke); drawRect is supposed to do the actual screen drawing. It does it perfectly when called during program startup. It is not called again. The program compiles without warnings. Obviously I dealt with that level before posting a question here. Thanks, Tom On Sun, Jul 24, 2011 at 10:45 AM, Jens Alfke j...@mooseyard.com wrote: On Jul 24, 2011, at 10:11 AM, Tom Jeffries wrote: + (BOOL) Play It’s hard to tell what’s going on in the code when you’re not following Cocoa naming conventions. Methods should start with a lowercase letter (unless they begin with a common acronym like “URL”). I’m very strongly in favor of prefixing (or postfixing) instance variables with something like “_” or “m_” to distinguish them from other variables. This makes it a lot easier to look at code and quickly identify what a variable is, as in these snippets. (It’s not a universal convention, though, although I will note that Apple strongly follows it in its own code.) [self DrawNotes]; // this is where the drawing takes place Do you mean that the -DrawNotes method actually draws stuff? It shouldn’t; that should happen in -drawRect:. //[SequeraStepWindow awakeFromNib]; //[SequeraStepWindow setNeedsDisplay: YES]; What is SequeraStepWindow? A class or a variable? It’s capitalized so I assume a class, but both of those are instance methods, so they won’t work when called on a class (and will generate compiler warnings.) * Does your code build without warnings? If not, fix the warnings first. Very important; a lot of serious errors in Obj-C only get reported as warnings. * Have you set an all-exceptions breakpoint? There are cases in which an exception thrown from your code can be caught by AppKit and not reported back to you, so it just looks as though nothing happens. This is getting messy enough that maybe you should just upload a zip file of your whole project, or at least the relevant source files, and post the URL... —Jens ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On 2011-07-24, at 3:32 PM, Jens Alfke wrote: On Jul 24, 2011, at 10:57 AM, Julie Seif wrote: I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. Hope this doesn’t sound patronizing, but: change happens, get used to it :) I felt the same way about the transition from Project Builder to Xcode, and before that from CodeWarrior to Project Builder (and before that to THINK C++, Lightspeed C, etc.) Some of these transitions really did feel like steps backwards (esp. CodeWarrior to Project Builder), but for the most part once I learned my way around the new IDE I liked it better. So far I am really, really enjoying Xcode 4’s UI — the assistant pane and the breadcrumb pop-ups are genius, I love having syntax checking as I type, and the target configuration editor is a lot smoother than before. I do wish it were less buggy, but I know that always takes a while to iron out with a totally new app of this complexity. —Jens___ I agree. Xcode 4 may have a slight learning curve and what seems to be a performance hit but it's worth it and will likely get even better. The new action triggers inside the debugger are pure freakin' gold. I haven't used NSLog() in weeks now. Patrick William Walker patrick.william.wal...@nb.sympatico.ca patrickwilliamwal...@yahoo.com will.wal...@unb.ca ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
Patrick, Everything works except that I can't get drawRect to be called a second time. I assume that means the IBOutlet is working. However, I think you're right that there's something about the interaction between the modules that is causing the problem. Thanks, Tom On Sun, Jul 24, 2011 at 11:38 AM, Patrick William Walker patrick.william.wal...@nb.sympatico.ca wrote: On 2011-07-24, at 2:11 PM, Tom Jeffries wrote: I appreciate the answers, so far everything that's been suggested is something I've tried. Maybe if I put the code out somebody will see what I'm doing wrong: This is the function that is called by the mouse click, it's in another module: + (BOOL) Play { // init code [SequeraStepWindow DrawCurrentBarNotes]; } It's hard to see what you've done. One thing to check is to make sure you have correctly added in (and connected) an IBOutlet inside your NIB/XIB file. You can send [myView setNeedsDisplay: YES] over and over and nothing will happen and is a common oversight. Is your custom view is configured property (and connected) under your SequeraStepWindow? I'm not sure why you've defined + (BOOL) Play as a class method but without seeing more of the actual code I cannot say much more. Is your custom view is configured property (and connected) under your SequeraStepWindow? Patrick William Walker patrick.william.wal...@nb.sympatico.ca patrickwilliamwal...@yahoo.com will.wal...@unb.ca ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
Looks like today is my day for grouchy responses. I wish I hadn't chosen this week to give up sniffing glue. ;) On Jul 24, 2011, at 11:41, Tom Jeffries wrote: Jens, I'm sorry if my naming conventions confuse you. I've been programming for 27 years on a wide variety of operating systems, and I'm afraid following Cocoa naming conventions is not high on my list. It needs to be high on your list, for several technical reasons. a. It confuses us, because we follow the conventions. If you're trying to use this list to get clarification on something, confusing us doesn't help you much. b. It confuses you. See below. c. Starting with the Clang LLVM 3.0 compiler, the structure of (some) method names (including capitalization) has become a new syntax feature (method families). I thought [SequeraStepWindow awakeFromNib] makes it obvious that SequeraStepWindow is a class. 'awakeFromNib' is an instance method, not a class method. If 'SequeraStepWindow' is a class (that is, an object of type 'Class'), you don't send 'awakeFromNib' to it. If it's an instance (that is, an object of some class you defined), then you should use the correct terminology *before* climbing on your high horse. Is there a way to use that syntax with a variable? If so, Objective C gets a major thumbs down. Of course there is. If 'someObject' is a variable of an object type, then [someObject someMethod] is valid syntactically. That's how Objective-C gets (part of) its dynamism. Draw Notes calls other routines to get the correct information and ends with: CGContextBeginPath (noteContext); CGContextAddEllipseInRect(noteContext, noteBox); CGContextFillPath(noteContext); CGContextDrawPath(noteContext, kCGPathStroke); drawRect is supposed to do the actual screen drawing. It does it perfectly when called during program startup. It is not called again. You still seem to be trying to *call* something that will eventually *call* 'drawRect:'. Several people have pointed out to you that this is the wrong approach. The program compiles without warnings. Obviously I dealt with that level before posting a question here. You'd be surprised how often people post code here that *can't* compile without warnings. In the absence of an explicit statement from you, it *isn't* obvious, just unknown. That's why Jens asked. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
+ (void) initialize not getting called
Hi I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am a but confused why it isn't working. I don't want to create a global initialized flag and have to check that inside every method. Here's a stripped down version of the initialize method. Anyone see what I'm doing wrong? Is there any other way to insure that initialize is called before any other method in the class? static NSMutableString *gSharedData = nil; @implementation DBWord + (void) initialize { @synchronized(self) { if (gSharedData == nil) { NSLog(@made it to here); NSError *error = nil; gSharedData = [[NSMutableString alloc] initWithContentsOfFile: @/path/to/shared/file.txt encoding: NSUTF16StringEncoding error: error]; } } } ... @end ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
You mentioned that things are working perfectly except for the drawing. I did notice that, I am not dismissing that, I just want to confirm some simple things in an effort to help... On Jul 24, 2011, at 1:11 PM, Tom Jeffries wrote: I appreciate the answers, so far everything that's been suggested is something I've tried. Maybe if I put the code out somebody will see what I'm doing wrong: This is the function that is called by the mouse click, it's in another module: + (BOOL) Play { // init code [SequeraStepWindow DrawCurrentBarNotes]; } You are sure this method is being called, right? If so, please tell us how you are sure. Play is a class method, so I'm going to guess that SequeraStepWindow is a global variable. How are you initializing SequeraStepWindow? I wonder if you're under-retaining it -- although you'd probably have crashed if that was the case. Can you show us where you declare the variable and where you assign it a value? Have you checked that SequeraStepWindow is not nil at this point in the code? Sending a message to nil is a no-op. This is a common pitfall for newcomers to Cocoa. It calls this function in the NSView module: - (void) DrawCurrentBarNotes { drawNotesFlag = YES; // This flag tells drawRect to draw the notes next time [self DrawNotes]; // this is where the drawing takes place This is not the way to do it. All drawing must be done by drawRect: except in some cases that don't or shouldn't apply to you if you're writing a straightforward app and especially if you're new to the platform. You don't call drawing methods; you implement drawing in drawRect: and let the Cocoa runtime call drawRect: at the appropriate times. Only drawRect: should be calling DrawNotes. Analyzing a little further -- the typical Cocoa pattern for what you're trying to do here is to have a setter method for the property drawNotesFlag. It often looks like this: - (void)setDrawNotesFlag:(BOOL)newFlag { drawNotesFlag = newFlag; [self setNeedsDisplay:YES]; } I've tried all of these to invoke drawRect, no luck //[self awakeFromNib]; //[super awakeFromNib]; //[SequeraStepWindow awakeFromNib]; //[SequeraStepWindow setNeedsDisplay: YES]; //[self setNeedsDisplay: YES]; //[super setNeedsDisplay: YES]; You are flailing. awakeFromNib is another method that you do not call, you only implement. (The exception would be an implementation of awakeFromNib that needs to call [super awakeFromNib], but this is not your situation.) Furthermore, awakeFromNib is meant to be called exactly once after the nib is loaded. The right answer is [self setNeedsDisplay:YES]. Here's drawRect, which gets called properly on start up but does not get called afterwards - (void)drawRect:(NSRect)dirtyRect { [self DrawStepArea]; // Always draw the step area // don't draw the notes on program startup if(drawNotesFlag == YES) // if I comment this out DrawNotes works fine [self DrawNotes]; } Somebody suggested using NSLog, which I haven't done. Another common pitfall is not understanding nib files and thus having more instances of a view than you think you have. I suggest you put the following in the awakeFromNib of your view class: NSLog(@awakeFromNib -- %@, self); This will print the address of the view instance. From your code I would guess you should see this log message exactly once. If you see it more than once, that is a major clue. However I've been using breakpoints and tracing through the code, which I assume should be just as valid. Everything works perfectly- except drawRect doesn't get called. Wait a minute. You've been telling us drawRect: doesn't get called, but above you have a comment that says DrawNotes works fine if you comment out an if-test. Which is it? If it's simply a matter of drawNotesFlag not having been properly set to YES, then that is a major clue. Maybe the problem is that DrawCurrentBarNotes is not getting called (hence my question above). --Andy ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Alex Kac a...@webis.net 2011-07-24 13:31 wrote: 2011-07-25 20:22, Jeffrey Oleander wrote: Alex Kac a...@webis.net 2011-07-24 13:07 wrote: ...its a one window interface... This is a deal killer. Seeing things next to each other is vital. It's the reason we had to chop down so many trees in the olden days, for highly cross-referenced listings (even with tiny little laser print shrinking 2 older green-bar listing pages to one 8.5 by 11) to stretch out across conference tables next to each other. OK so Xcode can do that. Turn on the assistant, and click on a file to open. Then option click on another file... Alternating looking at tiny little bits of 2 files (like trying to look at a panoramic land-scape through a straw) is not remotely the same as looking at several files at the same time side by side. That's a good way to make mistakes, and burn up a lot of time hunting them down, later, because they're usually mistakes the compiler won't flag. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: + (void) initialize not getting called
On Sun, Jul 24, 2011 at 3:33 PM, Ken Tozier kentoz...@comcast.net wrote: I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I can't tell for sure from your email, but it seems like you might be expecting initialize to be called whenever you create a new instance of your class. From the NSObject documentation: The runtime sends initialize to each class in a program exactly one time just before the class, or any class that inherits from it, is sent its first message from within the program. So creating a new instance won't trigger an initialize message unless it's the very first message sent to your class. Sorry if I've misunderstood. gr. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. - Gary L. Wade (Sent from my iPhone) ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: + (void) initialize not getting called
Looks okay to me. Is there anything unusual about how you're creating instances? The docs say +initialize is sent before any message is sent to the *class*. So if you're using some variation of [[DBWord alloc] init...] I would expect it to be called before the first time you ever call alloc. --Andy On Jul 24, 2011, at 3:33 PM, Ken Tozier wrote: Hi I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am a but confused why it isn't working. I don't want to create a global initialized flag and have to check that inside every method. Here's a stripped down version of the initialize method. Anyone see what I'm doing wrong? Is there any other way to insure that initialize is called before any other method in the class? static NSMutableString*gSharedData = nil; @implementation DBWord + (void) initialize { @synchronized(self) { if (gSharedData == nil) { NSLog(@made it to here); NSError *error = nil; gSharedData = [[NSMutableString alloc] initWithContentsOfFile: @/path/to/shared/file.txt encoding: NSUTF16StringEncoding error: error]; } } } ... @end ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com This email sent to ag...@mac.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Apparently you don't open more than two windows so there's your difference in point of view. Some people don't want to go through extra steps to do something that used to be easy and helpful. Ten times out of ten I want to place my windows where I want them, and I don't want my existing windows closed when I create or open a new file. - Gary L. Wade (Sent from my iPhone) On Jul 24, 2011, at 12:40 PM, Alex Kac a...@webis.net wrote: But as I said, you simply then tell Xcode to open two windows. I really don't see what the problem is here. It sounds more like you made up your mind to hate it and nothing else will change your mind. And I don't get how having one window that takes up the entire screen split into 2 is tiny little bits of 2 files. I don't use the 3rd pane on the right unless I need to. If I need more space I press CMD-0 and hide the navigator. Or in some cases I actually have Xcode open real windows. But I find the side-by-side assistant view to be what I need 9 times out of 10. And this is both on a MacBook Air 11'' (using it now) or my two 27'' LCD displays at the office. On Jul 24, 2011, at 9:37 PM, Jeffrey Oleander wrote: Alex Kac a...@webis.net 2011-07-24 13:31 wrote: 2011-07-25 20:22, Jeffrey Oleander wrote: Alex Kac a...@webis.net 2011-07-24 13:07 wrote: ...its a one window interface... This is a deal killer. Seeing things next to each other is vital. It's the reason we had to chop down so many trees in the olden days, for highly cross-referenced listings (even with tiny little laser print shrinking 2 older green-bar listing pages to one 8.5 by 11) to stretch out across conference tables next to each other. OK so Xcode can do that. Turn on the assistant, and click on a file to open. Then option click on another file... Alternating looking at tiny little bits of 2 files (like trying to look at a panoramic land-scape through a straw) is not remotely the same as looking at several files at the same time side by side. That's a good way to make mistakes, and burn up a lot of time hunting them down, later, because they're usually mistakes the compiler won't flag. Alex Kac - President and Founder Web Information Solutions, Inc. If at first you don't succeed, skydiving is not for you. -- Francis Roberts ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Le 24 juil. 2011 à 20:46, Gary L. Wade a écrit : As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. Well, I would count myself as a relative novice to Xcode 4, but I have discovered that you can have multiple tabs in the main window and, if you want, you can tear off a tab into a separate window, close the navigator and inspector and have as many windows as you want open on the same project, with a different file in each. Joanna -- Joanna Carter Carter Consulting ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
This discussion is not appropriate for this forum. If you'd like to gripe about the changes in Xcode 4, please use a more appropriate forum, such as: - the Xcode Users list - http://bugreport.apple.com - http://devforums.apple.com This list is for technical discussions about the Cocoa and Cocoa Touch frameworks. Dave Sent from my iPhone ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 15:40, Alex Kac a...@webis.net wrote: But as I said, you simply then tell Xcode to open two windows. I really don't see what the problem is here. It sounds more like you made up your mind to hate it and nothing else will change your mind. This is the same ignorant argument made by lots of new-to-Mac people. The window needs to be tightly associated with its content, so that focus always goes to that window when focus is needed in that document. Xc4 fails miserably at this. It also needs to persist the window's state with the doc. Moreover, non-document windows also need to be separate. Try seeing documentation for the organizer window (at the same time) for example. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: + (void) initialize not getting called
+initialize is called only the first time a class is instantiated; it can be called again if a derived class does not implement it. - Gary L. Wade (Sent from my iPhone) On Jul 24, 2011, at 12:43 PM, Gabriel Roth gabe.r...@gmail.com wrote: On Sun, Jul 24, 2011 at 3:33 PM, Ken Tozier kentoz...@comcast.net wrote: I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I can't tell for sure from your email, but it seems like you might be expecting initialize to be called whenever you create a new instance of your class. From the NSObject documentation: The runtime sends initialize to each class in a program exactly one time just before the class, or any class that inherits from it, is sent its first message from within the program. So creating a new instance won't trigger an initialize message unless it's the very first message sent to your class. Sorry if I've misunderstood. gr. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: + (void) initialize not getting called
Another thought -- is it possible you have a subclass of DBWord that implements +initialize and needs to call super? --Andy On Jul 24, 2011, at 3:33 PM, Ken Tozier wrote: Hi I wrote a class that stores data common to all instances in an, init file, but when I create new instances, + (void) initialize isn't getting called. I thought that initialize was always called before anything else, so am a but confused why it isn't working. I don't want to create a global initialized flag and have to check that inside every method. Here's a stripped down version of the initialize method. Anyone see what I'm doing wrong? Is there any other way to insure that initialize is called before any other method in the class? static NSMutableString*gSharedData = nil; @implementation DBWord + (void) initialize { @synchronized(self) { if (gSharedData == nil) { NSLog(@made it to here); NSError *error = nil; gSharedData = [[NSMutableString alloc] initWithContentsOfFile: @/path/to/shared/file.txt encoding: NSUTF16StringEncoding error: error]; } } } ... @end ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/aglee%40mac.com This email sent to ag...@mac.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
On Sun, Jul 24, 2011 at 12:12 PM, Andy Lee ag...@mac.com wrote: You should know that it is most certainly possible to use that syntax with a variable. For example: NSString *myString = @abc; // == a variable NSString *newString = [myString copy]; // == a message send You can send messages to both classes and instances of classes. If you are not clear about the difference between a class and an instance, let us know now so we can proceed on the same page. OK, we're each half right- myString in this case is a function, not a class, but I would question calling it a variable. Maybe I'm old fashioned, but I think it's important to distinguish between information (variables) and operations (functions). That is one reason why I'm less than completely enthusiastic about Objective C syntax and Cocoa conventions. However, I do understand that using them would make it easier to understand what's going on. I've gotten several interesting hints from the comments, which I appreciate. I'm going to pursue them, if I don't find a solution I'll see if I can post a more understandable example. Thanks, Tom ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Yep, only if it felt as good as VS 2010 IDE, we would be having discussions on Cocoa and not the IDE. -tony -Original Message- From: Gary L. Wade Sent: Sunday, July 24, 2011 11:13 AM To: Julie Seif Cc: cocoa-dev@lists.apple.com Subject: Re: Does anyone else dislike Xcode 4? Yes, Xcode 4 feels like a Windows app, not a Mac app. The idiotic modality it creates when all you want to do is create one file after another and leave each open to edit each as you do so, but instead it closes the one just opened prior, requiring you to go through unnecessary steps to reopen all the previously opened files precipitated both a bug and lots of emails to Apple executives and management. I suggest you do the same. It's almost as if the development team believes all developers use 11 Airs rather than the two-monitor 27 setup many prefer. - Gary L. Wade (Sent from my iPhone) On Jul 24, 2011, at 10:57 AM, Julie Seif juliethech...@gmail.com wrote: Hi, all, I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. I found a rather handy post on how to uninstall Xcode 4. But my thing is, I won't be able to build apps that run on the latest version of the OS right? http://www.touch-code-magazine.com/uninstalling-xcode-4/ Everything I build in 4 seems to crash... but Xcode 3 it all works fine. I almost feel like Xcode 4 is like Windows Vista. in terms of badness. Thoughts, Recommendations, Suggestions? Julie. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/tonyrom%40hotmail.com This email sent to tony...@hotmail.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
NSString is the class. myString is an instance of that class and in this case is a variable. myString is information. Its not an operation. It is a class instance which contains information on what the data is and what can be done with it. mystring is not a function. copy is a method call to that instance of a class. On Jul 24, 2011, at 10:01 PM, Tom Jeffries wrote: On Sun, Jul 24, 2011 at 12:12 PM, Andy Lee ag...@mac.com wrote: You should know that it is most certainly possible to use that syntax with a variable. For example: NSString *myString = @abc; // == a variable NSString *newString = [myString copy]; // == a message send You can send messages to both classes and instances of classes. If you are not clear about the difference between a class and an instance, let us know now so we can proceed on the same page. OK, we're each half right- myString in this case is a function, not a class, but I would question calling it a variable. Maybe I'm old fashioned, but I think it's important to distinguish between information (variables) and operations (functions). That is one reason why I'm less than completely enthusiastic about Objective C syntax and Cocoa conventions. However, I do understand that using them would make it easier to understand what's going on. I've gotten several interesting hints from the comments, which I appreciate. I'm going to pursue them, if I don't find a solution I'll see if I can post a more understandable example. Thanks, Tom ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/alex%40webis.net This email sent to a...@webis.net Alex Kac - President and Founder Web Information Solutions, Inc. If at first you don't succeed, skydiving is not for you. -- Francis Roberts ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
On Jul 24, 2011, at 4:01 PM, Tom Jeffries wrote: On Sun, Jul 24, 2011 at 12:12 PM, Andy Lee ag...@mac.com wrote: You should know that it is most certainly possible to use that syntax with a variable. For example: NSString *myString = @abc; // == a variable NSString *newString = [myString copy]; // == a message send You can send messages to both classes and instances of classes. If you are not clear about the difference between a class and an instance, let us know now so we can proceed on the same page. OK, we're each half right- myString in this case is a function, not a class, but I would question calling it a variable. No, myString is a variable. It is a variable of type NSString*. NSString is the name of a class. copy is the name of a method implemented by NSString, and used here as the name of a message sent to an instance of the class NSString. I suggest you review the docs on the Objective-C language. Apologies, I don't have time at the moment to find a link, but you really must grasp the basics of the language and terminology, if not to help you now then definitely in the (possibly near) future. You *must* be able to read the two lines above and without any question pick out which is a variable, which is a class name, which is a message send, etc. In Objective-C we distinguish between methods (be they instance methods or class methods) and functions, by which we usually mean C functions. It will serve you well to remember this when communicating with Cocoa developers. Maybe I'm old fashioned, but I think it's important to distinguish between information (variables) and operations (functions). I'm probably about as old-fashioned as you. :) That is one reason why I'm less than completely enthusiastic about Objective C syntax and Cocoa conventions. All of the Objective-C syntax we've looked at is perfectly clear about which symbols refer to variables, which to methods, and which to messages. Some people don't like the way it does it, but that is different from saying it doesn't make the distinctions. Study the language documentation and if you have more questions about the *language* (as opposed to the frameworks) the objc-language list is probably more appropriate objc-langu...@lists.apple.com. Typical stumbling blocks for newcomers are: the method syntax that intersperses arguments with parts of the method name; and how class methods work (they are not like static methods in Java). --Andy ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 10:57 AM, Julie Seif wrote: I really do not like Xcode 4. I feel like I'm a beginner all over again in Xcode 4... I was just so comfortable to the Xcode 3 and previous releases of Xcode interface. I've been a light user of the development environment since NeXTStep 2.1, and I feel this is the most radical change I've experienced. It set my development efforts back a couple of weeks as I fixed things that had broken, figure out how to do things again, find where the build products were placed, and so on. It was at times very frustrating. But give it a few weeks. Play with it a lot, especially on experimental projects and workspaces (not a production code base), and generally explore. I found it grew on me after a while. I look forward to some in-depth books (or e-books) on working with and getting the most out of Xcode 4.x. Todd ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
I have to come down strongly in favor of Xcode 4. I've only been using Apple's dev tools since ProjectBuilder (not Project Builder) but Xcode 4 is definitely the best since then. The built in IB, the ability to view your xib on one side and the related file's owner code on the other and then drag connect outlets and actions is awesome. Xcode 4 is new. It has some problems but it's getting better with each release. Apple is committed to it and it's what Apple uses so it will get even better. Honestly, I just do not see what is so appealing about Xcode 3. I've found some features missing (pre-compile for example would be nice to have back) but overall, Xcode 4 is much much better. It's almost as if the development team believes all developers use 11 Airs rather than the two-monitor 27 setup many prefer. I use a 27 iMac and an 11 MacBook Air. Lion makes Xcode on the 11 a useable tool. I can't imagine using Xcode 3 on the 11 Air. Change takes some getting used to and it takes time and a lot of folks don't have or don't want to spend the time. As far as I can remember though (Apple //e DOS 3 to ProDOS), Apple is acting as they always have. Xcode 3 is dead. Your next Mac won't run 10.6. Your PowerPC apps don't work anymore. That's how Apple rolls :::shrug::: Marc ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: + (void) initialize not getting called
On Jul 24, 2011, at 12:59 PM, Andy Lee wrote: Another thought -- is it possible you have a subclass of DBWord that implements +initialize and needs to call super? +initialize methods shouldn’t call super. The runtime sends the message separately to each class in the hierarchy. As to the original question — I don’t know why +initialize wouldn’t be called. The code looks OK to me. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: More on drawRect not getting called
On Jul 24, 2011, at 11:41 AM, Tom Jeffries wrote: Jens, I'm sorry if my naming conventions confuse you. I've been programming for 27 years on a wide variety of operating systems, and I'm afraid following Cocoa naming conventions is not high on my list. OK. It’s 33 years in my case, 15 of them at Apple. I don’t know if you work in a team, but one of the things you lean is that coding conventions are really important if you want other people to understand your code. And asking other developers on a mailing list for help with your code is an instance of that. If they can’t figure out what it means easily, they’re not going to bother to try to figure out what’s wrong with it. (And using terms like ‘function’ and ‘variable’ in ways that don’t match accepted usage doesn’t help, either.) The other detailed stuff I was going to say has already been echoed by other people. At a high level: what you’ve been saying so far indicates that you have some basic confusion about object-oriented programming and Objective-C. There’s nothing wrong with that; OOP is rather different than procedural coding, and Objective-C is a more classically object-oriented language than C++ or Java (it was directly inspired by Smalltalk, the first major OO language.) But I think that you should put your app on the back burner for a little while, read up on the Objective-C language, and try some simpler examples. I really don’t mean to sound patronizing. For comparison, I’ve been trying to learn some functional programming languages (Erlang, Scala) and find the whole approach pretty confusing. If I started trying to write a serious app in either of those, I’d probably get into a mess. So I’m trying to start slow and acclimate myself to the concepts. Which is what I’m advising you to do too. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 12:46 PM, Gary L. Wade wrote: As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. Please don’t do that. It’s just going to annoy the people who have to triage the incoming bug reports. “I don’t like this feature” is not a bug report, it’s an opinion about the user interface. And believe me, there are already enough people inside Apple with strong, and divergent, opinions about UI. I’m not saying you should shut up; just that a different medium like a blog post or a WWDC feedback session would be more appropriate. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 3:46 PM, Gary L. Wade wrote: As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. How do you stop the cycle if that works? People who hate horrible MS Windows UIs file bugs against XC4, making XC5 have a normal Mac UI. Then people who like horrible MS Windows UIs will file bug against XC5, causing everything to revert back to its current state for XC6. Clearly this must be what happened with XC3, getting us to where we are now. Except I don't remember any bug filing campaigns to organize people who love horrible MS Windows UIs... -Ed ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 2:28 PM, Ed Wynne wrote: People who hate horrible MS Windows UIs file bugs against XC4, making XC5 have a normal Mac UI. Then people who like horrible MS Windows UIs will file bug against XC5, causing everything to revert back to its current state for XC6. Clearly this must be what happened with XC3, getting us to where we are now. Except I don't remember any bug filing campaigns to organize people who love horrible MS Windows UIs... It’s not really a cycle. It’s that in the early days of OS X there were a lot of Mac developers who were used to IDEs like CodeWarrior and THINK C++ that opened a separate editor window for every file, and they complained about single-window UIs. So Apple added UI modes to Project Builder and Xcode to allow them to continue to work this way. Over time this has gotten to seem more and more like a legacy UI, and they’ve finally dropped it in Xcode 4. Calling this a “horrible MS Windows UI” is not only flamebait, it also shows you may not have been paying attention to the direction of Apple’s UI development over the past decade — many apps like iTunes, Mail, iPhoto, GarageBand, etc. have become strongly single-window oriented. Not to mention web browsers, which are now a dominant form of UI. (Also, I’m hardly an expert on all IDEs, but the non-Mac ones I’ve seen in the past few years, like Visual Studio and Eclipse, all seem to be pretty single-window-centric too.) —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
But, aren't we always asked to file feature requests in Bug Reporter? The feature request is this: Allow all those tiled views to be undocked as independent windows so that they can be moved around and sized freely. If you like them all stuck together, you can choose that style; if you don't, you aren't forced to do it. Makes everyone happy. On 2011-07-24, at 5:24 PM, Jens Alfke wrote: On Jul 24, 2011, at 12:46 PM, Gary L. Wade wrote: As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. Please don’t do that. It’s just going to annoy the people who have to triage the incoming bug reports. “I don’t like this feature” is not a bug report, it’s an opinion about the user interface. And believe me, there are already enough people inside Apple with strong, and divergent, opinions about UI. I’m not saying you should shut up; just that a different medium like a blog post or a WWDC feedback session would be more appropriate. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes%40utoronto.ca This email sent to dave.fernan...@utoronto.ca Begin forwarded message: From: Ed Wynne ar...@phasic.com Subject: Re: Does anyone else dislike Xcode 4? Date: 24 July, 2011 5:28:46 PM EDT To: cocoa-dev@lists.apple.com On Jul 24, 2011, at 3:46 PM, Gary L. Wade wrote: As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. How do you stop the cycle if that works? People who hate horrible MS Windows UIs file bugs against XC4, making XC5 have a normal Mac UI. Then people who like horrible MS Windows UIs will file bug against XC5, causing everything to revert back to its current state for XC6. Clearly this must be what happened with XC3, getting us to where we are now. Except I don't remember any bug filing campaigns to organize people who love horrible MS Windows UIs... -Ed ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/dave.fernandes%40utoronto.ca This email sent to dave.fernan...@utoronto.ca ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 4:24 PM, Jens Alfke wrote: On Jul 24, 2011, at 12:46 PM, Gary L. Wade wrote: As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. Please don’t do that. It’s just going to annoy the people who have to triage the incoming bug reports. “I don’t like this feature” is not a bug report, it’s an opinion about the user interface. And believe me, there are already enough people inside Apple with strong, and divergent, opinions about UI. I’m not saying you should shut up; just that a different medium like a blog post or a WWDC feedback session would be more appropriate. That's silly. Everyone at Apple always says, If it's not in Radar, we don't know about it. The decision makers aren't going to read your obscure little blog. And WWDC was sold out in one day; attendance is very limited. -Jeff ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 2:45 PM, Dave Fernandes wrote: But, aren't we always asked to file feature requests in Bug Reporter? The feature request is this: Allow all those tiled views to be undocked as independent windows so that they can be moved around and sized freely. If you like them all stuck together, you can choose that style; if you don't, you aren't forced to do it. Makes everyone happy. Sure, filing something as a feature request, rather than as “the way this works sucks and reminds me of Windows 3.1!!!”, would be productive. In this case, you’d need to explain what about your proposed feature would be different than the existing multiple-window UI you get by double-clicking an item in the navigator. —Jens ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
One of main problems I have with XCode 4 is the one window interface. While integrating IB made sense on some level, it also seems like if they're going to integrate IB, they should integrate editors for everything else (such as images). This is, of course, ludicrous. I'm a big believer in the philosophy of separate applications/tools for every job. Xcode 4 violates this philosophy by the integration of IB. Then again, I took part in writing Gorm (the GNUstep equivalent of IB), so I may be a bit biased about it going away. ;) GC On Sun, Jul 24, 2011 at 5:53 PM, Jeff Johnson publicpost...@lapcatsoftware.com wrote: On Jul 24, 2011, at 4:24 PM, Jens Alfke wrote: On Jul 24, 2011, at 12:46 PM, Gary L. Wade wrote: As I mentioned before, everyone should go to bugreporter.apple.com and enter bugs against this horrible MS Windows method of UI that prevents usable viewing of multiple files that has been added to Xcode. Please don’t do that. It’s just going to annoy the people who have to triage the incoming bug reports. “I don’t like this feature” is not a bug report, it’s an opinion about the user interface. And believe me, there are already enough people inside Apple with strong, and divergent, opinions about UI. I’m not saying you should shut up; just that a different medium like a blog post or a WWDC feedback session would be more appropriate. That's silly. Everyone at Apple always says, If it's not in Radar, we don't know about it. The decision makers aren't going to read your obscure little blog. And WWDC was sold out in one day; attendance is very limited. -Jeff ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/greg_casamento%40yahoo.com This email sent to greg_casame...@yahoo.com -- Gregory Casamento - GNUstep Lead/Principal Consultant, OLC, Inc. yahoo/skype: greg_casamento, aol: gjcasa (240)274-9630 (Cell) ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 2:53 PM, Jeff Johnson wrote: That's silly. Everyone at Apple always says, If it's not in Radar, we don't know about it. The decision makers aren't going to read your obscure little blog. The engineers say that. The decision makers about UI tend not to be engineers, and don’t pay much attention to Radar. (I’m not saying that’s a good thing, just that it’s how things happen at Apple. The UI designers there work in an extremely strong echo-chamber.) I don’t know that there is any effective way to get Apple to reconsider a UI. What seems to get the most results is to have a big enough critical mass of people yelling that they dislike it (on blogs, Twitter, forums, whatever) that it makes it into the press, which then might start to seem significant to Apple designers managers. For instance, one instance where this worked was with the orientation vs. mute switch on the iPad. —Jens___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: + (void) initialize not getting called
Thanks all. I figured out what I was doing wrong. I was expecting a higher level class (DBString) to call a DBWord method, when it bypasses DBWord altogether if it has shared data of it's own. If I delete all shared data, initialize is called correctly. On Jul 24, 2011, at 5:02 PM, Jens Alfke wrote: On Jul 24, 2011, at 12:59 PM, Andy Lee wrote: Another thought -- is it possible you have a subclass of DBWord that implements +initialize and needs to call super? +initialize methods shouldn’t call super. The runtime sends the message separately to each class in the hierarchy. As to the original question — I don’t know why +initialize wouldn’t be called. The code looks OK to me. —Jens ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
How many debugger windows/panes do you want open at a time? I can tell you how many I want and need: 1. I can only debug one app, why should I have 7? All interfering with my editing? I have tabs containing the current set of files that I am editing. Every one of them has an open debugger pane in it… So, I tried the trick with behaviours, assigning debugging to a special tab. Sure it seems to work, but it doesn’t. I still get debugger panes crowding out my editing windows. Worse, I might be editing a file on the far left tab. When I do a test run, it switches to the debug tab on the far right… now, which was the file I was editing? Because when the test has completed, I am left in the debugger tab… With Xcode 3, the last file I was editing was the one directly below the debugger window… UI disaster. Karl ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 3:34 PM, Karl Goiser wrote: So, I tried the trick with behaviours, assigning debugging to a special tab. Sure it seems to work, but it doesn’t. I still get debugger panes crowding out my editing windows. Make sure you also turn off the other settings in Run* behaviors, or they will modify your current tab when you start debugging. For example if you have Show tab [Debugging] and [Show] debugger with [Current Views] both turned on, then you will get a debugging tab in the last state that you set it in, and the current tab will show the debugger with whatever state you left it in. Worse, I might be editing a file on the far left tab. When I do a test run, it switches to the debug tab on the far right… now, which was the file I was editing? Because when the test has completed, I am left in the debugger tab… With Xcode 3, the last file I was editing was the one directly below the debugger window… Feel free to report a bug asking for new tabs to be opened next to the current tab instead of at the end of the tab list (assuming that is what you want). -- David Duncan ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
EXC_BAD_ACCESS in NSApplicationMain
In XCode 4.1. and Lion,, compiling for OS X 10.6, My application is crashing in main.m. Specifically it exhibits EXC_BAD_ACCESS errors in main.m, NSApplicationMain and obj_msgSend on disassembly. I've got symbolic breakpoints at: “objc_exception_throw” and “[NSException raise]“. Any idea how to get beyond this? Thanks, Joseph main.m #import Cocoa/Cocoa.h int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **) argv);Thread 1 EXC_BAD_ACCESS (code = 1, address = 0x553838b0) } Errors in objc_msgSend_disassembly_0x97876d54.s The offending line is 0x97876d54: movl 8(%edi,%edx,4), %eax Thread 1 EXC_BAD_ACCESS (code = 1, in NSApplicationMain_disassembly_0x94cd58f3.s The offending line is: 0x94cd58f3: testb %al, %al Thread 1 EXC_BAD_ACCESS (code = 1, in main.m, the offending line is: return NSApplicationMain(argc, (const char **) argv); Thread 1 EXC_BAD_ACCESS (code = 1, argc = (int) 1 argv = (char**) 0xbb18 Joseph Ayers, Professor Department of Biology and Marine Science Center Northeastern University East Point, Nahant, MA 01908 Phone (781) 581-7370 x309(office), x335(lab) Boston: 444 Richards Hall (617) 373-4044 Cellular (617) 755-7523, FAX: (781) 581-6076 Google Voice: (781) 346-9589 eMail: lobs...@neu.edumailto:lobs...@neu.edu iPhone: robopl...@gmail.commailto:robopl...@gmail.com http://www.neurotechnology.neu.edu/ http://robobees.seas.harvard.edu/ http://cyberplasm.net/ ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: EXC_BAD_ACCESS in NSApplicationMain
Hi Joseph, If you type 'bt' in GDB, do you see something like this by any chance?: #74 0x7fff8686f312 in -[NSIBObjectData initWithCoder:] () #75 0x7fff827fbe73 in _decodeObjectBinary () #76 0x7fff827fb2ed in _decodeObject () #77 0x7fff8686ea41 in loadNib () #78 0x7fff8686dfa1 in +[NSBundle(NSNibLoading) _loadNibFile:nameTable:withZone:ownerBundle:] () #79 0x7fff8686ddd9 in +[NSBundle(NSNibLoading) loadNibNamed:owner:] () #80 0x7fff8686b35b in NSApplicationMain () #81 0x000100011370 in main (argc=1, argv=0x7fff5fbff5c0) at main.m:13 (gdb) I started seeing this in Xcode 4.1 and 4.2 too. -- Tito On Jul 24, 2011, at 7:50 PM, Ayers, Joseph wrote: In XCode 4.1. and Lion,, compiling for OS X 10.6, My application is crashing in main.m. Specifically it exhibits EXC_BAD_ACCESS errors in main.m, NSApplicationMain and obj_msgSend on disassembly. I've got symbolic breakpoints at: “objc_exception_throw” and “[NSException raise]“. Any idea how to get beyond this? Thanks, Joseph main.m #import Cocoa/Cocoa.h int main(int argc, char *argv[]) { return NSApplicationMain(argc, (const char **) argv);Thread 1 EXC_BAD_ACCESS (code = 1, address = 0x553838b0) } Errors in objc_msgSend_disassembly_0x97876d54.s The offending line is 0x97876d54: movl 8(%edi,%edx,4), %eax Thread 1 EXC_BAD_ACCESS (code = 1, in NSApplicationMain_disassembly_0x94cd58f3.s The offending line is: 0x94cd58f3: testb %al, %al Thread 1 EXC_BAD_ACCESS (code = 1, in main.m, the offending line is: return NSApplicationMain(argc, (const char **) argv); Thread 1 EXC_BAD_ACCESS (code = 1, argc = (int) 1 argv = (char**) 0xbb18 Joseph Ayers, Professor Department of Biology and Marine Science Center Northeastern University East Point, Nahant, MA 01908 Phone (781) 581-7370 x309(office), x335(lab) Boston: 444 Richards Hall (617) 373-4044 Cellular (617) 755-7523, FAX: (781) 581-6076 Google Voice: (781) 346-9589 eMail: lobs...@neu.edumailto:lobs...@neu.edu iPhone: robopl...@gmail.commailto:robopl...@gmail.com http://www.neurotechnology.neu.edu/ http://robobees.seas.harvard.edu/ http://cyberplasm.net/ ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/tciuro%40mac.com This email sent to tci...@mac.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Hi David, On 25/07/2011, at 8:44 AM, David Duncan wrote: On Jul 24, 2011, at 3:34 PM, Karl Goiser wrote: So, I tried the trick with behaviours, assigning debugging to a special tab. Sure it seems to work, but it doesn’t. I still get debugger panes crowding out my editing windows. Make sure you also turn off the other settings in Run* behaviors, or they will modify your current tab when you start debugging. For example if you have Show tab [Debugging] and [Show] debugger with [Current Views] both turned on, then you will get a debugging tab in the last state that you set it in, and the current tab will show the debugger with whatever state you left it in. Nope, all others turned off. It’s when I pause the run. I have only changed the ‘run starts’ behaviour... Worse, I might be editing a file on the far left tab. When I do a test run, it switches to the debug tab on the far right… now, which was the file I was editing? Because when the test has completed, I am left in the debugger tab… With Xcode 3, the last file I was editing was the one directly below the debugger window… Not talking about a new tab. I’m talking about editing a file, then testing it. The behaviour moves me to the debug tab, but because the tabs are all next to each other, not layered windows, you don’t have an indication of the ‘last tab’ you were at, which it what is lost in moving from a windowed to a tabbed environment… Still, what’s the use of more than one debugging environment? Regards, Karl ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
I also had concerns re the changes, no-one likes their main work apps changed, for unknown reasons. But there are reasons, and if you watch the WWDC vids on Xcode you will learn how to make the most of these changes and why Apple has made this change. Mastering Schemes in Xcode 4 Mastering Source Control in Xcode 4 Maximizing Productivity in Xcode 4 are good. cheers Kevin___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Another cool point of XCode 4 is in fact the Souce Control, using git by start is amazing, and being able to commit (and also edit files while commiting) is really awesome. In really new and started with XCode in the end times of XCode 3, I used XCode 3 just for a few weeks and them XCode 4 was released. I really prefer XCode 4 than 3, its awesome. --- Wilker Lúcio http://about.me/wilkerlucio/bio Kajabi Consultant +55 81 82556600 On Sun, Jul 24, 2011 at 8:08 PM, Kevin Bracey ke...@ilike.co.nz wrote: I also had concerns re the changes, no-one likes their main work apps changed, for unknown reasons. But there are reasons, and if you watch the WWDC vids on Xcode you will learn how to make the most of these changes and why Apple has made this change. Mastering Schemes in Xcode 4 Mastering Source Control in Xcode 4 Maximizing Productivity in Xcode 4 are good. cheers Kevin___ 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: http://lists.apple.com/mailman/options/cocoa-dev/wilkerlucio%40gmail.com This email sent to wilkerlu...@gmail.com ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Jul 24, 2011, at 4:08 PM, Karl Goiser wrote: Hi David, On 25/07/2011, at 8:44 AM, David Duncan wrote: On Jul 24, 2011, at 3:34 PM, Karl Goiser wrote: So, I tried the trick with behaviours, assigning debugging to a special tab. Sure it seems to work, but it doesn’t. I still get debugger panes crowding out my editing windows. Make sure you also turn off the other settings in Run* behaviors, or they will modify your current tab when you start debugging. For example if you have Show tab [Debugging] and [Show] debugger with [Current Views] both turned on, then you will get a debugging tab in the last state that you set it in, and the current tab will show the debugger with whatever state you left it in. Nope, all others turned off. It’s when I pause the run. I have only changed the ‘run starts’ behaviour… If you change all of them, it should stop the behavior your seeing. I just have Run starts/pauses/generates output/exits unexpectedly set to show my debugging tab and to do nothing else. Run completes does nothing at all. -- David Duncan ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: EXC_BAD_ACCESS in NSApplicationMain
On Jul 24, 2011, at 15:50, Ayers, Joseph wrote: In XCode 4.1. and Lion,, compiling for OS X 10.6, My application is crashing in main.m. Specifically it exhibits EXC_BAD_ACCESS errors in main.m, NSApplicationMain and obj_msgSend on disassembly. I've got symbolic breakpoints at: “objc_exception_throw” and “[NSException raise]“. Any idea how to get beyond this? Your application didn't really crash in NSApplicationMain, but Xcode has collapsed the backtrace so that you can't see the place it stopped. This is a usability issue in Xcode 4. With the Debugger tab of the Navigator pane visible, look at the level of detail slider at the bottom of the pane, and drag it all the way to right-hand end. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
I think that we need to differentiate between the new features that could easily have been put into Xcode 3, and the changes that have been made (to my mind) to wreck a great UI. Schemes and Git and the like do not justify the damage… Why would I want to see Interface Builder objects when I am editing source code (like I can in Xc4)? Why do I have to choose only one inspector at a time? Why can’t I see a project and a search and/or issues navigator at the same time? In order to get to the project information, why do I have to first open a project navigator, then click on the rot level of the tree? (The doesn’t seem very intuitive). Why is it that when I want want to change some settings about the app that I am testing (like whether to use GDB or LLDB or change some of the diagnostics), I have to go and edit a scheme (hidden away in a menu item, just like an issue that Apple uses to justify changing from Xc3 to 4…). Surely, it makes sense to put this sort of stuff in the UI with the project and target information? This what I think: ‘I need to add a malloc check. I’ll go to the project setting for this. No, hang on a minute, Apple has hidden this stuff elsewhere. I’ll go and have a look in the scheme area that I get to via that obscure menu item…’ I really don’t know how anybody expects people to write insanely brilliant use interfaces when they use one that borrows its cues from the ‘80s. Karl ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTask oddity with getting stdout
I'm using NSTask to run a background process, monitor its output, and ultimately present a message to the user. All has been fine with this 10.2 through 10.6, as far as I know. Now under 10.7 I saw a case where my code did not receive quite all the stdout output from the background process. I saw this once; I haven't tried running it a huge number of times, but it is definitely not the common case. (And I've never seen it in dev mode running under the debugger, only on a machine without dev tools. Also BTW, the output of the bg process is plain ASCII, no worries about multi-byte sequences.) Does anybody see anything wrong with this code (severely stripped for legibility): - (void) doSomeTask: (NSTask *) task { NSTask * task = [[NSTask alloc] init]; [task setLaunchPath: cmdpath]; [task setArguments: [self getArgs]]; [task setStandardError: [NSPipe pipe]]; [task setStandardOutput: [NSPipe pipe]]; [task launch]; curScanTask = [task retain]; curStdOutStr = [[NSMutableString alloc] init]; curStdErrStr = [[NSMutableString alloc] init]; curStdOut = [[task standardOutput] fileHandleForReading]; curStdErr = [[task standardError] fileHandleForReading]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector( processStdOut: ) name: NSFileHandleReadCompletionNotification object: curStdOut]; [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector( processStdErr: ) name: NSFileHandleReadCompletionNotification object: curStdErr]; [curStdOut readInBackgroundAndNotify]; [curStdErr readInBackgroundAndNotify]; } - (void) processStdOut: (NSNotification *) ntc { NSFileHandle *f = [ntc object]; NSData *d = [[ntc userInfo] objectForKey: NSFileHandleNotificationDataItem]; if( [d length] == 0 ) [self processPipeClose]; else { [f readInBackgroundAndNotify]; [curStdOutStr appendString: [[[NSString alloc] initWithData: d encoding: NSASCIIStringEncoding] autorelease]]; } } - (void) processStdErr: (NSNotification *) ntc { NSFileHandle *f = [ntc object]; NSData *d = [[ntc userInfo] objectForKey: NSFileHandleNotificationDataItem]; if( [d length] == 0 ) [self processPipeClose]; else { [f readInBackgroundAndNotify]; [curStdErrStr appendString: [[[NSString alloc] initWithData: d encoding: NSASCIIStringEncoding] autorelease]]; } } - (void) processPipeClose { [curStdOutStr appendString: [[[NSString alloc] initWithData: [curStdOut readDataToEndOfFile] encoding: NSASCIIStringEncoding] autorelease]]; [[NSNotificationCenter defaultCenter] removeObserver: self name: NSFileHandleReadCompletionNotification object: curStdOut]; curStdOut = nil; [curStdErrStr appendString: [[[NSString alloc] initWithData: [curStdErr readDataToEndOfFile] encoding: NSASCIIStringEncoding] autorelease]]; [[NSNotificationCenter defaultCenter] removeObserver: self name: NSFileHandleReadCompletionNotification object: curStdErr]; curStdErr = nil; } -- Scott Ribe scott_r...@elevated-dev.com http://www.elevated-dev.com/ (303) 722-0567 voice ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
Someone finally gets it! @Karl Goiser. Can anyone recommend where I can read up on (not something lengthy please) or watch how to make Xcode 4 work? Also, is there anyway I could create my app in Xcode 3.2.6 and then some how open it up in Xcode 4 and do the final build in there so that it works for the latest iOS? Any help would be overly appreciated. Julie. On Sun, Jul 24, 2011 at 8:11 PM, Karl Goiser li...@goiser.com wrote: I think that we need to differentiate between the new features that could easily have been put into Xcode 3, and the changes that have been made (to my mind) to wreck a great UI. Schemes and Git and the like do not justify the damage… Why would I want to see Interface Builder objects when I am editing source code (like I can in Xc4)? Why do I have to choose only one inspector at a time? Why can’t I see a project and a search and/or issues navigator at the same time? In order to get to the project information, why do I have to first open a project navigator, then click on the rot level of the tree? (The doesn’t seem very intuitive). Why is it that when I want want to change some settings about the app that I am testing (like whether to use GDB or LLDB or change some of the diagnostics), I have to go and edit a scheme (hidden away in a menu item, just like an issue that Apple uses to justify changing from Xc3 to 4…). Surely, it makes sense to put this sort of stuff in the UI with the project and target information? This what I think: ‘I need to add a malloc check. I’ll go to the project setting for this. No, hang on a minute, Apple has hidden this stuff elsewhere. I’ll go and have a look in the scheme area that I get to via that obscure menu item…’ I really don’t know how anybody expects people to write insanely brilliant use interfaces when they use one that borrows its cues from the ‘80s. Karl ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/juliethechang%40gmail.com This email sent to juliethech...@gmail.com -- ___ Julie Seif lovehatecreate.net All I want is to fly away, be free, move on, and love the people who really do love me. We aren't dealing with just a girl here, we are dealing with a girl who desprately and hopelessly wants to be free. That's why I picked part of your world for you to sing and in the end the amount of emotion you put in it from all the suffering you've dealt with these few months, proved I made an excellent choice. You NAILED IT! - Mr. Black. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Problem getting my layers to draw in the right order
Hi All, I'm having a problem establishing the right Z-ordering of Core Animation layers in a view. I've tried carefully controlling the stacking order of the view's sublayers, and I've also tried setting the zPosition property, but the problem I'm having remains. Here's a screen shot: http://apptree.net/images/salayer_problem.png The view's hosting layer contains 3 layers, all of which are CAReplicatorLayers, to provide the reflection effect. The left and right 'bargraph' layers are supposed to be behind the 'title' layer. As you can see, the one on the left is behind, but the one on the right draws the reflection in front of the text. Nothing I do seems to make any difference to the front-to-back ordering of the layers - naturally I want the text in front of all. I thought perhaps it's due to how reflections are calculated, but if that were the case the reflection on the left would draw over the text as well. Each of these three layers are directly set as sublayers of the view's hosting layer, and in turn the three have further sublayers to define and draw their content. I'm pretty new to Core Animation, and this is the first time I've used CAReplicatorLayer. Does anyone have some idea what's going on here? --Graham ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSTask oddity with getting stdout
On Sun, Jul 24, 2011 at 10:17 PM, Scott Ribe scott_r...@elevated-dev.com wrote: I'm using NSTask to run a background process, monitor its output, and ultimately present a message to the user. All has been fine with this 10.2 through 10.6, as far as I know. Now under 10.7 I saw a case where my code did not receive quite all the stdout output from the background process. I saw this once; I haven't tried running it a huge number of times, but it is definitely not the common case. (And I've never seen it in dev mode running under the debugger, only on a machine without dev tools. Also BTW, the output of the bg process is plain ASCII, no worries about multi-byte sequences.) Does anybody see anything wrong with this code (severely stripped for legibility): Interesting. THIS IS JUST ME SPECULATING OUT LOUD. I wonder if they've changed how the readInBackgroundAndNotify works. In particular, my guess here would be that: 1) Two threads are created to handle the stdout and stderr (may be dispatch queues, but let's say threads for this thought experiment). 2) Your task generates output in stdout, and most of it gets consumed. 3) Your task generates its last data and closes its stderr then stdout. 4) The stdout thread reads the last data and readies a notification, but doesn't get a chance to post it before being swapped. 5) The stderr thread sees a closed socket and posts a notification before being swapped. 6) The stdout thread wakes up, and posts its notification. Now you are in a situation where there are two notifications being delivered, and their order is wrong for your code. Namely, when the stderr notification arrives first you will do this: a) see that stderr is closed. b) try to read all the remaining data from stdout. There is none, because it has been queued already. c) remove yourself as a listener for stdout. d) try to read all the remaining data from stderr. e) remove yourself as a listener for stderr. The problem is step (c)! There might be data in the notification queue that you will never receive. Here's how I'd write your methods: - (void) doSomeTask: (NSTask *) task Same. - (void) processStdOut: (NSNotification *) ntc { NSFileHandle *f = [ntc object]; NSData *d = [[ntc userInfo] objectForKey: NSFileHandleNotificationDataItem]; if( [d length] == 0 ) { [[NSNotificationCenter defaultCenter] removeObserver: self name: NSFileHandleReadCompletionNotification object: curStdOut]; curStdOut = nil; } else { [f readInBackgroundAndNotify]; [curStdOutStr appendString: [[[NSString alloc] initWithData: d encoding: NSASCIIStringEncoding] autorelease]]; } } - (void) processStdErr: (NSNotification *) ntc { NSFileHandle *f = [ntc object]; NSData *d = [[ntc userInfo] objectForKey: NSFileHandleNotificationDataItem]; if( [d length] == 0 ) { [[NSNotificationCenter defaultCenter] removeObserver: self name: NSFileHandleReadCompletionNotification object: curStdErr]; curStdErr = nil; } else { [f readInBackgroundAndNotify]; [curStdErrStr appendString: [[[NSString alloc] initWithData: d encoding: NSASCIIStringEncoding] autorelease]]; } } That is, abandon processPipeClose and let each pipe handle its own close in the notification when you're sure all of its read notifications have actually been delivered. As you've presented it, processPipeClose isn't needed. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Disable implicit animations in layer backed NSScrollViews?
On Sun, Jul 24, 2011 at 10:00 PM, Daniel Waylonis d...@nekotech.com wrote: Hi Kyle, If you're back from vacation, could you describe how things were fixed in OmniPlan? I've got a blog post in the editing phase describing all the things we do to get NSScrollViews working, but the only other thing we do that I can think of is to swizzle -[NSClipView scrollToPoint:] to look like the following: - (void)scrollToPoint:(NSPoint)newOrigin { originalScrollToPoint(self, _cmd, newOrigin); [self fixLayerGeometry]; [[self subviews] makeObjectsPerformSelector:@selector(fixLayerGeometry)]; } -[NSView(LayerBackedFix) fixLayerGeometry] is defined like this: - (void)fixLayerGeometry { if (![self layer]) return; [CATransaction begin]; [CATransaction setDisableActions:YES]; for (NSView *subview in [self subviews]) { CALayer *layer = [subview layer]; CGPoint layerPosition = NSPointToCGPoint([self convertPointToBase:[subview frame].origin]); // note: on Lion, we want to use -convertPointToBacking: instead. layer.position = layerPosition; } [CATransaction commit]; } Pay attention to that note, since on Lion base coordinate systems don't mean the same thing as backing coordinate systems. I'm going to CC this to the list, since it's helpful information. Hope that helps! --Kyle Sluder ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
On Sun, Jul 24, 2011 at 8:52 PM, Julie Seif juliethech...@gmail.com wrote: Also, is there anyway I could create my app in Xcode 3.2.6 and then some how open it up in Xcode 4 and do the final build in there so that it works for the latest iOS? Xcode 4 projects are compatible with the latest Xcode 3. Schemes and workspaces exist independently. So you can do work in Xcode 3 and then switch to Xcode 4 to build, test, and submit. --Kyle Sluder ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Does anyone else dislike Xcode 4?
First off I will echo what a few others have said already and I'm sure a moderator will say fairly soon; this list is for the discussion of the Cocoa and Cocoa Touch APIs not the tools commonly used to develop using said APIs. There are forums and an Xcode users list that are appropriate for such discussions. For those of you groaning about the switch to the much requested single window UI (that actually was almost possible in Xcode 3) I just have to ask; why do you need so many windows open at the same time with various files? Is it because you are coding ADD style (write a few lines in this file then jump to another one then a third), or are you perhaps coupling you classes so tightly together that that are really just one huge class with numerous files. :) If you really want lots of open files for you project check out SubEthaEdit, (http://www.codingmonkeys.de/subethaedit/) it is a text editor designed for code of all flavors and can have either one window with tabs or multiple windows. It even has buttons to trigger builds in Xcode so you don't have to switch apps to build. You can close all of those extra bits that creep into the window, like the navigator/issues/etc area, debugger area, and detail/inspector area. The manual has the shortcuts listed. The bottom of the inspector area also has a code snippets section that you can add custom snippets that you can later drag into code (complete with tokens) in addition to the IB section (it also has a file template library that you can drag templates over to the navigation area if you don't want to use the new file assistant). On 25 Jul, 2011, at 12:50 AM, cocoa-dev-requ...@lists.apple.com wrote: Can anyone recommend where I can read up on (not something lengthy please) or watch how to make Xcode 4 work? There are actually several Xcode 4 documents on the developer site, there is even one specifically for transitioning from Xcode 3 to Xcode 4 (called 'Xcode 4 Transition Guide'). I know these constitute manuals and engineers don't read those but a couple hours reading the manual could save you lots of time and frustration later when you can't find something and just assume that the feature doesn't exist. Check the Tools Language section of the developer library for a complete list of Xcode related documents. :) These resources are in addition to the WWDC videos that have been mentioned already, and I am sure there will be numerous blog posts in the near future. Also, is there anyway I could create my app in Xcode 3.2.6 and then some how open it up in Xcode 4 and do the final build in there so that it works for the latest iOS? Yes, you won't get the new shinny bit of Lion that way, but you can write your entire app in Xcode 3 and then open the project in Xcode 4 just to build. I have used this for the Core Data prototyping tool that is currently MIA in Xcode 4 (yes, feature request has been filed, during WWDC actually). I have successfully opened projects in 3 4 going back and forth (mine are generally pretty small compared to most I think) without issue. Also, please notice the quote below, not sure who said it, but it is totally true. Mike Swan ETCP Certified Entertainment Electrician http://theMikeSwan.com http://www.michaelsswan.com Change itself is not painful it is resistance to change that causes pain. ___ 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com