Re: Moving oneself to /Applications (or ~/Applications)
I am not that experienced as a Mac Developer but I can give my thoughts as a switcher. When I first switched over to OS X a few years ago I thought it was odd that an application did not *need* to be installed rather copied to the Applications folder. It was obvious to me that I needed to put it in the Applications folder even though I was new because the first app I installed (I don't recall what it was) had a nice window that popped up and had the app icon along with the applications folder. It had a nice arrow that said drag. Once I did that I checked the Applications folder which I found in the Finder window and there it was. I loved the way it just copied over and there was no need for an installer (i found some apps that do require it, shame on them) I have never had the problem of opening the app from the DMG and then not being able to find it so I cannot speak from that. I however do like the idea of the app asking you where to install however that could also be a bad idea as Ben stated you are not *required* to install it to any particular location and some may have their applications organized by directories. I particularly do not but it is a good idea now that Ben brings it up so I might in the near future. I would lean towards not copying the file, rather showing the window like a lot of apps do that have the app icon draggable to the app folder. and some nice graphics making it clear that they need to drag drop. Joseph Crawford ___ 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
NSBezierPath (Modifying Paths)
Hello Everyone, I am working on something small just to learn with and I have been trying to figure this out for a while. The end result that I am looking for is this Draw A straight line click the line and drag to make that line curve Now I have been able to get all of this to work aside from one thing. If you draw a curve then go to draw another the first one is not remembered. Code: http://paste.lisp.org/display/74870 I know it is my call to removeAllPaths on line 59 of the code pasted at the URL above. I know that i need to use the elementsAtIndex: and elementsAtIndex:index associatedPoints:points to modify the points rather than remove them all However what I do not know is where I would get this Index to use. Any assistance would be appreciated. Thanks, Joseph Crawford ___ 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: NSBezierPath (Modifying Paths)
Quincey, You make some very good points. Let me first start out by saying I was doing ALL the path work in drawRect: based on someone telling me that was the best practice, I then had a few people including you tell me that is not the case. I am not worried about performance right now that is true. I am also not worried about you drawing a curve and then wanting to draw a straight line. This is all just messing around trying to replicate the capabilities of the curve tool in many drawing applications, I already saw how to replicate the drawing of a line and that would be a different tool to choose from. What would you suggest I look into for wanting to modify the points? I had this working perfectly with a tempPath for the dragging and actually had it grey in color and when it was drawn it was done so in black (the visual queue) but was told that I could do it with only one path which is why I was looking into modifying the path elements. When I have one point the dragging operation always added more and more points which led to the line being drawn with every drag and that was not the wanted solution. Thanks, Joseph Crawford On Feb 4, 2009, at 12:59 PM, Quincey Morris wrote: On Feb 4, 2009, at 07:35, Joseph Crawford wrote: Draw A straight line click the line and drag to make that line curve Now I have been able to get all of this to work aside from one thing. If you draw a curve then go to draw another the first one is not remembered. Code: http://paste.lisp.org/display/74870 I know it is my call to removeAllPaths on line 59 of the code pasted at the URL above. I know that i need to use the elementsAtIndex: and elementsAtIndex:index associatedPoints:points to modify the points rather than remove them all However what I do not know is where I would get this Index to use. Your general approach doesn't make a lot of sense to me. 'drawRect' is for drawing, and it's a really bad idea to be constructing parts of your data model in that method. (In particular, drawRect can get called multiple times without the mouse being dragged, and each time it's going to add more points to the existing path. Not to mention the fact that it'll add these points to *all* the paths, not just the latest one.) I'd suggest: -- Keep your path array just for paths that are fully created. That is, in mouseUp but not before, add the current path to the path array. -- Don't bother trying to *change* the NSBezierPath object that's in the process of being created, just create a brand new one each time you go through mouseDragged. Performance would be the only reason not to do this, but you're not going to have a performance problem anytime soon. If you plan to be able to edit the paths later, then NSBezierPath isn't the best choice as a data structure. -- Do nothing in drawRect except drawing. If you keep the in progress path out of the path array till it's done, you can also draw it in (say) a different color, which would be a nice visual cue. -- Change 'numberOfClicks' to something like 'numberOfControlPointsDrawn' (with values 0, 1 and 2) for clarity. The number of clicks isn't actually important, but the number of control points dragged out is. While this approach to drawing paths isn't terrible, it *is* terribly modal. If I was to draw a straight line and then wanted to draw another path without making the first one a curve, how would do I do that? If I started dragging out a path and wanted to get rid of it and start a new one, how would I do that? ___ 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/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Newbie Object Sharing Question
Sorry I misunderstood the question then :) Just a newbie trying to lend a hand where I can. Thanks for correcting me. Joseph Crawford On Jan 30, 2009, at 9:47 PM, Ken Thomases wrote: On Jan 30, 2009, at 1:51 PM, Joseph Crawford wrote: Why don't you create a base controller that those 2 controllers subclass, that way they would inherit the functionality of reading those properties, also they would inherit the methods for getting, setting, etc. BaseController -- Controller 1 -- Controller 2 in Base controller define those properties and any methods for interacting with them in Controller 1 and Controller 2 have your Class specific stuff there, because they both inherit from BaseController you would get those properties. This is completely irrelevant to the original question. Having a common base class does not make two objects share state. On Jan 30, 2009, at 2:46 PM, Brian Slick wrote: I want both view controllers to reference MyListItemArray. You want both view controllers to reference _an instance_ of MyListItemArray. MyListItemArray is a class. So in each one I do something like: MyListItemArray *listArray = [[MyListItemArray alloc] init]; As you seem to have figured out, this is creating (allocating and initializing) a new instance of the class. This newly-created object is separate and distinct from other objects in your program, even ones created by execution of this same line of code at other times. [...] It starts to sink in that what I have done is create a *local* instance of MyListItemArray in each view controller, and what's local to ViewControllerTabA has nothing to do with what is local to ViewControllerTabB. I'm getting local copies of the array, not the source array. As near as I can tell, there is no source array, nor is there any copying going on. You have explicitly created two separate arrays from the get-go. You have then filled them out separately to have similar initial contents. It starts to occur to me that I don't actually want an instance, I want the real deal. That statement is nonsensical. There is no real deal. An instance is real. It's not some pale reflection of something else. You do want an instance. I suspect that perhaps you don't understand the difference between an object and a pointer to an object. The reason I suspect that is because the simple solution to your dilemma, the thing you're not seeing, is that you want a single instance referenced from multiple places using multiple pointers. I read through some documentation about model objects and objects in general, and stumbled upon the concept of Singletons. Some additional searching lead me to this blog post: http://cocoawithlove.com/2008/11/singletons-appdelegates-and-top-level.html ...which seems to describe exactly what I want. I reconfigured MyListItemArray as a singleton, and remapped my data source methods accordingly, and everything seemingly works perfectly. Items added in one view are displayed in the other, and so on. It works so well that I have to assume there is a catch. I can't shake the feeling that this seems more difficult than in ought to be, and generally when I feel that way there tends to be a single line of code solution that I haven't found yet. Are singletons really the only way (that doesn't involve saving to a file, I suppose) to share a model object across multiple view controllers? I think I'm missing something really fundamental. Yes, I think your are missing something fundamental -- the ability to share references to an object simply by assigning multiple pointers to point to the same thing. A singleton implementation is _one_ solution to the issue you're having, but it's not necessary, and not even recommended for something as simple as this. One stumbling block is that you have two view controllers, but evidently no central application controller. View controllers should have logic and state specific to a view and that view's relationship to the model. An application controller manages your application overall. It manages the other controllers, including your view controllers. It has the primary responsibility for managing the application-global (as opposed to, for example, document-specific) model, and for providing access to that model to other parts of the program. Since you were concentrating on the view controllers, you thought you had to create the instance of MyListItemArray in each view controller. It follows that you got one such instance for each view controller. You should have a single application controller object (an instance of some custom class). This application controller is often also the application delegate. It is also often instantiated in the main nib, where the delegate outlet of the main application object is connected to it. If your application has one central list
Multiple Nib Question
Hello Everyone, I had my project all working smooth using 1 nib file which contained my MainMenu and my window. I have since separated them because a lot of people suggested it. However this separation has led me to hit an issue. In my ManManu nib I have my App Delegate which then loads my window by instantiating the instance of my WindowController which displays the window. The issue is this. The application will copy sample files over to my application support directory (AppController) and also the SidebarController needs to be able to read this directory. I have the following method in my AppController - (NSString *)appSupportFolder { NSArray *paths = NSSearchPathForDirectoriesInDomains(NSApplicationSupportDirectory, NSUserDomainMask, YES); NSString *basePath = ([paths count] 0) ? [paths objectAtIndex: 0] : NSTemporaryDirectory(); return [basePath stringByAppendingPathComponent:@TomTom POI Manager]; } As you can see this just determines the path to the users Application Support folder and returns that path. My issue is that this method is in the AppController class which is in my MainMenu nib. In my MainWindow nib I have a method that is trying to call the above method through an outlet to AppController, however since AppController is in another nib I cannot make the connection. What would be the best way to solve this issue? My thoughts are this. 1.) duplicate code across multiple nibs (not a good idea) 2.) create a class method (not sure this is the best answer either) 3.) in AppDelegate when the [[MainWindowController alloc] init] method is called, call initWithAppSupportPath:path so that the window controller gains knowledge of the path Are any of the above a good method to use, do you have any alternative suggestions? I am familiar with encapsulation in classes but this while multiple nib process is new for me. If you can suggest any reading I would be more than willing to read for the answer as well Thanks, Joseph Crawford ___ 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: IBOutlet objects not responding to any messages passed
Did you make the connections in IB? You need to do that on top of adding the outlets in code. Joseph Crawford On Jan 22, 2009, at 5:44 AM, Cormac Daly wrote: Hi list, I've added a new window to my application and have written a window controller class. Everything is going fine, except for the fact that when initialising the window, none of my IBOutlets are responding to methods called on them. This is the case in both the init and windowDidLoad methods - NSButtons are not responding to setEnabled methods, NSTextFields are not responding to setStringValue methods, etc. All relevant UI elements are visible but are not responding. No warnings and nothing appearing in the console. After the window has been initialised and loaded and after I begin to interact with it (IBAction methods work fine) then my outlets respond just fine. Very strange. Here is how I'm creating the object: m_LicensingWindow = [[[LicensingWindowController alloc] init] retain]; Part of the Declaration. I've snipped out many irrelevant parts of the code for the sake of readability: #import Cocoa/Cocoa.h @interface LicensingWindowController : NSWindowController { IBOutlet NSWindow * m_MainWindow; IBOutlet NSWindow * m_licensingPanel; IBOutlet NSButton * m_EditLicenseButton; IBOutlet NSTextField * m_EmailConfirmTextbox; IBOutlet NSTextField * m_EmailTextbox; IBOutlet NSButton * m_GetNewLicenseButton; IBOutlet NSTextField * m_HardwareKeyText; IBOutlet NSButton * m_HideProductsCheckbox; IBOutlet NSTextField * m_LicenseInfoLabel; // snip } - (IBAction)showLicensingWindow:(id)sender; - (bool)populateProductsPopupList; - (IBAction)changeEmailAddressAction:(id)sender; - (IBAction)changeEmailConfirmAddressAction:(id)sender; // snip @end And part of the definition: #import LicensingWindowController.h #include CoreFoundation/CoreFoundation.h // snip @implementation LicensingWindowController - (void) init { if ((self = [super initWithWindowNibName: @LicensingWindow]) != nil) { // IBOutlets not responding here } } - (void) windowDidLoad { // not responding here [m_GetNewLicenseButton setEnabled: NO]; [m_HardwareKeyText setStringValue: @Test]]; } - (IBAction)showLicensingWindow:(id)sender { [super showWindow:self]; } - (IBAction)clickGetNewLicenseAction:(id)sender { // responding fine here! } // snip @end Any ideas? Is there a problem in the ordering somewhere? Its probably something very basic but I'm stumped! Many thanks, Cormac ___ 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/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Interaction with web javascript cocoa
what i did is created the outlet to my webview, made the webview load an html file that contains all my JS functions and then call it like so. NSString *command = [[NSString alloc] initWithFormat:@addMarkerAtPoint(%f, %f, 13, \%...@\);, [location latitude], [location longitude], [location name]]; [mapOutlet sendMapCommand:command]; Now that sendMapCommand is a method I put in my mapController, here it is -(void)sendMapCommand:(NSString *)cmd { id map = [mapView windowScriptObject]; [map evaluateWebScript:cmd]; } The ONLY downfall to this is that you can only make 1 function call per command sent. I tried to do seperate calls and it would not work. Combining the calls into functions and making 1 function call has worked for me. Thanks, Joseph Crawford On Jan 20, 2009, at 5:27 PM, Markus Spoettl wrote: On Jan 20, 2009, at 11:06 PM, Alex Mills wrote: I have built a Javascript WYSIWYG editor. I want to build a WebKit based cocoa app with buttons that can call a function from the editor loaded in webkit. For example I want to have a button within the Cocoa interface that calls the Javascript function 'makeBold()' to make the selected text within the editor bold. If this is possible I then want to save the editor generated html to string so that I can store it within Core Data. I checked out the Apple Webkit programming guide but it doesn't provide much. Have a look at Using JavaScript From Objective-C in the WebKit Objective-C Programming Guide: http://developer.apple.com/documentation/Cocoa/Conceptual/DisplayWebContent/Tasks/JavaScriptFromObjC.html#//apple_ref/doc/uid/30001214 What it explains is how you can evaluate any JavaScript code from your app (which means calling functions too), you can also have JavaScript functions call back into your own Objective-C code. Regards Markus -- __ Markus Spoettl ___ 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/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Security With Show Package Contents?
AFAIK that would be impossible because someone would just find away around the protection. There has to be a way to unprotect the app otherwise the file system would not be able to access the binary file. If the file system has a way to access it, someone will figure that out and then they will be able to access it. Trying to make an app un-crackable is not worth the time or effort, if it was feasible they would be doing it with OS's like OS X and Windows and even the big guys like Adobe. Joseph Crawford On Jan 12, 2009, at 10:18 AM, Chunk 1978 wrote: so i was a little put off after purchasing iWork '09, because i could no longer access Show Package Contents of my pages files. i generally used this to swap out images of the same size, or to color balance, etc. anyway, i started thinking about security of applications based on showing package contents. as far as i know the only way for someone to crack an application is to have access to the package contents which lists the Unix Executable File in the Mac OS folder. i guess there's also the possibility to swap out frameworks (particularly Aquatic Prime framework if the framework is installed instead of the Aquatic Prime library)... since apps are really just folders with a .app extension, wouldn't it be possible to disable Show Package Contents, as with the new .pages files, so that it would make the app more secure (if not impossible to crack)? couldn't Apple implement some sort of password protection or optional block on viewing package contents with XCode so that apps are impossible to crack? this post is totally just me thinking out loud. i personally believe that if someone is going to download a cracked version of an app then either they wouldn't have bought a license anyway, or they don't have the money... i'm not trying to make an app of mine more secure. but i'd like to hear your thoughts about 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/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
@loader_path and @executable_path
I do not know if this is a cocoa question or not, it is an error I get when I hit build go This GDB was configured as i386-apple-darwin.tty /dev/ttys001 warning: Unable to read symbols for @loader_path/../Frameworks/ BWToolkitFramework.framework/Versions/A/BWToolkitFramework (file not found). warning: Unable to read symbols from BWToolkitFramework (not yet mapped into memory). warning: Unable to read symbols for @loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle (file not found). warning: Unable to read symbols from Sparkle (not yet mapped into memory). I did some googling and found that people used a tool to use @executable_path rather than @loader_path but I also read that those values should be the exact same so changing them is not the optimal change to make. Does anyone have any idea where I can see / set these values? I have checked my Xcode Project Build settings, the framework build settings, etc. and cannot find them. I also thought it was a project setting so i created the project again from scratch (it's small) but I still got the error, this led me to believe that it is an XCode setting so I reinstalled dev tools and the error still remains. I did some checking in my build and my Frameworks are under Contents/ Frameworks/* In my project directory I created a directory called /Frameworks/* and put the frameworks there. I am not sure if this is the best way to use a framework by including it in my Bundle but I am not sure how else to do this. I guess I could just put all external (non osx frameworks) in a directory on my computer and link them. I have to mention that these errors do not seem to stop the frameworks from working when i run the build. Sparkle still does the updates etc, just a bit odd to have the errors at all. Any suggestions / feedback would be appreciated. Thanks, Joseph Crawford ___ 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: @loader_path and @executable_path
Please see the message below in black. I figured out that issuing this command in terminal fixed the issue for this project. install_name_tool -change @loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle @executable_path/../ Frameworks/Sparkle.framework/Versions/A/Sparkle /Users/jcrawford/ Cocoa/TomTom POI Manager/build/Debug/TomTom POI Manager.app/Contents/ MacOS/TomTom POI Manager However my question is since this was only for this one particular project, any other project will encounter these errors. Is there a way to make this system wide so that if my build directory is cleared or another project is created this problem will not be encountered? Thanks, Joseph Crawford On Jan 12, 2009, at 11:47 AM, Joseph Crawford wrote: I do not know if this is a cocoa question or not, it is an error I get when I hit build go This GDB was configured as i386-apple-darwin.tty /dev/ttys001 warning: Unable to read symbols for @loader_path/../Frameworks/ BWToolkitFramework.framework/Versions/A/BWToolkitFramework (file not found). warning: Unable to read symbols from BWToolkitFramework (not yet mapped into memory). warning: Unable to read symbols for @loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle (file not found). warning: Unable to read symbols from Sparkle (not yet mapped into memory). I did some googling and found that people used a tool to use @executable_path rather than @loader_path but I also read that those values should be the exact same so changing them is not the optimal change to make. Does anyone have any idea where I can see / set these values? I have checked my Xcode Project Build settings, the framework build settings, etc. and cannot find them. I also thought it was a project setting so i created the project again from scratch (it's small) but I still got the error, this led me to believe that it is an XCode setting so I reinstalled dev tools and the error still remains. I did some checking in my build and my Frameworks are under Contents/Frameworks/* In my project directory I created a directory called /Frameworks/* and put the frameworks there. I am not sure if this is the best way to use a framework by including it in my Bundle but I am not sure how else to do this. I guess I could just put all external (non osx frameworks) in a directory on my computer and link them. I have to mention that these errors do not seem to stop the frameworks from working when i run the build. Sparkle still does the updates etc, just a bit odd to have the errors at all. Any suggestions / feedback would be appreciated. Thanks, Joseph Crawford ___ 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: @loader_path and @executable_path
Brandon, I can tell you what needs to be changed but it is not the suggested route. Everyone is saying that using @loader_path is the way to go over @executable_path, however that said You change it in your target build settings for your framework. Stated by the author of Sparkle Oh, yeah, I've seen people need @executable_path. You would change that in Install Path in the Sparkle target of Sparkle.xcodeproj. But as I said people have suggested against that. Dave Dribin - In general, @loader_path is preferred over @executable_path, as it allows embedded frameworks to work in both an executable and a bundle, plugin, or sub-framework. The only downside is that @loader_path requires 10.4 or newer. If you're on 10.5 or newer, @rpath is even better than @loader_path. Joseph Crawford On Jan 12, 2009, at 5:58 PM, Brandon Walkin wrote: On 12-Jan-09, at 5:00 PM, Dave Dribin wrote: On Jan 12, 2009, at 10:47 AM, Joseph Crawford wrote: I do not know if this is a cocoa question or not, it is an error I get when I hit build go This GDB was configured as i386-apple-darwin.tty /dev/ttys001 warning: Unable to read symbols for @loader_path/../Frameworks/ BWToolkitFramework.framework/Versions/A/BWToolkitFramework (file not found). warning: Unable to read symbols from BWToolkitFramework (not yet mapped into memory). warning: Unable to read symbols for @loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle (file not found). warning: Unable to read symbols from Sparkle (not yet mapped into memory). These are just debugger errors. This is most like due to those frameworks being compiled in Release mode with their debug symbols stripped. It should not affect debugging of your own application. I did some googling and found that people used a tool to use @executable_path rather than @loader_path but I also read that those values should be the exact same so changing them is not the optimal change to make. For an application, they resolve to the same thing. Does anyone have any idea where I can see / set these values? I have checked my Xcode Project Build settings, the framework build settings, etc. and cannot find them. They are set in the frameworks project, not yours. So if you're linking to pre-built versions of Sparkle and BWToolkit, there are no settings in your app that affect this. In general, @loader_path is preferred over @executable_path, as it allows embedded frameworks to work in both an executable and a bundle, plugin, or sub-framework. The only downside is that @loader_path requires 10.4 or newer. If you're on 10.5 or newer, @rpath is even better than @loader_path. -Dave I'm the developer of BWToolkit. Some users have run into this problem where the framework would work fine for them for a while, and then one day it would output the warnings that Joseph mentioned. My Xcode/gcc knowledge is a bit lacking, so I haven't been able to figure this one out. Do you know what changes have to be made in the BWToolkit Xcode project to fix this issue? Thanks, Brandon ___ 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/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: @loader_path and @executable_path
yes they are there in /Contents/Frameworks/ I did not need to copy them in nor would xcode allow me to because they are stored in PROJECT_DIR/Frameworks/ Joseph Crawford On Jan 12, 2009, at 6:32 PM, Chris Hanson wrote: On Jan 12, 2009, at 8:47 AM, Joseph Crawford wrote: I do not know if this is a cocoa question or not, it is an error I get when I hit build go This GDB was configured as i386-apple-darwin.tty /dev/ttys001 warning: Unable to read symbols for @loader_path/../Frameworks/ BWToolkitFramework.framework/Versions/A/BWToolkitFramework (file not found). warning: Unable to read symbols from BWToolkitFramework (not yet mapped into memory). warning: Unable to read symbols for @loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle (file not found). warning: Unable to read symbols from Sparkle (not yet mapped into memory). Are BWToolkitFramework.framework and Sparkle.framework actually copied into your application bundle? It looks like they aren't. Did you click Copy only when installing in the Copy Files build phase for them? -- Chris ___ 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: @loader_path and @executable_path
these are not contradictory. I have the frameworks in my project folder PROJECT_NAME/Frameworks/ However in my Project.app/ they are in /Contents/Frameworks/ Joseph Crawford On Jan 12, 2009, at 6:49 PM, Chris Hanson wrote: On Jan 12, 2009, at 3:36 PM, Joseph Crawford wrote: yes they are there in /Contents/Frameworks/ I did not need to copy them in nor would xcode allow me to because they are stored in PROJECT_DIR/Frameworks/ These statements are contradictory. Are the frameworks in Contents/Frameworks within the built application bundle you're trying to debug? Or are they only in a Frameworks directory within your source code directory hierarchy? Xcode won't go looking through your source code directory hierarchy for frameworks to debug/run against, it will only look in your build results directory and in the places specified in the application iteslf (such as its Contents/Frameworks directory). -- Chris ___ 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: @loader_path and @executable_path
Cathy, I tried adding @loader_path/../Frameworks/ and @executable_path/../ Frameworks/ to my projects Runpath Search Paths and I still get the errors shown. Joseph Crawford On Jan 12, 2009, at 6:47 PM, Cathy Shive wrote: Hi Brandon, I recently struggled with this issue (with not too much Xcode/gcc experience) and I found that the @rpath gives very flexible results. In the framework project, I set the 'Installation Directory' build setting for the frarmework's target to @rpath. Any project that links the framework to one of its targets has to define for itself where it's going to look for it. To do this, the target that is using the framework has to have its 'Runpath Search Paths' defined in its build settings. So, if I'm going to embed my framework in an application's executable I'd use something like '@executable_path/../Framework' for the application target's 'Runpath Search Paths' build setting. This is a great thing for frameworks that might be embedded in a bundle like an IB Plugin that you want users to be able to click on in the Finder (IB will be able to find the framework), or be embedded in an app's executable. Each of these uses has different needs and @rpath allows for that without adding a script to a build phase to change the paths dynamically. The downside is that users of your framework will have to do one extra step when they are importing your framework into their application projects - they have to set the 'Runpath Search Path' setting to their app's target to @exectuable_path/../Frameworks or @loader_path/../Frameworks (I don't think it makes a difference in this case). It's not as user friendly, I guess. I really don't know too much about this stuff either, I'm sure someone else can explain it better - but this is the only thing that worked for my framework in every case. Cheers, Cathy On Jan 13, 2009, at 12:05 AM, Joseph Crawford wrote: Brandon, I can tell you what needs to be changed but it is not the suggested route. Everyone is saying that using @loader_path is the way to go over @executable_path, however that said You change it in your target build settings for your framework. Stated by the author of Sparkle Oh, yeah, I've seen people need @executable_path. You would change that in Install Path in the Sparkle target of Sparkle.xcodeproj. But as I said people have suggested against that. Dave Dribin - In general, @loader_path is preferred over @executable_path, as it allows embedded frameworks to work in both an executable and a bundle, plugin, or sub-framework. The only downside is that @loader_path requires 10.4 or newer. If you're on 10.5 or newer, @rpath is even better than @loader_path. Joseph Crawford On Jan 12, 2009, at 5:58 PM, Brandon Walkin wrote: On 12-Jan-09, at 5:00 PM, Dave Dribin wrote: On Jan 12, 2009, at 10:47 AM, Joseph Crawford wrote: I do not know if this is a cocoa question or not, it is an error I get when I hit build go This GDB was configured as i386-apple-darwin.tty /dev/ttys001 warning: Unable to read symbols for @loader_path/../Frameworks/ BWToolkitFramework.framework/Versions/A/ BWToolkitFramework (file not found). warning: Unable to read symbols from BWToolkitFramework (not yet mapped into memory). warning: Unable to read symbols for @loader_path/../Frameworks/ Sparkle.framework/Versions/A/Sparkle (file not found). warning: Unable to read symbols from Sparkle (not yet mapped into memory). These are just debugger errors. This is most like due to those frameworks being compiled in Release mode with their debug symbols stripped. It should not affect debugging of your own application. I did some googling and found that people used a tool to use @executable_path rather than @loader_path but I also read that those values should be the exact same so changing them is not the optimal change to make. For an application, they resolve to the same thing. Does anyone have any idea where I can see / set these values? I have checked my Xcode Project Build settings, the framework build settings, etc. and cannot find them. They are set in the frameworks project, not yours. So if you're linking to pre-built versions of Sparkle and BWToolkit, there are no settings in your app that affect this. In general, @loader_path is preferred over @executable_path, as it allows embedded frameworks to work in both an executable and a bundle, plugin, or sub-framework. The only downside is that @loader_path requires 10.4 or newer. If you're on 10.5 or newer, @rpath is even better than @loader_path. -Dave I'm the developer of BWToolkit. Some users have run into this problem where the framework would work fine for them for a while, and then one day it would output the warnings that Joseph mentioned. My Xcode/gcc knowledge is a bit lacking, so I haven't been able to figure this one out. Do you know what changes
Re: Implementing an Inspector similar to the one in IB.
I am somewhat new to cocoa development and have yet to look at controls but would something like that entail view swapping? Joseph Crawford On Jan 11, 2009, at 3:20 AM, Brian Bruinewoud wrote: Hi, I'm an experienced C++ developer but a relative newbie to Objective- C and Cocoa and am learning my way. I would like to implement an inspector that has views that show/hide by clicking on their headings similar to the ones in the Interface Builder inspector. This control doesn't seem to be available in the IB library, though. Am I overlooking it? (I checked the splitview and tab view controls as I thought that these might do what I want). If I have to implement it myself, are the any tutorials or suggestions as to how to go about it? Thanks, Brian ___ 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/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Google Maps Class / Library
Anyone know if there is a class or library for working with Google Maps in Cocoa? ___ 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: The Ages Old __MyCompanyName__ Question
see this page http://www.mac-developer-network.com/podcasts/xcodequicktips/episode6/index.html On Dec 17, 2008, at 11:32 AM, Phil Hystad wrote: OK, I am fairly new to Xcode and Cocoa programming and I want to change the __MyCompanyName__ template macro definition. So, I google this question, find answers, and try it out. It did not work. So, is there something different in today's Xcode that means the procedure for changing __MyCompanyName__ is different. I think the most recent entry I found (with a date) was 2005 or so. The procedure I tried was to set ORGANIZATIONNAME in the PBXCustomTemplateMacroDefinitions key of the Xcode plist. First, I could not find it by looking at the plist. So, I tried the defaults command from the shell and this seemed to work but no change in behavior on Xcode in spite of cycling Xcode and trying a number of other things. So, How do you change __MyCompanyName__? Thanks, phil phys...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/codebowl%40gmail.com This email sent to codeb...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Special Characters Edit Menu Item
I do not understand why you would want to remove something that is put in place by Apple for a reason. All of my OS X apps have that menu item, if I were to use that menu item and be used to all apps having it I would hate your app for not having it. Is there a real reason you wish to remove it or just because you dont find a use for it personally? On Dec 3, 2008, at 3:24 PM, Ken Thomases wrote: On Dec 3, 2008, at 2:09 PM, David Blanton wrote: I searched the archives and found no useful information on how to remove the Special Characters menu item from the edit menu. I want to remove this item ... is removing this item a good or bad practice? If bad, why? I can't make any appeal to authority, but I can say that I personally find it a bad choice in most situations. If your app allows the entry of any relatively unconstrained text by the user, then the user may have many reasons for wanting to enter special characters. That menu item is the most direct way to do that. (By constrained I mean, for example, a phone number or other purely numeric input. Or, I don't know, DNA sequences where only ATGC are legal.) Why would you want to frustrate your users? Regards, Ken ___ 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/codebowl%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: Special Characters Edit Menu Item
To any familiar mac user they will know ;) it's the newcomers that will probably wonder, then again they will probably understand once they see that ever app has it. On Dec 3, 2008, at 3:35 PM, David Blanton wrote: There is no text entry capability in my app so this menu item looks like I don't know what I am doing. On Dec 3, 2008, at 1:30 PM, Joseph Crawford wrote: I do not understand why you would want to remove something that is put in place by Apple for a reason. All of my OS X apps have that menu item, if I were to use that menu item and be used to all apps having it I would hate your app for not having it. Is there a real reason you wish to remove it or just because you dont find a use for it personally? On Dec 3, 2008, at 3:24 PM, Ken Thomases wrote: On Dec 3, 2008, at 2:09 PM, David Blanton wrote: I searched the archives and found no useful information on how to remove the Special Characters menu item from the edit menu. I want to remove this item ... is removing this item a good or bad practice? If bad, why? I can't make any appeal to authority, but I can say that I personally find it a bad choice in most situations. If your app allows the entry of any relatively unconstrained text by the user, then the user may have many reasons for wanting to enter special characters. That menu item is the most direct way to do that. (By constrained I mean, for example, a phone number or other purely numeric input. Or, I don't know, DNA sequences where only ATGC are legal.) Why would you want to frustrate your users? Regards, Ken ___ 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/codebowl %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/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/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Tabbing to Placeholders
Yes you would just have to change your keybindings in preferences On Nov 21, 2008, at 10:12 AM, DKJ wrote: On 21-Nov-08, at 6:50 , Greg Deward wrote: Is it possible to tab or jump to the next placeholder in the selector? Control-/ does it on my keyboard. ___ 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/codebowl%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: placing a window in the top left corner
Wouldn't the point just be 0, 0 in that case? I'm a beginner so I am not positive. On Nov 19, 2008, at 9:47 AM, Nick Rogers wrote: Hi, whenever my app opens a second preview window, I want it to be positioned at the top left corner of the desktop screen. I have come across two methods in NSWindow, they are: – setFrameTopLeftPoint: and – cascadeTopLeftFromPoint: But these require a point as input. How do I calculate this point? Also if the user has the dock vertical on the left side, how do I adjust for that? What if the user has different resolution like 800x600? 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/codebowl%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: Autorelease Question
I believe that would better be done like this - (NSString *)foo { NSString blah = [[[NSString alloc] init] autorelease] ... return blah; } I might not be correct as I am a newbie too.. Thanks, Joseph Crawford On Nov 19, 2008, at 5:37 PM, Carmen Cerino Jr. wrote: I am not sure the best way to phrase this question into words, so I will phrase it using example code. - (NSString*)foo { NSString blah = [NSString string]; . //Now do I do: return blah; //Or: return [[blah retain] autorelease]]; } ___ 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/codebowl%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: how to create a faceless background application
han, by any chance would you be talking about NSThread? You want to break a process off into another thread to complete your calculation then notify your application when it is completed. This will not hold up the UI while doing the calculation. I am not sure how to implement it as I am still new but NSThread seems to be what you are looking for. Joseph Crawford On Oct 14, 2008, at 2:53 AM, han wrote: My application uses a faceless background application to perform some calculations. This background application is launched and terminated by my foreground application.But I don't know how to create a faceless background application? 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/codebowl%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: KVC Question
I would like to thank everyone who responded to my last e-mail, especially Nathan for helping out so much off-list. I do have another question however. I have a class that is set to be the File Owner for a view. This View has an array controller that is bound to an NSMutableArray in the File Owner so [SearchNameViewController result] The issue I am running into is that when I do [result addObject:obj] the array controller does not seem to update so the UI does not load the data. Nathan suggested changing that code to [resultsArrayController addObject:obj] and that works perfect. What I need to know is if there is something I should be doing to *notify* the array controller telling it to update. Thanks, Joseph Crawford ___ 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]
KVC Question
Hello, To give a bit of a background what I am doing is writing an application that will query the whitepages.com web api. I have all the XML parsing done so that it parses all the results into a results array that I am trying to use for my table data source. I am trying to set this up to use KVC but I am having a little problem. I have read the docs on apple about KVC but I cannot seem to get it to return more than 1 row to my tableview. Here is how I have things setup. I am using view swapping and I am trying to keep things abstracted to avoid code duplication. I have my classes setup like this CBSManagingViewController CBSSearchNameViewController (extends CBSManagingViewController) I have an NSMutableArray named results which is allocated and initialized in the CBSManagingViewController. Each result object is an instance of CBSSearchNameResult which holds 2 more arrays for the people and phone numbers and 1 address object. The issue I am running into is that when I run a search only the first row in the table view is populated with data from my results array. I am thinking this is because the valueForKey method is not passed the row index so it does not know which result object to return. I have the model key path for my first name column set to primaryPerson.firstName, this is calling the primaryPerson method which returns an instance of the person object. Then it will use the value of the firstName property to populate the table column. Here are the sources for my files. CBSManagingViewController - http://pastebin.com/m2a17cfb9 CBSSearchNameViewController - http://pastebin.com/m15821f48 CBSSearchNameResult - http://pastebin.com/m3b7bc0b9 CBSPerson - http://pastebin.com/m61d8c4a7 CBSPhone- http://pastebin.com/m5a2cf323 CBSAddress - http://pastebin.com/m4e283ca8 This is my first application so please be gentle with any feedback on the code. Thanks, Joseph Crawford ___ 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]