Re: Core Data and ordered to-many relations
Didn't the OP want the relatives joined in a specific order (or, at least, be able to retrieve them in a specific order)? in the order prescribed. To do that, joins alone won't satisfy his query (Core Data structures are not guaranteed to return in any order). As I read them, his options were joins only or some other structure. In the OP's case, he'd need to have (as one possible solution) both a relationship entity and an order attribute of some kind in that entity to answer his request (the order attribute would also be as per dox). This would be the other structure, at least from my perspective. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Jerry Krinock je...@ieee.org: If there's only two relatives, as in your example, use two to-one relationships. If there's an indeterminate number, you can add an intermediate joiner entity, as explained here: http://www.cocoabuilder.com/archive/message/cocoa/2007/9/16/189293 The above joins between two different entities, so you'll modify it to join the same entity. All data modelling situations are a little different. ___ 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/jmunson%40his.com This email sent to jmun...@his.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: C language in obj-c
That depends upon the nature of the existing code... Quoting fawad shafi fawadpaki_...@hotmail.com: thanks for this useful info. is it possible? existing code that (possibly written in C) that we can easily port over to obj-c with minimum effort. Regards, Fawad Shafi CC: cocoa-dev@lists.apple.com From: alast...@alastairs-place.net To: fawadpaki_...@hotmail.com Subject: Re: C language in obj-c Date: Wed, 29 Apr 2009 11:33:54 +0100 On 29 Apr 2009, at 11:29, fawad shafi wrote: for example i write one program in c language and then compile it, the compiler will create the one .obj file for us. if i wana use that obj file in xcode or obj-c, is it possible?? The system compiler on Mac OS X doesn't make files with the extension .obj, even for plain C code. That's why I suspected you might be talking about some other compiler (my guess being Microsoft's, since that's the most common place where you might see a .obj extension). Anyway, the easiest thing to do is to put your C source files into your Xcode project and it will compile them and link them against the rest of your program. Then you don't need to bother about the object files at all. Kind regards, Alastair. p.s. Please always reply to the list as well as directly. -- http://alastairs-place.net _ Rediscover Hotmail®: Now available on your iPhone or BlackBerry http://windowslive.com/RediscoverHotmail?ocid=TXT_TAGLM_WL_HM_Rediscover_Mobile2_042009___ 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/jmunson%40his.com This email sent to jmun...@his.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: objc_exception_throw prior to launching nib file
You shoul post your code as it is difficult to discern your problem with the way you are describing things. In other words: Cannot perform operation without a managed object context What operation is being performed that could require an moc? If I set a breakpoint: In what, on what? the window (from nib) appears then gdb comes up What is strange is that the breakpoint should not be executed What do you mean by this? Breakpoints aren't executed, the debugger stops at that point (hence the term: break, meaning stop, and point, meaning place). You may then choose to execute the line at the breakpoint, or examine it, or whatever. The problem is not being able to debug the portion of code after the window appears. What are you doing that you can't do this? Is there a delegate missing? Are you certain that routine is even being called at all? If a managed object context were needed at that point, it should have said something when I run without code. No? Again, what do you mean, specficially by, when I run without code? ___ 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: SQLite 3 crash report - debugging help needed
How did you come by this crash log? From the 0x48, it looks like it's attempting to dereference an int passed into sqlite3VdbeExec where a pointer should go, but that's a wild guess. The crash log came from one of my testers. It's dying in sqlite3 code, so you have access to the source. Take advantage of that. If you can attach to it in the debugger around the time of the crash, you can observe the arguments passed into that last function call. How do I do that? That's something I haven't learned as yet. Thanks!!! ___ 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: IB Plugin help
Namaste! Thank you Kevin and Josh! Josh: To clear up the assertion error, Clean All Targets. There was some junk not getting dumped out of the project on successive builds. Also, you nailed it with the TextLength key. HomerDoh!/Homer I took Apple's file comment of MyFirstKey literally. While not terribly new with KVC, this is my first plugin and I thought Apple may be doing something different. So, I took the comment at face value. After changing TextLength to textLength, the plugin operates as expected. Kevin: [A] 1. Yes. 2. com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter, com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter Here's the output of the two terminal commands: 1st command (known): com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter = /Users/jcmii/JTAENTLLCTextLengthLimiter/JTAENTLLCTextLengthLimiter/build/Debug/JTAENTLLCTextLengthLimiter.ibplugin; com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiterFormatter = /Users/jcmii/StashWizG/StashWizG/JTAENTLLCTextLengthLimiter.framework/Resources/JTAENTLLCTextLengthLimiter.ibplugin; 2nd command (loaded): com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter I do have two remaining questions: 1. How do I change that blue cube (which displays when the textfield is selected) to my graphic (like NSNumberFormatter and NSDateFormatter)? 2. When I deploy my application do I need to deploy my plugin to the Library/Frameworks directory on the client machine, or is it enough to bundle it with my application? Many Thanks!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting josh hughes co...@brikbatrecords.net: Hi Jon, I tried compiling the project you attached but I was still getting Assertion Failures so I built the project from scratch again and it loads into IB without Assertion Failures (I think there is definitely something not setup right in the project you attached!). O.k First off, just to check; you are adding the framework to your live app, i.e... in Groupes Files (in your live app!): Browse to Frameworks and select Other Frameworks. Right click (ctl click) and navigate to Add-Existing Frameworks. In the open panel, browse to and select /Library/ NameOfYourFramework.framework. Click Add. Other Frameworks should now look something like this: Other Frameworks/ NameOfYourFramework.framework AppKit.framework CoreData.framework Foundation.framework It Is important your live app has the framework added to it as your plugin is dependent on it and will crash if it's not there! Sorry if you are already doing this, I thought It's better to make sure as this is quite important! Secondly, I think the reason IB keeps opening the new document window when you try and reopen the .xib is because the encoder is failing to encode the @TextLength property as it is not KVC-Compliant, so the component crashes when you try to save the xib, hence it also crashes when you try to decode/open the doc. I noticed that the component's console was spewing out errors when I tried to save or reopen an .xib the the component in it (in a live app): 009-04-05 12:32:51.436 Interface Builder[26488:10b] An exception was thrown during execution of an NSScriptCommand... 2009-04-05 12:32:51.438 Interface Builder[26488:10b] [JTextLengthFormatterView 0xaa82730 valueForUndefinedKey:]: this class is not key value coding-compliant for the key TextLength. I changed: [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: [NSArray arrayWithObjects:@TextLength, nil]]; to: [[keyPaths objectForKey:IBAttributeKeyPaths] addObjectsFromArray: [NSArray arrayWithObjects:@textLength, nil]]; and this seems to have stopped the crashing when reopening the .xib. I have the project working here and can send you a .zip if you like? Hope this helps. All the best, Josh On 5 Apr 2009, at 01:10, jmun...@his.com wrote: Sorry for going quiet like that! I got distracted! No problem! :) I think that the fact IB is asking you to create a new document is a good thing! Actually, not in this case. The plugin seems to work fine within its project, so I decided to try and install it so I could use it in my other (live) project. I created a new window xib (imaginatively called test), put a textfield on it and saved it. Then, I added the formatter to the textfield, gave it a value of 5 and saved that. On re-open, IB then asked me what sort of resource to create - test was corrupted I suppose. I believe that when the project builds, the compiler automatically launches the target/s (in this case an IB Plugin Component/bundle) which in turn loads the plugin into IB and asks for you to create a new document (to test it out)!? So I think so far things are looking good! In the case of the plug-in only, yes, it seems viable. However, live is not the case. However, when I compiled the project, the component crashed IB, warning about an Assertion Failure:
Re: IB Plugin help
Namaste! Is this the proper way to do that: - (NSImage *)ibDefaultImage { NSBundle *myBundle = [NSBundle bundleWithIdentifier:@com.MyCompany.MyPluginName]; NSString *someString = [myBundle pathForResource:@SomePic ofType:@png]; NSImage *someImage = [[[NSImage alloc] initWithContentsOfFile:someString] autorelease]; return someImage; } When I ran it, I got the nifty little icon rep of plug-in. Many Thanks!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Brandon Walkin bwal...@gmail.com: I haven't yet made an IB plugin with a custom formatter, but I'd assume you change that image the same way you change the image that appears in the document window. Return your own image in the -ibDefaultImage method in your integration category. On 5-Apr-09, at 9:31 AM, jmun...@his.com wrote: 1. How do I change that blue cube (which displays when the textfield is selected) to my graphic (like NSNumberFormatter and NSDateFormatter)? ___ 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: IB Plugin help
Namaste! sigh Still getting no action after attempting to add my plug-in to IB. No error either. I compared my target property settings with yours and BGHUD to be sure I hadn't goofed on something - everything seems well there (I reverted my settings which were retrieved from someone else's post to what I think are the default settings and that cleared up any previous errata). I cleaned my targets and recompiled. No errors of course. I moved the ibplugin file to the location you shared below. I copied the release framework folder to the ~/library/frameworks section of my disk. Attempting to add that to IB results in no-action (through Preferences-Plug-ins). No message, no action, nothing. Double-clicking the ibplugin results in the same thing. ARRRGGGHHH :/ does charlie brown head-banging-on-wall-thing What am I missing? I'd be happy to zip up and send the project to someone (nothing spectacular in it after all) who would like to take a look at it. Thanks for any further help!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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: IB Plugin help
Namaste! Well, I don't know that I did anything different as I haven't changed anything since the last email... But now the plugin is showing up in IB... ??? Oh well, hopefully that will be the end of the drama... Thanks everyone!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting josh hughes j...@brikbatrecords.net: Hi Jon, This might be a bit random as I've only just started reading this thread. I was wondering if you have a copy files build phase setup for your framework. When I'm building an IBPlugin I usually create a new copy files build phase for the framework target with /Library/Frameworks as the destination and drag in the framework from the Products group. This way the framework is automatically copies the framework to the right location at build time. b.t.w you said that: I copied the release framework folder to the ~/library/frameworks section of my disk. maybe try /Library/Frameworks rather than ~/Library/Frameworks. Also, make sure to add the framework to any project you wish to use it in! Sorry if this is irrelevant or you have already done so! Hope this helps, Josh p.s send a zip to my address if you like, no guaranties! On 4 Apr 2009, at 15:47, jmun...@his.com wrote: Namaste! sigh Still getting no action after attempting to add my plug-in to IB. No error either. I compared my target property settings with yours and BGHUD to be sure I hadn't goofed on something - everything seems well there (I reverted my settings which were retrieved from someone else's post to what I think are the default settings and that cleared up any previous errata). I cleaned my targets and recompiled. No errors of course. I moved the ibplugin file to the location you shared below. I copied the release framework folder to the ~/library/frameworks section of my disk. Attempting to add that to IB results in no-action (through Preferences-Plug-ins). No message, no action, nothing. Double-clicking the ibplugin results in the same thing. ARRRGGGHHH :/ does charlie brown head-banging-on-wall-thing What am I missing? I'd be happy to zip up and send the project to someone (nothing spectacular in it after all) who would like to take a look at it. Thanks for any further help!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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/cocoa%40brikbatrecords.net This email sent to co...@brikbatrecords.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: IB Plugin help
Namaste! So, not the end of the drama. The plugin shows in the list and is available in IB. However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Any thoughts anyone? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting jmun...@his.com: Namaste! Well, I don't know that I did anything different as I haven't changed anything since the last email... But now the plugin is showing up in IB... ??? Oh well, hopefully that will be the end of the drama... Thanks everyone!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting josh hughes j...@brikbatrecords.net: Hi Jon, This might be a bit random as I've only just started reading this thread. I was wondering if you have a copy files build phase setup for your framework. When I'm building an IBPlugin I usually create a new copy files build phase for the framework target with /Library/Frameworks as the destination and drag in the framework from the Products group. This way the framework is automatically copies the framework to the right location at build time. b.t.w you said that: I copied the release framework folder to the ~/library/frameworks section of my disk. maybe try /Library/Frameworks rather than ~/Library/Frameworks. Also, make sure to add the framework to any project you wish to use it in! Sorry if this is irrelevant or you have already done so! Hope this helps, Josh p.s send a zip to my address if you like, no guaranties! On 4 Apr 2009, at 15:47, jmun...@his.com wrote: Namaste! sigh Still getting no action after attempting to add my plug-in to IB. No error either. I compared my target property settings with yours and BGHUD to be sure I hadn't goofed on something - everything seems well there (I reverted my settings which were retrieved from someone else's post to what I think are the default settings and that cleared up any previous errata). I cleaned my targets and recompiled. No errors of course. I moved the ibplugin file to the location you shared below. I copied the release framework folder to the ~/library/frameworks section of my disk. Attempting to add that to IB results in no-action (through Preferences-Plug-ins). No message, no action, nothing. Double-clicking the ibplugin results in the same thing. ARRRGGGHHH :/ does charlie brown head-banging-on-wall-thing What am I missing? I'd be happy to zip up and send the project to someone (nothing spectacular in it after all) who would like to take a look at it. Thanks for any further help!!! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 8:28 PM, jmun...@his.com wrote: OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss This actually depends on what you'd like to do. For my own apps, I do what is documented in the ReadMe file from my sample plugin (see the 'Installation' section). In my case, I put the IBPlugin into the framework's resources folder: + MyIBPluginFramework.framework + Versions + A + Resources + MyIBPlugin.ibplugin NOTE: There are other files/folders too; above just shows specifically where the plugin resides. ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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/cocoa%40brikbatrecords.net This email sent to co...@brikbatrecords.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/jmunson%40his.com This email sent to jmun...@his.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
Re: IB Plugin help
Namaste! Thank you for your reply. If I run the plug-in in debug mode, I DO get an assertion failure: Assertion Message: Two plug-ins (com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter and com.JTAENTERPRISESLLC.JTAENTLLCTextLengthLimiter) both integrate a class description for the class JTAENTLLCTextLengthLimiterFormatter. The primary definition for the class should only come from one plug-in; the other plug-in should be declaring a category. Declaring a category is accomplished by omitting the super class from classdescription file. Backtrace: 0. Interface Builder0x4d29 [IBApplication handleAssertion:inFile:onLine:] 1. InterfaceBuilderKit 0x0038d242 [IBClassDescriber refactorWithActionChangeTypeRefactoringOperation:inDocument:error:] 2. InterfaceBuilderKit 0x002c4033 [IBPlugin didLoad] 3. InterfaceBuilderKit 0x002c389f [IBPluginController loadPluginAtPath:error:] 4. InterfaceBuilderKit 0x002ca5e3 [IBPluginController loadPluginWithIdentifier:error:] 5. InterfaceBuilderKit 0x002ca519 [IBPluginController restorePreviouslyLoadedPluginsFromIdentifiers:] 6. Interface Builder0x23db [IBApplication finishLaunching] 7. AppKit 0x950c73a3 [NSApplication run] 8. AppKit 0x950948a4 NSApplicationMain 9. Interface Builder0x4eca [IBApplication changeInspectorMode:] 10. ??? 0x3 I don't know how to fix that. I don't know why it thinks I have two plug-ins. If I run in release mode, it appears to load up and function EXCEPT upon re-loading a nib. I hadn't been running in debug mode once I got the plug-in actually working correctly, so there's got to be a change I made that caused this (that would be a Homer doh moment). What I mean is, if I put it in a live project by putting the framework in a more public place (like Library/Frameworks), then add it to a project, start IB, go into prefs-plugins and add it there, create a window nib, add a textfield to the window, then add the formatter, fill in the limit value, and save it, then close the nib, re-opening the nib results in IB asking what type of resource I'd like to create. I also noticed that under required frameworks the ibplugin file is displayed instead of the .framework file. I don't know how to fix that either. I'll be happy to forward the project to you if you'd like a gander, the file is 2.7mb in size. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Jonathan Hess jh...@apple.com: On Apr 4, 2009, at 1:48 PM, jmun...@his.com wrote: However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Hey Jon - Could you describe the failure in a little more detail? Are you running your plug-in and IB in the debugger? If so, is there an exception being raise? Jon Hess ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: IB Plugin help
Namaste! Just want to pass on some further information. After that last post, the assertion error really bothered me. So, after a while of careful inspection (to the limits of what I know), I decided to and clean[ed] all targets of both the debug and release builds and re-compiled. In the plug-in project, runs of both debug and release went smoothly - IB loaded the plug-in, I was able to use it, close and re-open nibs successfully. No errors. Deploying the plug-in is proving difficult. I copied the release framework to Library/Frameworks. I also copied the framework into the frameworks section of a live project. I then created a test.xib in my live project, which I subsequently opened. In the Preferences-Plug-ins pane for IB, I attempted to add the plug-in. I got nothing - no error, nor plug-in. I then added the ibplugin file to the Resources folder of the version A of the framework. I then repeated the process of copying. This time, the plug-in appeared in IB. I added a textfield to test.xib, and applied the plug-in to it. I saved and closed the file. Upon re-open, IB didn't open the xib, but popped up the standard create a resource dialog - test had gotten kaboshed. I do notice that the Required Frameworks is displaying the .ibplugin file instead of the expected .framework file. I don't know if that is related or not. Again, I'll be happy to send up the project should you want to see it. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Jonathan Hess jh...@apple.com: On Apr 4, 2009, at 1:48 PM, jmun...@his.com wrote: However, when I use it, my xib gets toasted - on next open IB asks what file I'd like to create. I had to restore a prior backup to rescue my xib. Hey Jon - Could you describe the failure in a little more detail? Are you running your plug-in and IB in the debugger? If so, is there an exception being raise? Jon Hess ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
RE:IB Plugin help
Namaste! Still plugging away at this... I found one mistake where I didn't change the IBInspector class of File's Owner in the Inspector.xib to my Inspector subclass. Doing that gave me an entry in the bottom box of the library, but no object in the middle pane... How do I fix that? Also, the image isn't displaying either. I'm still getting the book entries under the Formatter name. That being said, I also notice that my Inspector subclass doesn't have any sort of reference to my Formatter object. Is it supposed to? I should think it may need one. The dox don't really go into that so I don't know for certain. So, do I code it into the .h? And also the .m? Boy, I wish there was an example to follow... Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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: IB Plugin help
Namaste! Thank you, that was/is a big help. I also found BGHUDAppKit which was/is also invaluable help. Between those two good examples I think I got my plug-in working (using it live is what remains to be seen). I have one more question: How does one replace the blue cube object icon that tags on the text field with my formatter's graphic? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 6:43 PM, jmun...@his.com wrote: I found one mistake where I didn't change the IBInspector class of File's Owner in the Inspector.xib to my Inspector subclass. Doing that gave me an entry in the bottom box of the library, but no object in the middle pane... How do I fix that? Also, the image isn't displaying either. I'm still getting the book entries under the Formatter name. That being said, I also notice that my Inspector subclass doesn't have any sort of reference to my Formatter object. Is it supposed to? I should think it may need one. The dox don't really go into that so I don't know for certain. So, do I code it into the .h? And also the .m? Boy, I wish there was an example to follow... See the following for an example: http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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: IB Plugin help
OK, now I have one more question. I'd like to install and use my plug-in. However, when accessing IB's preferences-Plug-ins and attempting to add the plug-in I get: 1) when simply adding the ibplugin an error that states the file is missing necessary resources and to reinstall the bundle, or 2) when opening the framework folder no error but also nothing else either. What else did I miss Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ricky Sharp rsh...@mac.com: On Apr 3, 2009, at 6:43 PM, jmun...@his.com wrote: I found one mistake where I didn't change the IBInspector class of File's Owner in the Inspector.xib to my Inspector subclass. Doing that gave me an entry in the bottom box of the library, but no object in the middle pane... How do I fix that? Also, the image isn't displaying either. I'm still getting the book entries under the Formatter name. That being said, I also notice that my Inspector subclass doesn't have any sort of reference to my Formatter object. Is it supposed to? I should think it may need one. The dox don't really go into that so I don't know for certain. So, do I code it into the .h? And also the .m? Boy, I wish there was an example to follow... See the following for an example: http://www.instantinteractive.com/private/samplecode/MyIBPlugin.zip ___ Ricky A. Sharp mailto:rsh...@instantinteractive.com Instant Interactive(tm) http://www.instantinteractive.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: Core Data: is fetching safe during validateForInsert:/validateForUpdate?
Namaste! This is off-list. You know, I just went through this with the validateKey: bit. I found that a side effect of fetching during that validateKey was the save all pending changes bug. I then tried the performSelector, which worked, however, then the validateKey was no longer getting used properly (I was working through it to figure it out). That is, by using the performSelector, the validateKey was bypassed and not in-line (which makes sense after having thought about it). Boy, was that a bummer. I simply wanted to keep the user from entering the same code for two things in an attempt to help. I'm still working out how to get around that mess - probably need to keep some sort of global that contains a list against which to compare. This is NOT the purpose of a database unfortunately...anyway. For now I've simply commented out my validate code. In your case, though, I *think* the iClass example may be of help. See the number generator class contained therein as it does what you want (at least mostly). I'd avoid fetching whenever inserting, saving, or some other operation where you don't want to save stuff first, occurs. Would be nice if fetching had an optional parm to NOT save first and just deal with the current data... Just my two cents. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ben Trumbull trumb...@apple.com: Is it OK to perform a fetch during validateForInsert:/ validateForUpdate:? I have a Core Data entity named 'Person' with an attribute named 'uniqueNumber'. I want to ensure that no two People have the same uniqueNumber. It's not a great idea during validateForDelete: It fine during validateForInsert or validateForUpdate so long as the awakeFromFetch delegates and any other side effects (changes on the MOC or dirtying MOs) of fetching eventually reach a quiescent state. The canonical example of failing to do so is to update a timestamp in -willSave to the current time. Blindly. Without checking if it's already set, or equal. We'll save when the current time stops changing ... - Ben ___ 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/jmunson%40his.com This email sent to jmun...@his.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: Core Data: is fetching safe during validateForInsert:/validateForUpdate?
Guess that WASN'T off-list. Sorry for the noise! ___ 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: NSTableView Popup Column issue
Namaste! Thank you for your reply. See my commentary below. However, my question still remains unanswered. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Kyle Sluder kyle.slu...@gmail.com: On Fri, Feb 6, 2009 at 3:36 PM, Jon C. Munson II jmun...@his.com wrote: Well, using selection didn't work (now that I've had an opportunity to test it). It definitely needs to be arrangedObjects (or something similar). So, it isn't that. Arranged Objects is plural. Selected Object is singular. It should be apparent why this is not going to work out, and why you're winding up with the -description representation of an array in your popup menu. Table views, on the other hand, support multiple selection, so the bindings for NSTableView are plural: Selected Indexes. Actually, it isn't obvious. If it were, I'd get it. The reason selection didn't work (and I should have seen that earlier) is that it is singular in nature. If you create a form, with fields on it, you'd use selection as you are only dealing with one record at a time (in what I'm doing, selection is the same as currently selected record). This is simply not functional for a tableview as the tableview works off of collections of objects. Setting the SelectedObject binding of the popup column to arrangedObjects will correctly display the object's chosen display field data (for lack of a better descriptor) for each of the rows in the collection - selection will not. Selection only displays the value that is currently selected in the popup, regardless of the underlying data, and the same value is then displayed across all the rows. Why are you binding Selected Object to a collection of objects? Typically the Cocoa controls automagically set up their selection bindings when bound to a controller anyway. This is something that I have not seen documented, but that Apple employees on this list have confirmed. I know it's true for NSTableColumn. Are you saying that I don't need to bind the Selected Object of the popup at all? This is contrary to what I've seen in the samples. I'll give it a shot though as it is easy enough. Also, you are aware that Core Data allows for many-to-many relationships without intermediary entities (they are not called tables), right? I understand you have attached attributes to this relationship, and you need an intermediary entity in this case. Yes, Core Data does allow for many-to-many relationships. However, after a solid week of fooling around with trying to get that to work (there are only so many permutations one can use), I was not able to produce a working prototype. Nor did I see any samples that covered that particular arrangement. You are welcome to give it a shot though. Create a simple test. Two entities, Person and Hat. Many-to-many relationship. A person can wear many hats, and a hat can be worn by many people. I couldn't get this to function w/o an intermediary entity. Interestingly enough, the Core Data dox state that when SQLite is used as the store, in a many-to-many relationship, the intermediary table is automatically generated (which is the behavior I expect). Your naming convention is also rather screwy. It looks like Bastardized Hungarian (aka Anti-Hungarian Notation, according to Larry Osterman: http://blogs.msdn.com/rick_schaut/archive/2004/02/14/73108.aspx ). It conveys no useful information; in fact, since Cocoa (and KVO in particular) rely on the dynamic nature of the ObjC runtime, your prefixes are lying. And of course, they're incorrect, since there's no such thing as a table in Core Data land. I would suggest ending your prefixing habit now before you confuse yourself when what you thought was a tbl winds up being an _NSKeyValueObservingEntity in the debugger. The only naming convention rule I saw was that names need to begin with lower case letters (this due to macro facilitation for the creation of accessors, etc.). I use a naming convention that is particular to my needs, not the whole world or some purist's notion. Also, names should indicate the objects they represent. tbl, or table, is descriptive enough for me to know what it is without having to look it up somewhere else. And, isn't that the real point? Sure, we could argue what something really is, but that may not help you later - especially if there is a great deal of abstraction going on. If I had an entity that wasn't a table, I'd give it the appropriate prefix. Let's not get off on a tangent of naming things as that is definitely a matter of personal preference. What matters is that the code is readable, not too cryptic, and you can remember what you did later down the road with minimal commenting. As a tangent, when doing database design, one begins with entities but those turn into tables so, in reality, one is really designing tables. Entities are first used to described high-level
Re: Using NSWorkspace's launchedApplication to detect running App
Specifically, in his case, wouldn't it be: aDictionary valueForKey:@NSApplicationName] isEqualToString: @MyApplication ? Quoting Jean-Daniel Dupas devli...@shadowlab.org: Le 13 déc. 08 à 18:14, John Love a écrit : I do not understand why this code completes with the specified application not being active .. when it really is? I really need your help. BOOL AppActive = NO; NSWorkspace *workSpace; NSArray *runningAppDictionaries; NSDictionary *aDictionary; workSpace = [NSWorkspace sharedWorkspace]; runningAppDictionaries = [workSpace launchedApplications]; for (aDictionary in runningAppDictionaries) { if ([aDictionary valueForKey:@NSApplicationName] == @My Application) { AppActive = YES; break; } } return AppActive; Thanks ... Because operator overriding does not exists in Obj-C and so, == is a pointer comparaison and not a string comparaison. use the isEqual: method to compare two object. ___ 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/jmunson%40his.com This email sent to jmun...@his.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: Can't launch a new Window at click of a button
I second the printed material. Search for menu implementations as a way to get started. Also, a book like Hillegass' Cocoa Programming for Mac OS X Third Edition is a good place to start. However, for expedience's sake, here's a kick start with but one way to open another window from a seperate nib (you will need to know how to create a controller class, etc., for the other nib): In your implementation header file add (near the top, under the imports): @class MyNextWindowControllerClass; In the same file, add in your implementation section: MyNextWindowControllerClass *myNextWindow; In your implementation file add (under the main imports) #import MyNextWindowControllerClass.h In your code that the button will call: - (IBAction)showMyNextWindow:(id)sender { // myNextWindow nil? if (!myNextWindow) { // create a new needle window myNextWindow = [[MyNextWindowController alloc] init]; } // display the window [myNextWindow showWindow:self]; } This may not be the absolute best way but it does work. Do review the calls, etc., as I'm sure you'll have follow-on questions. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Shraddha Karwan [EMAIL PROTECTED]: Thanks for the reply but I have gone through this tutorial, it doesn't talk about advanced stuff of adding multiple windows and the nib files, file owners etc in detail. On Thu, Dec 11, 2008 at 6:48 PM, rajesh [EMAIL PROTECTED] wrote: May be its good to follow a printed material first. This link got basic some stuff in it, http://developer.apple.com/documentation/cocoa/conceptual/objctutorial/01Introduction/chapter_1_section_1.html ~Rajesh -- Regards, Shraddha ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Tracking down issue; Bad call?
Namaste! In my app I have the following (a Save Panel call): [sp beginSheetForDirectory:sDefDir file:@ modalForWindow:[self window] modalDelegate:self didEndSelector:@selector(didEndSaveFileSheet: returnCode:contextInfo:) contextInfo:nil]; That call then calls this: - (void)setDownloadPathName:(NSString *)aString { [self willChangeValueForKey:@mDownloadFolderPath]; mDownloadFolderPath = aString; [self didChangeValueForKey:@mDownloadFolderPath]; } sDefDir is a class member NSString that is set on awakeFromNIB (set to NSHomeDirectory). I know it has a value because it is used to prior to any of this stuff and works fine. It is only set in awakeFromNIB and remains unchanged otherwise. When I run the program and watch the call, hovering over the variable shows me its value is invalid. Other runs show it has garbage data. I assume this is why the Save Panel call jumps to where it does, although why there I haven't a clue. 'Course this leads to me ask WHY is sDefDir invalid??? What happened to it and where did it happen? I don't have any other place in the code that sets sDefDir - only awakeFromNIB. Anyone have a clue??? Thanks in advance! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: Tracking down issue; Bad call?
Thank you for the reply. For clarification: - (void)awakeFromNib { //... sDefDir = NSHomeDirectory(); [sDefDir retain]; //... } I added the retain per a different response and that cleared up my issue. Knowing about the retain also added some clarity as to how the overall system operates too... Thanks guys! Peace, Love, and Light, /s/ Jon C. Munson II Quoting I. Savant [EMAIL PROTECTED]: On Thu, Dec 11, 2008 at 10:20 AM, [EMAIL PROTECTED] wrote: sDefDir is a class member NSString that is set on awakeFromNIB (set to NSHomeDirectory). I know it has a value because it is used to prior to any of this stuff and works fine. It is only set in awakeFromNIB and remains unchanged otherwise. 'Course this leads to me ask WHY is sDefDir invalid??? What happened to it and where did it happen? I don't have any other place in the code that sets sDefDir - only awakeFromNIB. How can we know? You never show us where or how you create sDefDir. -- I.S. ___ 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 [EMAIL PROTECTED]
[SOLVED] Re: NSTextField setStringValue not updating properly
I am posting this for the benefit of those who are coming into this area as new folk. Thanks to anyone who provided help. This is a short description of how I solved my issue and not meant to be a tutorial of any kind. After staring at it for multitudes of hours, I decided a different approach was necessary. What I ended up doing was implementing KVC and KVO for the variable with which I was experiencing trouble. This is (at least) done by creating a property, or by implementing the getter(s)/setter(s) w/ the appropriate key-value observing structure. There are probably a number of examples out there. Hillegass demonstrates that in his book (I keep touting it - it's good). I bound the textfield's value to the member of the class that was used. That addressed the issue of keeping the textfield up-to-date with the value of the variable as required. I did, however, run into another issue: the run loop. Coming from the VB world, I hadn't really needed any sort of variables (extremely rarely, if ever) that hung around. Most everything I did there stuck by nature of the beast (depending upon where it was declared). Here, however, one has to deal with the run loop. I may not have a complete understanding of it, however, the part that matters for this thread is that given a set of code it will only execute that code once and only on the information it has at the time of execution. Thus, if you need to pass data from one execution loop to another (think callback), it needs to persist. That's done either through the keyword static or, in the case of an NSObject of some kind, retain. In summary, changing over to KVC w/ KVO plus the retention factor fixed my issues. So, if you are having trouble with setStringValue, make sure you are going the KVC w/ KVO route check your bindings. Peace, Love, and Light, /s/ Jon C. Munson II ___ 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: how to pass arguments by reference
is this: (*int) the same as: (int *) ? I've always seen (int *) as the declaration... Quoting Dave DeLong [EMAIL PROTECTED]: Spoke too soon... whoops. Put an asterisk before the type, indicating that the type is going to come in as a pointer to the data and not the actual data. Then when you call the method, you use the ampersand to pass a pointer to your data, like so: (in some class definition somewhere. A C function would have slightly different syntax, shown below): - (void) foo:(*int)bar { (*bar)++; } Then elsewhere, int baz = 42; NSLog(@%d, baz); [someReceiver foo:baz]; NSLog(@%d, baz); You should see 42 printed, and then 43. If you wanted to declare foo as a C function, you'd do it like so: void foo (int *bar) { //same stuff } Welcome to the wonderful world of pointers. Dave On Dec 10, 2008, at 8:45 AM, Dave DeLong wrote: Put the before the variable type: - (UInt32) traverseTreeStraightReturnedDirection:(int)treeDirection... HTH, Dave On Dec 10, 2008, at 8:43 AM, Nick Rogers wrote: Hi, I have the following in my .m file: - (UInt32)traverseTreeStraightReturnedDirection:(int)treeDirection returnedTreeDepth:(int)treeDepth returnedKey:(HPlusCatalogKey)catKey lookForKey:(HPlusCatalogKey)lastKey { // code here } But the error when compiling is parse error before token. Is passing by reference not allowed or is there any other syntax that I should follow? Thanks, Nick ___ 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/davedelong%40me.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
NSTextField setStringValue not updating properly
Namaste! I've written a simple interface for ICA as part of my application. In that interface I have an NSTextField which holds a default path filename. Next to that field I have an NSButton for changing that information. It opens an NSSavePanel. I also have a Preview button that grabs the image on the scanner bed. This process downloads the file to a temporary directory filename. I pass the resulting path and filename via an IBOutlet which is hooked to the text field. These values can originate from the scan preview operation, the user typing, or the change button operation. The text field is not bound to any datasource. It *appears* to work on the surface, athough sometimes not even then. This is confusing the heck out of me. Anytime the value for the text field needs to change, I call [NSTextField setStringValue:(NSString *)aString]. After searching through the message archives, I either find bound fields or something else. The messages that address stuff close this stipulate using the above call. I have also tried validateEditing and display, both to no avail. I can't seem to locate another viable method to get the data stored (like a refresh). What appears to happen (in terms as best I can describe it, not necessarily technically correct) is that the text is written to the control's view, but, isn't saved to the underlying data structure. Thus, when I actually need the value later, I don't get what I see currently, but what was stored before. Hopefully that will make sense. In other words, it is as if there are two values: one for display, and one for data. They don't appear to get synched when I use setStringValue. So, my question is, what do I need to do to get the value actually stored and not just displayed? Thanks in advance! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: How Can I Notify DrawRect Method?
You both have valid points. However, I think you are missing something. That something being the overall goal of the application as predicated by that never-ever-returns: Time. That goal can be multi-faceted. For example, one item in the overall list is target platform. By deciding on what platform(s) to target, you can decide where to spend your time during to development to achieve the results you want. Sometimes that decision can also lead to split forks in the development tree (e.g., platform-specific support). Since I have found it nearly impossible to develop the perfect app before writing any code or going into some sort of demo mode, I favor an iterative design loop: get program parameters, code, test, check against parameters, check with client, lather, rinse, repeat. During that design/construction cycle, one should be able to identify what needs optimization, etc. That will cut down on the debate of technical theory - the proof being mostly in the pudding. Of course, the theory can help identify potential hotspots (items to watch) which can then be checked during testing cycles. Neither development time nor optimization are distinctly separate in my view - they are interdependent given the goal of the application. One may get favored over the other, but, again, that depends upon the restrictions placed by the goal of the application. Quoting Michael Ash [EMAIL PROTECTED]: On Wed, Dec 10, 2008 at 7:05 AM, I. Savant [EMAIL PROTECTED] wrote: On Dec 9, 2008, at 10:32 PM, Michael Ash wrote: This is a common response whenever I talk about not optimizing where it's not useful. But the thing is, trying to optimize every little thing makes your app *slower*. ... Of course you'll have gone through only a miniscule fraction of the bolts in the bridge before the people who hired you to build it get fed up and tell you to open it for traffic or get lost. Result: a very heavy bridge. These are two *completely* separate arguments: Development time versus runtime efficiency. They're not separate at all. Development time is always limited. You achieve the best runtime efficiency by focusing that development time where it can do the most good. Disregarding this by trying to optimize every piece of code in your app makes your app slower because you won't have time to do a good job on every piece of code in your app, not even close. Mike ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Detecting the Enter Key
I'm certain he means: Physical key: actual key on keyboard that was pressed (may be independent of the letter/word/symbol on the key face) Logical key: this would map to the letter/word/symbol on the key face, regardless of physical placement on the board HTH, Peace, Love, and Light, /s/ Jon C. Munson II Quoting Eric Gorr [EMAIL PROTECTED]: On Dec 10, 2008, at 2:28 PM, Michael Ash wrote: On Wed, Dec 10, 2008 at 12:43 PM, Eric Gorr [EMAIL PROTECTED] wrote: One way to check to see if the enter key has been pressed is to: [theEvent keyCode] == 0x04C where 0x04C is the keyCode corresponding to the enter key. (Is there an Apple defined constant for this key code?) Another way, found at: http://developer.apple.com/samplecode/TrackBall/listing9.html is to do: NSString *characters = [theEvent characters]; switch ([characters characterAtIndex:0]) { case NSEnterCharacter: case NSNewlineCharacter: case NSCarriageReturnCharacter: } My question is which method is the preferred or recommended way to detect this key in onKeyDown? Is there a better way? It really depends on whether you want to detect the physical key or the logical key. I am not sure if I understand the difference. Can you expand on this? ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: how to manage two nib files
Not knowing why you need an apple event...here's my two cents (and boff on those who don't like my feelings): 1. find your printer (it is obviously installed, yes?) - you should know how to locate that in the Mac's resources. (get a list of installed printers/devices, etc.) 2. you should be able to determine from the installation parameters whether it is installed via USB or network. 3. in your cocoa app, in your main nib, have a an object that uses that information to determine which nib to load from there. If you need information on how to work with nibs, etc., see NSBundle. Also, see Hillegass' book Cocoa Programming for Mac OS X Third Edition (that's the one I have). I'm sure there are multiple appropriate references available otherwise (incl. Apple dox as previously pointed out). Hope this helps! Peace, Love, and Light, /s/ Jon C. Munson II Quoting XiaoGang Li [EMAIL PROTECTED]: Thanks. I have read these references, but I still have no idea about my issue, Maybe I did not understand them completely now, but I am worried that maybe I have not give a clear expression in my first email. Maybe I need give a more detailed description: this application is a utility for my printer, which be launched by the utility button on the Printer Setup Center. when user click the utility button, the Mac OS X will launch the linked application. and the application should first register an apple event, the Mac OS X then will send the apple event which used to tell my utility the printer model name and related information about the device. So, before the appliction be launched, it should get the apple event and check the printer name, then it will load the nib file dependently. If the printer is a USB printer, it will load a normal window to interact with user, if it is a Network, it will launch another application to do other things. So, I have no idea to design this application. I think this question maybe can not be implemented by cocoa application template, but I know that it seems no need to use NSDocument class. Thanks. 2008/12/8 Kiel Gillard [EMAIL PROTECTED] http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSWindowController_Class/Reference/Reference.html http://developer.apple.com/documentation/Cocoa/Conceptual/Documents/Concepts/WinControllersAndNibs.html#//apple_ref/doc/uid/2026 http://cocoadevcentral.com/articles/64.php Hope this helps! On 08/12/2008, at 1:47 PM, XiaoGang Li wrote: Hi, List, I have a question about how to design my applicaiton in Cocoa. My applicaiton is not a normal application. it is a utility for my printer device. when user double-click the application icon, the application first register an apple event before any UI being shown, he application will receive a apple event from Mac OS later, which tells it that whether the device is USB-connected or Network-connected, when the application get this information, then it will launch the corresponding UI depend on the connect mode. (there are two nib files, one for USB, another for Network.). I have no idea how to manage two nib files, or two window controller. I hope soneone can give me some comments. thanks very much. XiaogangLi ___ 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/kiel.gillard%40gmail.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: What does 'DO' mean?
Distributed Objects Quoting mark [EMAIL PROTECTED]: What does 'DO' stand for? Mark ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Shell tool with GUI
Not to mention that the menu occupies an extremely small amount of screen real estate... Quoting I. Savant [EMAIL PROTECTED]: On Mon, Dec 8, 2008 at 11:13 AM, Nick Zitzmann [EMAIL PROTECTED] wrote: On Dec 7, 2008, at 10:57 PM, Chris Hiszpanski wrote: - How can I create a window without creating a full fledge application (i.e. without creating an instance of NSApplication)? While not technically supported, you can use anything in the AppKit after calling NSApplicationLoad() once. Sure, but unless you really know what you're doing and have a very good reason for doing it, this approach for a GUI-less app with a window is just plain silly. If you want a Cocoa program (avoiding use of the word application to avoid confusion with an NSApplication instance) with a window in the GUI, just create a normal Cocoa application and be done with it. Maybe the OP can give a more thorough description of what he's trying to accomplish and why he wants a window but no other GUI elements. It raises some pretty important questions: How will the user control this disembodied window floating on his/her desktop? Why have a window if you're making your user launch (and quit) the program from the command line? Sorry to harp on this, but it just seems like a very, very wrong way of approaching Mac OS X application design. -- I.S. ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: best practice to create Custom Objects represented by a image in a d-n-d operation
Hopefully this will come across well... If each ship you are dragging is a visual representation of a ship object, then, your receiver needs to be able to accept that object. While I don't know much about how drag-n-drop works (haven't implemented it yet), I imagine that what you need to know is well-covered in the documentation various examples as it is a basic/staple of a visual operating system such as Mac. Essentially, at least in older versions of Windows, you had some sort of object identifier that was passed and then the receiver acted on that identifier appropriately. Perhaps the newer systems will pass the whole object, or maybe (better) just a reference to it. Hopefully this will get you started. If not, just File 13 the message. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Gustavo Pizano [EMAIL PROTECTED]: Hello. I have in a view images of ships, and Im able to drag them to another view which is the sea board, now, what is better, to create the objects of the ships in the shipsviewcontainer and set the object in the Pasteboard, or, just have representative images in the shipsviewcontainer of each ship, and once dragged to the sea create the instances of the ship that the images represent. If the last one is correct Iw as thinking if how to know which Ship Object the images that is being dragged represents, (maybe by image Size? ) I dunno what do you think its better to do, if I explain my self good. Thanks Gus ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Device type list for scanners/cameras, etc...
Namaste! I'm working with ICA. Does anyone know any of the following: 1. What the list of device types are for connected devices? 2. Where I might find that list (in case you don't want to disclose it)? 3. Or, just the keywords for a scanner (I assume scanner but want to be sure) and a multi-function unit (I assume MFP but I want to be sure). I can't use the subtype method, so the corresponding kICA consts won't work in this instance - I need the full device type. Googling scanner camera device type values ICA didn't turn up anything other than the honorable mention in the Apple dox for camera. Thanks in advance! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: NSPredicateEditor and date comparisons
I remember, way long ago in the past, having to supply a time component to go with a date component - otherwise some seemingly random time was inserted which then threw off anything else I did. If I only needed a date (from a datetime field), I had to format it that way (as only a date, and in the format I needed) and do some seemingly-odd comparison (like comparing two strings). It worked, so I didn't care past that point. Quoting Chris Idou [EMAIL PROTECTED]: Would your time zone happen to somehow correspond to 8:00 ? Try doing a setDateValue on the gui component before you start, with a particular time. I've got a suspicion that it will then leave the time component alone. When you got a result of 13:41:40, might that have been the time you ran the program? --- On Sun, 7/12/08, Josh Abernathy [EMAIL PROTECTED] wrote: From: Josh Abernathy [EMAIL PROTECTED] Subject: Re: NSPredicateEditor and date comparisons To: [EMAIL PROTECTED] Cc: Cocoa-Dev List cocoa-dev@lists.apple.com Received: Sunday, 7 December, 2008, 5:00 PM Ah, yes, that would be the more accurate way to explain it. I have an NSDatePicker in my NSPredicateEditor and no funny business is going on with conversions. It's just the simple default, setup-in-IB usage. So I guess the question is better put: is there any guarantee about the time of an NSDatePicker in an NSPredicateEditor? I created a quick test of an NSDatePicker outside an NSPredicateEditor and its default time seems to be 8:00:00. On Dec 7, 2008, at 5:57 PM, Chris Idou wrote: I'm a bit confused by your post. NSPredicateEditor doesn't compare any dates, it just creates NSPredicates. Maybe you're saying that if you have a NSDatePicker in your NSPredicateEditor, that it creates a predicate with a date set to 13:41:40. If that's the case, then it probably has more to do with the NSDatePicker than predicates. Unless you're converting the predicate to a string, which introduces more complications. NSPredicateEditor tends to just call objectValue on the gui component, so try calling that yourself on your NSDatePicker and see what happens. --- On Sun, 7/12/08, Josh Abernathy [EMAIL PROTECTED] wrote: From: Josh Abernathy [EMAIL PROTECTED] Subject: NSPredicateEditor and date comparisons To: Cocoa-Dev List cocoa-dev@lists.apple.com Received: Sunday, 7 December, 2008, 11:14 AM Hi all, In my application, users have the option of comparing to a date in an NSPredicateEditor. For the NSDates it is comparing against, only the date is important; time doesn't matter. The interesting thing I found about NSPredicateEditor is the NSTimeInterval it compares my NSDates to has the time set to 13:41:40. That means my NSDates with the default 12:00:00 time don't match an is predicate. It's not a big deal because I can just change my NSDate's time to 13:41:40 to fix the problem. But what I'm wondering is if this is guaranteed to always be true. I couldn't find it anywhere in the documentation. Thanks, Josh ___ 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/idou747%40yahoo.com This email sent to [EMAIL PROTECTED] Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now http://au.docs.yahoo.com/homepageset/?p1=otherp2=aup3=tagline Start your day with Yahoo!7 and win a Sony Bravia TV. Enter now http://au.docs.yahoo.com/homepageset/?p1=otherp2=aup3=tagline ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: What are the limitations of Dot Syntax?
Namaste! I'm going to add my two cents here (despite being a noob). I like the dot syntax. Why? (and before I go any further, I realize this is not a Windows forum, and also realize this is a very general set of statements and quite open to debate) Because, in the Windows world at least, the dot allowed you to refer to *members* of an object. What are members? They are attributes of the object. In programming simplicity, they are: properties or methods. So, what's wrong with the dot syntax? Nada in my book. A fuller implementation of the dot syntax is more desireable in my book. From whence I came, it sure made code very much more readable and quicker to write. That being said, I don't have an issue with the way things are, nor do I really care much how they evolve, provided the evolution is for the better. The bottom line, as long as your code is readable, digestible, consistent, and clearly commented in tricky spots for those who come after you (and yourself later down the road too), it really doesn't matter, does it? Peace, Love, and Light, /s/ Jon C. Munson II Quoting Charles Srstka [EMAIL PROTECTED]: On Dec 5, 2008, at 10:06 PM, Bill Bumgarner wrote: Not really. 'name' is still something that is an accessor type thing, regardless of whether it is derived or declared via @property() dot abuse refers to expressions like: foo.retain; bar.lockFocusIfCanDraw; That is, expressions where you aren't really asking the object to retrieve some value, but are more or less telling the object to do something and return a result. And, yes, there are grey areas. So would something which is clearly not a property, but still returns an object, such as: myObj = mySet.anyObject; or: enumerator = myArray.objectEnumerator; be considered kosher? Charles ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: cocoa class diagram
That's one of the coolest interfaces I've seen yet (or maybe I haven't seen much). How'd he/she/they do that??? Thanks for sharing! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Kyle Sluder [EMAIL PROTECTED]: On Sat, Dec 6, 2008 at 12:42 PM, macdev [EMAIL PROTECTED] wrote: I was wondering whether there is a Cocoa class diagram poster to print. Check out CocoaNav: http://inexdo.com/CocoaNav --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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Various syntax errors and ICA kit
Namaste! OK, after much beating of head against wall, I found the issue. 'Twas the way the #import statements were set up. Once I moved the Cocoa Carbon imports to the header file that cleared up quite a bit of my issues. Also, I believe I had some of my own ignorance tossed in as well. Made one heck of a salad... Peace, Love, and Light, /s/ Jon C. Munson II Quoting [EMAIL PROTECTED]: Namaste! Also, if I take out the #import statement from the .m file, I get a compiler warning about a forward class. I don't know if that means anything truly important or not (but that was when i figured I forgot the #import part). If I can ignore that, then I may get my app to compile and run properly... Peace, Love, and Light, /s/ Jon C. Munson II Quoting [EMAIL PROTECTED]: Namaste! And so the fun ensues... I'm working with the (slightly, deprecated in 10.5) older ICA (as the newer doesn't work). I've brought over the code base from the SampleScanner application in the Carbon-ImageCapture-Examples folder and applied it to mine own form. Before I attempted to integrate it fully into my app (meaning, actually call it from the form that needs to call it), the nib controller files compiled just peachy (no errors, just deprecation warnings mostly). So, I added it to my calling window (instantiated the class, #imported the header, and so on) and created a method a button could trigger. Now, however, my application won't compile. It complains of syntax errors in the ICA form's header file: Syntax error before ICAObject Syntax error before ICARegisterEventNotificationPB Syntax error before ICAScannerStartPB Fatal error: method definition not in @implementation context If I take the header import out of the .m file for the calling window, and comment out the calls to the ICA window, the app compiles fine and executes ('course, I can't load the ICA window :( ). My ICA window is identical (with the exception of an icon image at this point) to the SampleScanner window. The .h .m controller files are also identical (except for log, which I removed as I don't need/want that part). Anyone got a clue on this? I almost have this hooked in...so close... Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Array Controller Add method question
You might try something like: int row = [a indexOfObjectIdenticalTo:p]; [tableView editColumn:0 row:row withEvent:nil select:YES]; a = your array controller/arrary p = object added This sample from Hillegass' book, Cocoa Programming for Mac OS X Third Edition. Good Luck! Peace, Love, and Light, /s/ Jon C. Munson II Quoting vince [EMAIL PROTECTED]: Thanks for the help ... I'm using an Array Controller's Add method wired to a button to enable text data entries into a table. How do I set the table to activate it's top row when pressing the Add button in preparation for input? At this point if the table contains many rows of data and the user clicks the Add button the table's lowest row activates. The user is forced to scroll down to the very bottom of the table prior to entry Thanks again. vince ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Array Controller Add method question
Yes, you do. Quoting vince [EMAIL PROTECTED]: Thanks. I'm using a Core Data model with Bindings. So there's no code in my class. I simply wired my Add object button to the the Array Controller's (Add) action to insert data into the table. Do I need to implement the Add method manually and customize there? thanks again. vince. On Sat, Dec 6, 2008 at 10:15 PM, [EMAIL PROTECTED] wrote: You might try something like: int row = [a indexOfObjectIdenticalTo:p]; [tableView editColumn:0 row:row withEvent:nil select:YES]; a = your array controller/arrary p = object added This sample from Hillegass' book, Cocoa Programming for Mac OS X Third Edition. Good Luck! Peace, Love, and Light, /s/ Jon C. Munson II Quoting vince [EMAIL PROTECTED]: Thanks for the help ... I'm using an Array Controller's Add method wired to a button to enable text data entries into a table. How do I set the table to activate it's top row when pressing the Add button in preparation for input? At this point if the table contains many rows of data and the user clicks the Add button the table's lowest row activates. The user is forced to scroll down to the very bottom of the table prior to entry Thanks again. vince ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/valbino48%40gmail.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: NSImageView gets stuck
Shot in the dark here... I noticed you are using ballFrame in your timer event, but not in your reset event. Is that your issue? Quoting Michael Rogers [EMAIL PROTECTED]: Hi, All: I have an NSImageView (in a variable called ball) that I am trying to move programatically across the screen, and when it hits a wall, reposition it in the center. I've set up an NSTimer, and in the timerFireMethod have this: NSRect ballFrame = [ball frame]; ballFrame.origin.x+=ballDeltaX; // move the ball ballFrame.origin.y+=ballDeltaY; works just fine, the ball merrily moves across the NSView. However, when I hit the wall, and do the following: [myController victoryGoesTo:'R']; [timer invalidate]; [self placeBallInCenter]; the placeBallInCenter method fails: -(void)placeBallInCenter{ [ball setFrameOrigin:NSMakePoint(125,125)]; NSLog(@ball frame: %@,NSStringFromRect([ball frame])); } The ball's origin displays correctly in the console as (125,125), but the ball is stuck on the right hand side of the screen, at around 400. I'm using the same technique in placeBallInCenter as I did in my timerFireMethod, so I am perplexed. Thanks for any enlightenment, Michael ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: New to Cocoa and Objective C, and I need some basic pointers
Start with HILLEGASS' book: Cocoa Programming for Mac OS X. EXCELLENT! Quoting [EMAIL PROTECTED]: ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: How does MainMenu.xib get loaded in a Cocoa application?
There's a setting (I can't relocate it) that declares a Main NIB, etc. 'Tis a property of one of the main files (like the project or target). Look around, you should be able to find it with a bit of effort. Quoting Debajit Adhikary [EMAIL PROTECTED]: I'm new to Cocoa and am trying to understand File Owner's and Nibs. When I create a simple Cocoa application and build and run it, a window -- specified in MainMenu.xib -- opens. How exactly does this window open? Is there any code for this anywhere? I wasn't able to find any. (I tried setting a breakpoint in main() but to no avail) ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
ICA stuff
Namaste! Is this the proper list to ask ICA-related questions? If so, I have a few...:) Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
ICAHandler
Namaste! OK, here's my first question: What is an ICAHandler? The compiler complains of it and I can't find it in the documentation anywhere. The ICA API Tester app lists it in the code it creates for ObjC Async. Any thoughts? Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: ICAHandler
Not sure. What I'm referring to in my post is this: [code] // - ICAGetDeviceListCallback void ICAGetDeviceListCallback (ICAHeader* pbHeader) { ICAHandler * obj = (ICAHandler*)pbHeader-refcon; if (obj) { [obj getDeviceListCallback: (ICAGetDeviceListPB*) pbHeader]; } } [/code] This is what ICA API Test spits out. Where did ICAHandler come from??? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Nick Zitzmann [EMAIL PROTECTED]: On Dec 5, 2008, at 1:55 PM, [EMAIL PROTECTED] wrote: Namaste! Namasté. What is an ICAHandler? The compiler complains of it and I can't find it in the documentation anywhere. The ICA API Tester app lists it in the code it creates for ObjC Async. Are you talking about this? http://developer.apple.com/samplecode/MyPhoto/listing2.html It looks like a class in some sample code; IOW, not a built-in class. Nick Zitzmann http://www.chronosnet.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 [EMAIL PROTECTED]
ICA Documentation issue
Namaste! After having read through the ICA API documentation looking at the sample apps, I've noticed: 1. The online dox appear to be ahead of anything else (although I'm not certain). 2. The sample apps employ deprecated calls and are written w/o conforming to the dox. 3. The ICA API Test app also does not quite match up to the written material. Anyone have a working, up-to-date sample for a simple scanner/camera interface he/she would care to share? Implementing code generated by the ICA API Test app is throwing errors that I'm not easily tracking down. Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] - End forwarded message - ___ 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 [EMAIL PROTECTED]
Re: ICA Documentation issue
Well, now, that's just plain...well, we won't go there... The deprecated stuff won't work under 10.5, will it? Quoting A.M. [EMAIL PROTECTED]: On Dec 5, 2008, at 3:59 PM, [EMAIL PROTECTED] wrote: Namaste! After having read through the ICA API documentation looking at the sample apps, I've noticed: 1. The online dox appear to be ahead of anything else. 2. The sample apps employ deprecated calls and are written w/o conforming to the dox. 3. The ICA API Test app also does not quite match up to the written material. Anyone have a working, up-to-date sample for a simple scanner/camera interface he/she would care to share? Implementing code generated by the ICA API Test app is throwing errors that I'm not easily tracking down. Thanks! ICA isn't part of Cocoa, so you won't get a good answer from this list, but I can indeed confirm from experience that: 1) the documentation is weak 2) newly-introduced functions in 10.5 (such as for downloading images to RAM) are completely broken 3) it is therefore best to continue to use the deprecated APIs If you will be relying on lots of ICA features, be prepared for many long nights. Cheers, M ___ 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 [EMAIL PROTECTED]
Re: New to Cocoa and Objective C, and I need some basic pointers
Again, Hillegass' book, Cocoa Programming for Mac OS X is excellent. I've a smattering of experience in a number of languages and found his book an excellent introduction to the whole bit. Quoting Benjamin Dobson [EMAIL PROTECTED]: The OP has sent me the original message body off-list. The rest of this message is what the original message was meant to say. ––– I've been programming almost exclusively in Java since 1998, and between 1985 through 1998 I was using C and C++. I just started learning Objective C, and found the language pretty easy to use. However, I need some pointers on the best way to become familiar with some of the Cocoa libraries and classes as well as the Foundation. In Java, they have what I think is a great API reference for all the normal classes. For those of you that have never seen it, just so you'll know what I'm talking about, here's a link: http://java.sun.com/javase/6/docs/api/ With this you look up the name of a class on the left column, click on it, and the detail regarding the class shows up on the main section of the page. I'm new to this with Cocoa, and I've been looking for something similar to that above. I have found, for example, the Foundation Reference Collection for Objective-C, the Application Kit Objective-C Reference Collection, and a host of other similar type pages in the developers documentation. Each such page displays what can be long lists of classes, and if you click on one of the Class References, up comes a page with more detailed information. The information looks pretty decent, but I end up using the back button on the browser to navigate. Is there a better, easier API layout? Additionally is there one that would include nearly all frameworks in one list? Also, I've noticed that some of the newer Objective C texts are using the dot notation. Is this going to be the norm in the future or was this something added to make Objective C easier to port from Java, C++, and even C in some cases? Last but not least, what are the best books available for learning Objective C and Cocoa? I've had little problems with Objective C (except adjusting to the notation) so I assume I would want to focus primarily on Cocoa, and I'm assuming any decent Cocoa book would probably delve into the Foundation as well, since I don't see how it couldn't (that's just my opinion). All opinions welcome, thanks ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Various syntax errors and ICA kit
Namaste! And so the fun ensues... I'm working with the (slightly, deprecated in 10.5) older ICA (as the newer doesn't work). I've brought over the code base from the SampleScanner application in the Carbon-ImageCapture-Examples folder and applied it to mine own form. Before I attempted to integrate it fully into my app (meaning, actually call it from the form that needs to call it), the nib controller files compiled just peachy (no errors, just deprecation warnings mostly). So, I added it to my calling window (instantiated the class, #imported the header, and so on) and created a method a button could trigger. Now, however, my application won't compile. It complains of syntax errors in the ICA form's header file: Syntax error before ICAObject Syntax error before ICARegisterEventNotificationPB Syntax error before ICAScannerStartPB Fatal error: method definition not in @implementation context If I take the header import out of the .m file for the calling window, and comment out the calls to the ICA window, the app compiles fine and executes ('course, I can't load the ICA window :( ). My ICA window is identical (with the exception of an icon image at this point) to the SampleScanner window. The .h .m controller files are also identical (except for log, which I removed as I don't need/want that part). Anyone got a clue on this? I almost have this hooked in...so close... Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: Various syntax errors and ICA kit
Namaste! Also, if I take out the #import statement from the .m file, I get a compiler warning about a forward class. I don't know if that means anything truly important or not (but that was when i figured I forgot the #import part). If I can ignore that, then I may get my app to compile and run properly... Peace, Love, and Light, /s/ Jon C. Munson II Quoting [EMAIL PROTECTED]: Namaste! And so the fun ensues... I'm working with the (slightly, deprecated in 10.5) older ICA (as the newer doesn't work). I've brought over the code base from the SampleScanner application in the Carbon-ImageCapture-Examples folder and applied it to mine own form. Before I attempted to integrate it fully into my app (meaning, actually call it from the form that needs to call it), the nib controller files compiled just peachy (no errors, just deprecation warnings mostly). So, I added it to my calling window (instantiated the class, #imported the header, and so on) and created a method a button could trigger. Now, however, my application won't compile. It complains of syntax errors in the ICA form's header file: Syntax error before ICAObject Syntax error before ICARegisterEventNotificationPB Syntax error before ICAScannerStartPB Fatal error: method definition not in @implementation context If I take the header import out of the .m file for the calling window, and comment out the calls to the ICA window, the app compiles fine and executes ('course, I can't load the ICA window :( ). My ICA window is identical (with the exception of an icon image at this point) to the SampleScanner window. The .h .m controller files are also identical (except for log, which I removed as I don't need/want that part). Anyone got a clue on this? I almost have this hooked in...so close... Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Determining unreleased objects after Quit
Namaste! I never did figure it out *exactly*. Over time, as I made corrections/edits (mostly in the NIB), the problem simply ceased to exist. I think it was mashed bindings...as some had gotten toasted for whatever reason. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Michael Ash [EMAIL PROTECTED]: On Wed, Dec 3, 2008 at 11:57 AM, Jon C. Munson II [EMAIL PROTECTED] wrote: Well, simply put, the application is still running. That is, after Quitting, the Stop button is enabled, and, if I try to run it again, I get a message to terminate the currently running version first... So the problem is not unreleased objects, it's that your app is still running. Hit the pause button in the debugger and figure out what it's doing. Mike ___ 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 [EMAIL PROTECTED]
Re: Programmatically loading an NSImage via other field
In response to all the responses... This monitoring needs to happen whether the user types in a field, or, there is a choice made via NSOpenPanel, or the record is scrolled (meaning moved next, moved previous). So, using the beginning of the KVO below (which is the route I suspected I'd have to go, but not sure exactly how), would I need to add other delegate methods to handle the other cases? Also, is dragging the delegate from the text field to the File's Owner the same as the awake from NIB call, or do I need to add the awakFromNIB as well? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ken Tozier [EMAIL PROTECTED]: Something like this should get you in the ballpark MyController : NSObject { IBOutlet NSTextField*imagePathField; IBOutlet NSImageView*imageView; } // register controller to receive messages from the text field - (void) awakeFromNib { [imagePathField setDelegate: self]; } // when user hits return key, the text field calls this handler allowing you to respond - (void) controlTextDidEndEditing:(NSNotification *) inNotification { // check message type if ([[inNotification name] isEqualToString: NSControlTextDidEndEditingNotification]) { // type OK, check which object sent message. (can be used to respond to multipe text fields) if ([inNotification object] == imagePathField) { // get text from field and try to load it into a new image NSImage *tempImage = [NSImage imageWithContentsOfFIe: [imagePathField stringValue]]; // set the image in the image view if (tempImage != nil) [imageView setImage: tempImage]; } } } On Dec 3, 2008, at 10:23 PM, [EMAIL PROTECTED] wrote: Namaste! OK, I'm beat for the day... I'm struggling with how to load an image into an NSImage via another field's value. I have a field that contains a path name of an image file. The user can type it in or select it via OpenFile sheet. This works just fine and I'm setting the underlying data object so the value persists. Now, my question: how do I get that value to propagate over to the image? In Windows, I can monitor via the onChange event for the textbox. Piece of cake. Here, though, I'm a bit perplexed. I thought perhaps the textDidChange delegate method might do it (I put that in my File's Owner, and made the File's Owner a delegate of the NSTextField that contains the image name). However, it doesn't fire e'en though the text clearly changes (onscreen). So, how do I accomplish this should-be-easy feat? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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/kentozier%40comcast.net This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Programmatically loading an NSImage via other field
In continuance... Alright, so it isn't strictly KVO...:) But it looks like it...:) Anyway, is there a way to know when the stuff in the cell changes? Most everything I can find is relative to when the user interacts with the control. But I can't find anything, as yet, for when the user doesn't, but the code does... For instance, when the window displays, there is a value in the text field for the path/image. Yet the image doesn't load. Is there an event/method that I can utilize to push the image? I only found windowDidLoad, which didn't do it. It also appears that I'll have to implement mine own MoveNext/MovePrevious methods in order to push the picture (although I still need to test that first). Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting [EMAIL PROTECTED]: In response to all the responses... This monitoring needs to happen whether the user types in a field, or, there is a choice made via NSOpenPanel, or the record is scrolled (meaning moved next, moved previous). So, using the beginning of the KVO below (which is the route I suspected I'd have to go, but not sure exactly how), would I need to add other delegate methods to handle the other cases? Also, is dragging the delegate from the text field to the File's Owner the same as the awake from NIB call, or do I need to add the awakFromNIB as well? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II Quoting Ken Tozier [EMAIL PROTECTED]: Something like this should get you in the ballpark MyController : NSObject { IBOutlet NSTextField*imagePathField; IBOutlet NSImageView*imageView; } // register controller to receive messages from the text field - (void) awakeFromNib { [imagePathField setDelegate: self]; } // when user hits return key, the text field calls this handler allowing you to respond - (void) controlTextDidEndEditing:(NSNotification *) inNotification { // check message type if ([[inNotification name] isEqualToString: NSControlTextDidEndEditingNotification]) { // type OK, check which object sent message. (can be used to respond to multipe text fields) if ([inNotification object] == imagePathField) { // get text from field and try to load it into a new image NSImage *tempImage = [NSImage imageWithContentsOfFIe: [imagePathField stringValue]]; // set the image in the image view if (tempImage != nil) [imageView setImage: tempImage]; } } } On Dec 3, 2008, at 10:23 PM, [EMAIL PROTECTED] wrote: Namaste! OK, I'm beat for the day... I'm struggling with how to load an image into an NSImage via another field's value. I have a field that contains a path name of an image file. The user can type it in or select it via OpenFile sheet. This works just fine and I'm setting the underlying data object so the value persists. Now, my question: how do I get that value to propagate over to the image? In Windows, I can monitor via the onChange event for the textbox. Piece of cake. Here, though, I'm a bit perplexed. I thought perhaps the textDidChange delegate method might do it (I put that in my File's Owner, and made the File's Owner a delegate of the NSTextField that contains the image name). However, it doesn't fire e'en though the text clearly changes (onscreen). So, how do I accomplish this should-be-easy feat? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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/kentozier%40comcast.net This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list
Re: Programmatically loading an NSImage via other field
Namaste! OK, I've been playing around with this for too long now... NOTHING gets called when text in a control is set via code or a mechanism other than strict keyboard/mouse entry by the user from what I can determine. This, in a word, is not good. I've set up an observer, delegates, and all that, per previous posts and only when keys are actually pressed do the delegate methods get called. Also, I've noticed that when the record is moved (either next or previous), there is a buffer time between when code executes and the interface gets changed. Thus: - (IBAction)movePrevious:(id)sender { [tblPattern selectPrevious:self]; [btnPrevious setEnabled:[tblPattern canSelectPrevious]]; [self pushPicture]; } Doesn't work. The Apple dox state the reason the move action is moved to another process is to give the error mechanism a way to respond. As a consequence, nothing changes and the code executes, then the stuff changes. What happens is the previous image gets loaded as the current image, despite what the textfield says. Not good. For a simple OnChange thing, this is absolutely frustrating (and has resulted in quite a bit of code). Bottom line is, it looks like I need some way to see changes that were made to either the underlying Cell (thinking along the lines of display changes) or some other route to take this. I have three scenarios under which the image needs to get pushed: 1. When selected from a file. 2. On Window display - first record is displayed. 3. When records are scrolled (Move Next/Move Previous). I've solved #1, though I don't like having to manually push the image (meaning I call the pushPicture routine). 2 3 are still unsolved at this point. Any further thoughts??? Anyone else only keep paths to images and dynamically load from that data? Storing the pictures in the data structure is not going to happen as they'll take up far too much space and suck resources. Thanks for all the help so far! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: Help Menu Please
'twould help to have a little more info on what you are doing, done, etc., in order to shed light on your situation... For instance: are you creating a menu item called Help, or are you sticking with the out-of-the-box menu item? Peace, Love, and Light, /s/ Jon C. Munson II Quoting David Blanton [EMAIL PROTECTED]: On Tiger I get one Help Menu On Leopard I get two Help Menus Has anyone seen this before? Is there some brain dead thing I am missing? Am I brain dead? My boss thinks I am because of this problem. arrghh! On Dec 4, 2008, at 12:39 AM, David Blanton wrote: I have been required to develop and build with Xcode 2.41 on 10.4.11. In testing on 10.5.5 I get two help menus. Is there something I need to do for Help on 10.5.x ? David Blanton ___ 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/airedale%40tularosa.net This email sent to [EMAIL PROTECTED] David Blanton ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Help Menu Please
Hmmm... Maybe this will help? http://vgable.com/blog/2008/10/29/two-help-menus/ Peace, Love, and Light, /s/ Jon C. Munson II Quoting David Blanton [EMAIL PROTECTED]: I searched the list archives to no avail. I do not believe that I am the only one to see this problem ... the code is vanilla IB menu stuff On Dec 4, 2008, at 10:53 AM, David Blanton wrote: No. I searched Apple Developer. Duh. Will do so now. ___ 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 [EMAIL PROTECTED]
Re: Programmatically loading an NSImage via other field
Great! Thanks! I'll take a look at at it. I'm still a Windows guy. Actually, I'm becoming dual-platform. Now that's a scary thought (but quite marketable if need be). But you are probably not in the Maryland area, are ya? Appreciate the help, I'll grab that zip now. Peace, Love, and Light, /s/ Jon C. Munson II Quoting Matt Long [EMAIL PROTECTED]: Jon, I'm not sure I understand the whole problem here, but from your initial message I put together a simple demo project that will take the input value from a text field and use that as the path for an NSImageView. It does it on the fly (e.g. as you type). Here is the demo project: http://www.cimgf.com/files/AutoImageLoad.zip On first run, use the Browse... button to locate an image and select it. The image will display. Then start to backspace from the end of the path in the text field and you'll see the image you selected disappears. Then type back in what you backspaced out and you'll see it reappear. This is all done with the magic of bindings. The text field value and the image view's value path are both bound to the same string. When the string gets updated, so do both of those fields. You'll see the string that is being used for this is a @property of my AppDelegate class. Let me know if you have further questions. I'm a former Windows guy myself and can probably help you unlearn what you know as I also had to do. ;-) Best Regards, -Matt On Dec 4, 2008, at 10:03 AM, [EMAIL PROTECTED] wrote: Namaste! OK, I've been playing around with this for too long now... NOTHING gets called when text in a control is set via code or a mechanism other than strict keyboard/mouse entry by the user from what I can determine. This, in a word, is not good. I've set up an observer, delegates, and all that, per previous posts and only when keys are actually pressed do the delegate methods get called. Also, I've noticed that when the record is moved (either next or previous), there is a buffer time between when code executes and the interface gets changed. Thus: - (IBAction)movePrevious:(id)sender { [tblPattern selectPrevious:self]; [btnPrevious setEnabled:[tblPattern canSelectPrevious]]; [self pushPicture]; } Doesn't work. The Apple dox state the reason the move action is moved to another process is to give the error mechanism a way to respond. As a consequence, nothing changes and the code executes, then the stuff changes. What happens is the previous image gets loaded as the current image, despite what the textfield says. Not good. For a simple OnChange thing, this is absolutely frustrating (and has resulted in quite a bit of code). Bottom line is, it looks like I need some way to see changes that were made to either the underlying Cell (thinking along the lines of display changes) or some other route to take this. I have three scenarios under which the image needs to get pushed: 1. When selected from a file. 2. On Window display - first record is displayed. 3. When records are scrolled (Move Next/Move Previous). I've solved #1, though I don't like having to manually push the image (meaning I call the pushPicture routine). 2 3 are still unsolved at this point. Any further thoughts??? Anyone else only keep paths to images and dynamically load from that data? Storing the pictures in the data structure is not going to happen as they'll take up far too much space and suck resources. Thanks for all the help so far! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: Programmatically loading an NSImage via other field
Namaste! Back so soon... :) OK, I took a look a what you have and have some questions. And, well, h... I'M A DOPE!! :D No questions! The reason for that is I was under the extremely mistaken impression that I couldn't load the ImageView from a simple path via a binding. I took a look at how you had your ImageView bound and voila! The answer was staring me straight in the face! ROFL!!! Can I say OMFG? Geez... But I did learn some things along the way so it wasn't a total loss... I now return you back to your regularly scheduled program... THANKS!!! Peace, Love, and Light, /s/ Jon C. Munson II p.s. Isn't it always something simple??? Quoting Matt Long [EMAIL PROTECTED]: Jon, I'm not sure I understand the whole problem here, but from your initial message I put together a simple demo project that will take the input value from a text field and use that as the path for an NSImageView. It does it on the fly (e.g. as you type). Here is the demo project: http://www.cimgf.com/files/AutoImageLoad.zip On first run, use the Browse... button to locate an image and select it. The image will display. Then start to backspace from the end of the path in the text field and you'll see the image you selected disappears. Then type back in what you backspaced out and you'll see it reappear. This is all done with the magic of bindings. The text field value and the image view's value path are both bound to the same string. When the string gets updated, so do both of those fields. You'll see the string that is being used for this is a @property of my AppDelegate class. Let me know if you have further questions. I'm a former Windows guy myself and can probably help you unlearn what you know as I also had to do. ;-) Best Regards, -Matt On Dec 4, 2008, at 10:03 AM, [EMAIL PROTECTED] wrote: Namaste! OK, I've been playing around with this for too long now... NOTHING gets called when text in a control is set via code or a mechanism other than strict keyboard/mouse entry by the user from what I can determine. This, in a word, is not good. I've set up an observer, delegates, and all that, per previous posts and only when keys are actually pressed do the delegate methods get called. Also, I've noticed that when the record is moved (either next or previous), there is a buffer time between when code executes and the interface gets changed. Thus: - (IBAction)movePrevious:(id)sender { [tblPattern selectPrevious:self]; [btnPrevious setEnabled:[tblPattern canSelectPrevious]]; [self pushPicture]; } Doesn't work. The Apple dox state the reason the move action is moved to another process is to give the error mechanism a way to respond. As a consequence, nothing changes and the code executes, then the stuff changes. What happens is the previous image gets loaded as the current image, despite what the textfield says. Not good. For a simple OnChange thing, this is absolutely frustrating (and has resulted in quite a bit of code). Bottom line is, it looks like I need some way to see changes that were made to either the underlying Cell (thinking along the lines of display changes) or some other route to take this. I have three scenarios under which the image needs to get pushed: 1. When selected from a file. 2. On Window display - first record is displayed. 3. When records are scrolled (Move Next/Move Previous). I've solved #1, though I don't like having to manually push the image (meaning I call the pushPicture routine). 2 3 are still unsolved at this point. Any further thoughts??? Anyone else only keep paths to images and dynamically load from that data? Storing the pictures in the data structure is not going to happen as they'll take up far too much space and suck resources. Thanks for all the help so far! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Trouble with array controller - array
Namaste! OK, I'm confounded... I've got an outlet (tblUser) that's an NSArrayController. It is pointing at an Array Controller in my NIB called tblUser. That is point at an Entity called tblUser. The MOC is set up correctly. In my code, I've assigned an (NSArray *) aUser to [tblUser arrangedObjects]. I then proceed to get a count of objects from the array ([aUser count]). For some reason, I get a value of zero. Yet, in another screen, same app, same instance, the count is correct at 1. Same bits of code, only the names are a little different, but the syntax is the same. Anyone care to posit theories as to why this might be happening? Did I miss an intermediate step somewhere? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]
Re: Trouble with array controller - array
Ne'er mind, it somehow fixed itself... And I didn't change the code... Weird... Quoting [EMAIL PROTECTED]: Namaste! OK, I'm confounded... I've got an outlet (tblUser) that's an NSArrayController. It is pointing at an Array Controller in my NIB called tblUser. That is point at an Entity called tblUser. The MOC is set up correctly. In my code, I've assigned an (NSArray *) aUser to [tblUser arrangedObjects]. I then proceed to get a count of objects from the array ([aUser count]). For some reason, I get a value of zero. Yet, in another screen, same app, same instance, the count is correct at 1. Same bits of code, only the names are a little different, but the syntax is the same. Anyone care to posit theories as to why this might be happening? Did I miss an intermediate step somewhere? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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/jmunson%40his.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Programmatically loading an NSImage via other field
Namaste! OK, I'm beat for the day... I'm struggling with how to load an image into an NSImage via another field's value. I have a field that contains a path name of an image file. The user can type it in or select it via OpenFile sheet. This works just fine and I'm setting the underlying data object so the value persists. Now, my question: how do I get that value to propagate over to the image? In Windows, I can monitor via the onChange event for the textbox. Piece of cake. Here, though, I'm a bit perplexed. I thought perhaps the textDidChange delegate method might do it (I put that in my File's Owner, and made the File's Owner a delegate of the NSTextField that contains the image name). However, it doesn't fire e'en though the text clearly changes (onscreen). So, how do I accomplish this should-be-easy feat? Thanks! Peace, Love, and Light, /s/ Jon C. Munson II ___ 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 [EMAIL PROTECTED]