Prevent plug-ins from having framework conflicts.
I am currently writing a plug-in framework for my application. I would like to be able to release plugins without having to update my application, and I intend on making the framework available for third party plugins. I am currently running into issues when two plugins ship with identical frameworks. When the plugins are loaded the runtime gets confused because the framework gets loaded twice. What is the best way to mitigate this issue? Thanks, Carmen C. Cerino ___ 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: Prevent plug-ins from having framework conflicts.
I would agree with you that plug-ins shouldn't do that if it was not a plugin framework that was going to be opened up to 3rd party developers or if its code shared between the application and the plug-ins. I have no control over what frameworks developers use to write plug-ins for my app. Two developers may write two different plug-ins who both use the same framework. On Tue, May 4, 2010 at 1:55 PM, Kyle Sluder kyle.slu...@gmail.com wrote: On Tue, May 4, 2010 at 10:22 AM, Carmen Cerino Jr. ccerin...@gmail.com wrote: I am currently writing a plug-in framework for my application. I would like to be able to release plugins without having to update my application, and I intend on making the framework available for third party plugins. I am currently running into issues when two plugins ship with identical frameworks. When the plugins are loaded the runtime gets confused because the framework gets loaded twice. What is the best way to mitigate this issue? Plugins need to not do that. If they share a framework, that framework needs to be part of the app bundle rather than the plugin. If they are two unrelated plugins that happen to use the same library, then they need to compile that framework in such a way that the symbols don't conflict. We have a few similar scenarios. We define a macro like PLUGIN_NAME=FooPlugin and all of our headers are written like this: // Warning: written in compose window #define PLUGIN_SYMBOL_NAME(sym) PLUGIN_NAME##sym @interface PLUGIN_SYMBOL_NAME(CommonClass) : NSObject { ... } --Kyle Sluder -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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
NSPredicateEditorRowTemplate and CoreData
I am trying to generate predicate editor templates for my Core Data entities. In my code I have the following: NSEntityDescription *descrip = [NSEntityDescription entityForName:@Person inManagedObjectContext:managedObjectContext]; NSArray *templates = [NSPredicateEditorRowTemplate templatesWithAttributeKeyPaths:[NSArray arrayWithObjects:@name, @age, nil] inEntityDescription:descrip]; [ibPredicateEditor setRowTemplates: templates]; NSPredicate *p = [NSPredicate predicateWithFormat:@name like 'John']; [ibPredicateEditor setObjectValue:p]; Printing out the contents of the templates array gives me the following: CFArray 0x1002d7400 [0x7fff70ff5f20]{type = immutable, count = 2, values = ( 0 : NSPredicateEditorRowTemplate 0x10025c090: [name] [99, 4, 5, 8, 9] NSStringAttributeType 1 : NSPredicateEditorRowTemplate 0x1002d2dc0: [age] [4, 5, 0, 2, 1, 3] NSInteger16AttributeType )} When this code executes I get the following on the console: Warning - unable to find template matching predicate name LIKE Worsley The interface for doing this looks extremely straight forward, so I can't seem to figure out what I am doing wrong. Any help would be greatly appreciated! Cheers, Carmen___ 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
Source List Indentation Drawing Issue
Howdy, I have been having a hard time trying to track down information on this issue, mostly because its a rather difficult to describe. The best summary I can give is that if you set an NSOutlineView to have the source list highlight style, and expand a node that contains a node with children, the indentation of all currently expanded nodes shifts. If the node is collapsed, the indentation is shifted back to its original spacing. At first I thought I was doing something wrong, but even Apple's SourceView example has this issue. Any information on this issue would be greatly appreciated. Cheers, Carmen Video Description of the Problem: http://screencast.com/t/MzA5ZWFm ___ 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
NSArrayController and avoidsEmptySelection
I have an NSArrayController hooked up to an NSCollectionView. When a user clicks into the empty space of the NSCollectionView, I would like it so they do not lose their currently selected items. I would have thought it should have been as simple as telling the NSArrayController to avoid empty selections. However, I do not get the desired result when this property is set. Is there something else that needs to be setup in order for this to work as expected or is my assumption about what that property is suppose to do completely wrong? In order to temporarily achieve the desired effect, I ended up subclasing NSArrayController and overriding the setSelectionIndexes: method to ignore index sets with a count of 0. However, this seems more like a work around than a solution. Cheers, Carmen ___ 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
Pull Down Toolbar Item
Howdy, I would like to create a pull down toolbar item similar to what Xcode has for a few of its toolbar items. However, I am NOT refering to the delayed menu. In order to create the item, I started with a subclass of NSToolbarItem that has a NSPopupButton for its view. The image for the toolbar item or rather the popup button comes from the first item since I have the popup button set to pull down mode (as per what the NSPopupButton documentation states). The issue I am running into is that the image is not being fully displayed (see screen capture below). Increasing the size of the toolbar item solves the issue, but causes the item to be out of alignment with the rest of the items. The other issue I am running into is more of a matter of curiosity. If you look at the screen capture of my custom toolbar item and then look at XCode's toolbar item, you will notice the location of the pulldown triangle is different. I am just curious as to how they got it positioned more to the bottom right of the image vs. the center. My guess is that they possibly drew the triangle themselves. My Toolbar Item: http://screencast.com/t/4MKExdXxsO XCode's Toolbar Item: http://screencast.com/t/TJljMYvfaB Thanks, Carmen ___ 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: Pull Down Toolbar Item
Any particular reason to use a subclass? You should be able to use a plain NSTollbarItem, and set the pop-up button using -setView: You need to subclass in order to get validation working. That is the only reason I can think of why it needs to be a subclass As you have noted, you need to set the max and min sizes of a toolbar item that contains a custom view. In order for your items to line up, you probably also need to make sure that they're of similar size. The standard size for image style toolbar items is 32x32px. The toolbar items are sized at 32x32 for both min and max. When I create the Popup button control, it is created with a frame of size 32x32 as well. Is there something I am forgetting to properly size? Thanks for the info on the arrow. I didn't think of looking down into the NSPopupButtonCell for those properties. I will give them a try and let you know how they turn out. On Mon, Dec 29, 2008 at 11:23 AM, j o a r j...@joar.com wrote: On Dec 29, 2008, at 7:00 AM, Carmen Cerino Jr. wrote: In order to create the item, I started with a subclass of NSToolbarItem that has a NSPopupButton for its view. Any particular reason to use a subclass? You should be able to use a plain NSTollbarItem, and set the pop-up button using -setView:. The issue I am running into is that the image is not being fully displayed (see screen capture below). Increasing the size of the toolbar item solves the issue, but causes the item to be out of alignment with the rest of the items. As you have noted, you need to set the max and min sizes of a toolbar item that contains a custom view. In order for your items to line up, you probably also need to make sure that they're of similar size. The standard size for image style toolbar items is 32x32px. I am just curious as to how they got it positioned more to the bottom right of the image vs. the center. My guess is that they possibly drew the triangle themselves. I think that you're supposed to be able to use the arrowPosition and preferredEdge properties of the pop-up button cell to control where the arrow shows up, but I think that Xcode is probably using custom artwork in this case. j o a r -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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: Pull Down Toolbar Item
The setArrowPosition and preferedEdge methods do not work for me. I followed the documentation to get the arrow to appear in the lower right corner pointing down and nothing happens. On Mon, Dec 29, 2008 at 1:04 PM, Carmen Cerino Jr. ccerin...@gmail.comwrote: Any particular reason to use a subclass? You should be able to use a plain NSTollbarItem, and set the pop-up button using -setView: You need to subclass in order to get validation working. That is the only reason I can think of why it needs to be a subclass As you have noted, you need to set the max and min sizes of a toolbar item that contains a custom view. In order for your items to line up, you probably also need to make sure that they're of similar size. The standard size for image style toolbar items is 32x32px. The toolbar items are sized at 32x32 for both min and max. When I create the Popup button control, it is created with a frame of size 32x32 as well. Is there something I am forgetting to properly size? Thanks for the info on the arrow. I didn't think of looking down into the NSPopupButtonCell for those properties. I will give them a try and let you know how they turn out. On Mon, Dec 29, 2008 at 11:23 AM, j o a r j...@joar.com wrote: On Dec 29, 2008, at 7:00 AM, Carmen Cerino Jr. wrote: In order to create the item, I started with a subclass of NSToolbarItem that has a NSPopupButton for its view. Any particular reason to use a subclass? You should be able to use a plain NSTollbarItem, and set the pop-up button using -setView:. The issue I am running into is that the image is not being fully displayed (see screen capture below). Increasing the size of the toolbar item solves the issue, but causes the item to be out of alignment with the rest of the items. As you have noted, you need to set the max and min sizes of a toolbar item that contains a custom view. In order for your items to line up, you probably also need to make sure that they're of similar size. The standard size for image style toolbar items is 32x32px. I am just curious as to how they got it positioned more to the bottom right of the image vs. the center. My guess is that they possibly drew the triangle themselves. I think that you're supposed to be able to use the arrowPosition and preferredEdge properties of the pop-up button cell to control where the arrow shows up, but I think that Xcode is probably using custom artwork in this case. j o a r -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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: Pull Down Toolbar Item
For the clipping issue, I am 95% sure it has to do with how NSPopUpButton draws the image. If you look at the following screen capture, you will notice the NSButton and NSPopUpButton differ greatly on how they draw their images. http://screencast.com/t/zXY5sLZP On Mon, Dec 29, 2008 at 3:18 PM, Carmen Cerino Jr. ccerin...@gmail.comwrote: There is no such thing as simple validation for NSToolbarItems with custom views. Apple does not implement any validation what so ever when it comes to those custom items. http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Toolbars/Tasks/ValidatingTBItems.html#//apple_ref/doc/uid/2753 I am working on cleaning up my sample code to post. I should be able to post it in a few hours. On Mon, Dec 29, 2008 at 2:14 PM, j o a r j...@joar.com wrote: On Dec 29, 2008, at 10:04 AM, Carmen Cerino Jr. wrote: You need to subclass in order to get validation working. That is the only reason I can think of why it needs to be a subclass Can you describe the type of validation that you're interested in performing? Simple validation should work automatically for at least the standard Cocoa controls, IIRC. The toolbar items are sized at 32x32 for both min and max. When I create the Popup button control, it is created with a frame of size 32x32 as well. Is there something I am forgetting to properly size? Not sure. Perhaps you can provide a screenshot of what the toolbar looks like when it's not aligned properly? If you could post a sample project that reproduces your problem, that would probably help too (preferably over http, and not inline to the list). j o a r -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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: Pull Down Toolbar Item
I am now 99% sure that its drawing method is doing something awkward. Here are the results of what happened when I implemented my own draw method: http://screencast.com/t/FbOLyvgDS On Mon, Dec 29, 2008 at 3:41 PM, Carmen Cerino Jr. ccerin...@gmail.comwrote: For the clipping issue, I am 95% sure it has to do with how NSPopUpButton draws the image. If you look at the following screen capture, you will notice the NSButton and NSPopUpButton differ greatly on how they draw their images. http://screencast.com/t/zXY5sLZP On Mon, Dec 29, 2008 at 3:18 PM, Carmen Cerino Jr. ccerin...@gmail.comwrote: There is no such thing as simple validation for NSToolbarItems with custom views. Apple does not implement any validation what so ever when it comes to those custom items. http://developer.apple.com/DOCUMENTATION/Cocoa/Conceptual/Toolbars/Tasks/ValidatingTBItems.html#//apple_ref/doc/uid/2753 I am working on cleaning up my sample code to post. I should be able to post it in a few hours. On Mon, Dec 29, 2008 at 2:14 PM, j o a r j...@joar.com wrote: On Dec 29, 2008, at 10:04 AM, Carmen Cerino Jr. wrote: You need to subclass in order to get validation working. That is the only reason I can think of why it needs to be a subclass Can you describe the type of validation that you're interested in performing? Simple validation should work automatically for at least the standard Cocoa controls, IIRC. The toolbar items are sized at 32x32 for both min and max. When I create the Popup button control, it is created with a frame of size 32x32 as well. Is there something I am forgetting to properly size? Not sure. Perhaps you can provide a screenshot of what the toolbar looks like when it's not aligned properly? If you could post a sample project that reproduces your problem, that would probably help too (preferably over http, and not inline to the list). j o a r -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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
NSToolbar Error
Can anyone explain where I should be looking for the cause of this issue? I pulled my toolbar code from another project that is working completely fine. 2008-12-18 09:19:02.485 MyProject [36461:10b] *** Assertion failure in -[NSToolbar _forceMoveItemFromIndex:toIndex:], /SourceCache/AppKit/AppKit-949.35/Toolbar.subproj/NSToolbar.m:1205 2008-12-18 09:19:02.485 MyProject [36461:10b] Invalid parameter not satisfying: frIndex=0 frIndex[self _numberOfItems] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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: NSToolbar Error
Allow me to add some more context to this error. It occurs during customization of the toolbar when I try to move a item from one location on the toolbar to another. The odd thing is if I drag out the default toolbar from the customization palette and repeat the same process, this error does not occur. On Thu, Dec 18, 2008 at 9:22 AM, Carmen Cerino Jr. ccerin...@gmail.com wrote: Can anyone explain where I should be looking for the cause of this issue? I pulled my toolbar code from another project that is working completely fine. 2008-12-18 09:19:02.485 MyProject [36461:10b] *** Assertion failure in -[NSToolbar _forceMoveItemFromIndex:toIndex:], /SourceCache/AppKit/AppKit-949.35/Toolbar.subproj/NSToolbar.m:1205 2008-12-18 09:19:02.485 MyProject [36461:10b] Invalid parameter not satisfying: frIndex=0 frIndex[self _numberOfItems] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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: Validation of a Custom View NSToolbarItem
I apologize if I cam of snarky in my last email. I guess I may still confused on how the validation process works. My impression from the Toolbar Programming guide was that if you are dealing with image based items you want to implement the validateToolbarItem in your target. However if you are dealing with an item with a custom view you need to go the subclassing route and override validate. They did not mention in the guide that validate needs to make a call to any other methods outside whatever you need to do in order to make the contents of the view appear disabled or enabled. Another issue I am having is that I read view based items don't get autovalidated, so by autovalidation are they referring to the act of validating or the process of checking if something is valid or not? I guess that would be the reason why I made my first post. I was unsure if I was suppose to ask the item to validate itself or if the toolbar should be doing it. I did try the class that Keith provided, but had no luck. I am a breakpoint and an NSLog statement inside validate and neither are getting hit. From this point on lets assume that I am using Keith's custom item, but here is some of the rest of my code. static void addToolbarItem(NSMutableDictionary *theDict,NSString *identifier,NSString *label,NSString *paletteLabel,NSString *toolTip,id target,SEL settingSelector, id itemContent,SEL action, NSMenu * menu) { NSMenuItem *mItem; NSToolbarItem *item; if([identifier isEqualToString:@uploads]) { item = [[[KBViewToolbarItem alloc] initWithItemIdentifier:identifier] autorelease]; } else { item = [[[NSToolbarItem alloc] initWithItemIdentifier:identifier] autorelease]; } [item setLabel:label]; [item setPaletteLabel:paletteLabel]; [item setToolTip:toolTip]; [item setTarget:target]; [item performSelector:settingSelector withObject:itemContent]; [item setAction:action]; if (menu!=NULL) { // we actually need an NSMenuItem here, so we construct one mItem=[[[NSMenuItem alloc] init] autorelease]; [mItem setSubmenu: menu]; [mItem setTitle: [menu title]]; [item setMenuFormRepresentation:mItem]; } [theDict setObject:item forKey:identifier]; } + (NSToolbar*)initialToolbarWithDelegate:(id)delegate { NSToolbar *toolbar=[[[NSToolbar alloc] initWithIdentifier:@myToolbar] autorelease]; [toolbar setDelegate:delegate]; [toolbar setAllowsUserCustomization:YES]; [toolbar setDisplayMode: NSToolbarDisplayModeIconAndLabel]; [toolbar setSizeMode:NSToolbarSizeModeSmall]; return toolbar; } -(void)awakeFromNib { mToolbarItems = [[NSMutableDictionary alloc] init]; addToolbarItem(mToolbarItems,@login,@Login,@Login/Logout,@Login.,self,@selector(setImage:),[NSImage imageNamed:NSImageNameUser],@selector(loginLogout:),NULL); addToolbarItem(mToolbarItems,@serverStatus,@servername.domain.com,@servername.domain.com,@Connected server status.,self,@selector(setImage:),[NSImage imageNamed:@ConnectionGood],@selector(showWebsite:),NULL); addToolbarItem(mToolbarItems,@uploads,@View Uploads,@View Uploads,@View your pending uploadds.,self,@selector(setView:),ibPendingUploadsItemView, NULL,NULL); } - (NSToolbarItem *)toolbar:(NSToolbar *)toolbar itemForItemIdentifier:(NSString *)itemIdentifier willBeInsertedIntoToolbar:(BOOL)flag { // We create and autorelease a new NSToolbarItem, and then go through the process of setting up its // attributes from the master toolbar item matching that identifier in our dictionary of items. NSToolbarItem *newItem = [[[NSToolbarItem alloc] initWithItemIdentifier:itemIdentifier] autorelease]; NSToolbarItem *item=[mToolbarItems objectForKey:itemIdentifier]; [newItem setLabel:[item label]]; [newItem setPaletteLabel:[item paletteLabel]]; if ([item view]!=NULL) { [newItem setView:[item view]]; } else { [newItem setImage:[item image]]; } [newItem setToolTip:[item toolTip]]; [newItem setTarget:[item target]]; [newItem setAction:[item action]]; [newItem setMenuFormRepresentation:[item menuFormRepresentation]]; if ([newItem view]!=NULL) { [newItem setMinSize:[[item view] bounds].size]; [newItem setMaxSize:[[item view] bounds].size]; } [newItem setEnabled:YES]; return newItem; } - (NSArray *)toolbarDefaultItemIdentifiers:(NSToolbar*)toolbar { return [NSArray arrayWithObjects:@login,@uploads,NSToolbarSeparatorItemIdentifier,NSToolbarFlexibleSpaceItemIdentifier,@serverStatus,nil]; } - (NSArray *)toolbarAllowedItemIdentifiers:(NSToolbar*)toolbar { return [NSArray arrayWithObjects:@login,@uploads, NSToolbarSeparatorItemIdentifier,NSToolbarFlexibleSpaceItemIdentifier,@serverStatus, NSToolbarSpaceItemIdentifier,nil]; } - (BOOL)validateToolbarItem:(NSToolbarItem *)theItem { if([[theItem itemIdentifier] isEqualToString:@login]) { if((mLoggedIn ![[theItem label] isEqualToString:@Logout]) || (!mLoggedIn
Re: NSToolbar Error
This issue has been resolved. Unfortunately, I can't think of an easy way to describe the issue without providing some deep contextual details of some of my code. However it is not related to the issue I am having with validation of a toolbar item with a custom view. On Thu, Dec 18, 2008 at 9:42 AM, Carmen Cerino Jr. ccerin...@gmail.com wrote: Allow me to add some more context to this error. It occurs during customization of the toolbar when I try to move a item from one location on the toolbar to another. The odd thing is if I drag out the default toolbar from the customization palette and repeat the same process, this error does not occur. On Thu, Dec 18, 2008 at 9:22 AM, Carmen Cerino Jr. ccerin...@gmail.com wrote: Can anyone explain where I should be looking for the cause of this issue? I pulled my toolbar code from another project that is working completely fine. 2008-12-18 09:19:02.485 MyProject [36461:10b] *** Assertion failure in -[NSToolbar _forceMoveItemFromIndex:toIndex:], /SourceCache/AppKit/AppKit-949.35/Toolbar.subproj/NSToolbar.m:1205 2008-12-18 09:19:02.485 MyProject [36461:10b] Invalid parameter not satisfying: frIndex=0 frIndex[self _numberOfItems] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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
Validation of a Custom View NSToolbarItem
I understand I need to have a NSToolbarItem subclass and override its validate method, but who is responsible for calling it? Will NSToolbar call it during its validation routine or do I need to come up with my own validation routine? Cheers, Carmen ___ 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
View Swapping
Howdy, Are there any guides regarding when it is appropriate to use this technique? Thanks, Carmen ___ 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
Autorelease Question
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/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Autorelease Question
I guess I should also have included what spawned this question in the first place. I have read in a handful of places that you can guarantee, in the example case, that blah will exist until the end of function, and that sometime after the end of the scope of the function blah will be released. So if you don't know when it will be released, is there a possibility of it being released before control gets back to the caller so it can retain it? On Wed, Nov 19, 2008 at 6:19 PM, Kyle Sluder [EMAIL PROTECTED] wrote: Read this document: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Concepts/ObjectOwnership.html#//apple_ref/doc/uid/2043-BEHDEDDB Then read this one: http://developer.apple.com/documentation/Cocoa/Conceptual/MemoryMgmt/Tasks/MemoryManagementRules.html If you are just starting out, don't look for any patterns, just follow the rules. If you take ownership of an object, and want to return it and have nothing more to do with it, you need to relinquish ownership. But if you just send it -release then it might go away before the caller gets it back, which is why -autorelease exists. --Kyle Sluder -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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
Thank you all for your clarifications! On Wed, Nov 19, 2008 at 6:53 PM, Andy Lee [EMAIL PROTECTED] wrote: 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]]; } Both return statements are consistent with the memory management rules, but in this particular example, the retain and autorelease are superfluous. I wonder if you're asking because you've seen accessor methods that use the second variation? For example, if you have a Person class with a name ivar: - (NSString *)name { return [[name retain] autorelease]; } In this case an argument can be made for the retain and autorelease as opposed to just return name;. They protect from something like this: Person *aPerson = [[Person alloc] init]; // ... some code which sets the person's name along the way ... NSString *aName = [aPerson name]; [aPerson release]; The [aPerson release] might cause aPerson to be deallocated, which might cause its name to be deallocated, which would cause aName to be a bad pointer. When I saw this pitfall, I panicked and thought I'd need to rewrite all my getter methods. But it was Jens Ayton, I think, who noted that in practice one is very unlikely to run into this pitfall, so really it's a matter of personal preference. -- Carmen C. Cerino University of Akron ACM Chapter President University of Akron Aux. Services Student Assistant Cell: 440.263.5057 AIM: UAcodeweaver [ I 3 MACs ] ___ 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]
NSClassDescription Clarification
I would like to take advantage of Key-Value Programming in my application. Utilizing key-value programming I would like the ability to iterate through all of my object's values or members. If I am understanding NSObject's documentation right, I need to implement a class description in order to get the attributeKeys method to work. I am a little lost on what a class description is or what one is suppose to look like. Can anyone provide some clarification or point me to some examples? Thanks Carmen ___ 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]
pragma mark Queston
How are the labels suppose to appear in the drop down menu? All of mine are showing up at the bottom of the list. I have opened other people's projects and have seen their labels appear before each function group they are describing. ___ 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]
Modal Dialog Issue
I have a button that when clicked will display a modal dialog. My modal dialog is custom, and lives in its own Xib file. My issue is that the first time I click the button to make the dialog appear it does not latch it self onto the window like it should. If I go to dismiss the dialog with my cancel button, the dialog does not disappear but focus returns to my main window. Now the strange thing is if I go to click that button again, the modal dialog works as it should. My code is as follows: - (IBAction)signIn:(id)sender{ if(!ibUserAuthenticationWindow) { [NSBundle loadNibNamed: @UserAuth owner: self]; } [NSApp beginSheet: ibUserAuthenticationWindow modalForWindow: ibMainWindow modalDelegate: self didEndSelector: @selector(didEndSheet:returnCode:contextInfo:) contextInfo: nil]; } - (IBAction)authenticationCancel:(id)sender { [NSApp endSheet:ibUserAuthenticationWindow]; } - (void)didEndSheet:(NSWindow *)sheet returnCode:(int)returnCode contextInfo:(void *)contextInfo{ [sheet orderOut:self]; } Cheers, Carmen ___ 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]
NSTableView with Custom Views as Cells Redraw Problem
Basically I have an array of views for every item in my data source, and my table uses a custom cell for its data cell. This cell has a weak reference to one of the views in the array, and it is set every time during the tableWillDisplayCell delegate method of the TableView. When the cell goes to draw itself it will set its view's frame to match the cell's frame, and it checks to see if its view's superview matches the control view of that cell. If they do not match the view is added to the control view. The issue I am having is when I go to resize the window, it appears the views are drawing over themselves. Here a link to a screen capture of the issue in action: http://screencast.com/t/Fbc2WrZsG Any help would be greatly appreciated! Please let me know if you would like to see my code. I am following this tutorial on pulling of this custom cell effect: http://www.joar.com/code/body.html Cheers, Carmen ___ 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]
NSTableView Questions
Howdy, My goal is to create an upload dialog. Like most upload/download dialogs, I am going to use a table view to display my information. Eventually I will need to create my own custom NSCell in order to represent an item being uploaded, so I can represent multiple pieces of information in one cell. I am currently having difficulty getting my NSTableView setup in order to accept this custom NSCell. I first tried doing the usual, and adding an NSTableView in IB. I can't seem to figure out how to make IB recognize my custom NSCell class so it appears in the drop down list for the cell in my table's column. Next I tried adding an NSTableView to my view in my code. I was able to successfully set the cell for my table's column to my custom cell, but I was not able to figure out how to go about getting the TableView to size properly. In other words, I would set my the ScrollView that enclosed the TableView to be 400x400, but the TableView would size to fit the data instead of matching the size of its container. I thought setting the TableView's size to match that of the ScrollView would fix the problem, but for some reason it doesn't. Any advice on the best approach for designing this project would be greatly appreciated. Carmen C. Cerino Jr. ___ 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]
Questions on An NSOpenGL Application Design
When my application starts up, the user is presented with a settings window. It contains a view that will be attached to a web camera, and some widgets to control various filter settings. Once the settings are tweaked to the user's desire, the window will be closed, but the camera will still be processing images. In addition to standard CIFilters, I will also need to read the pixels back in from VRAM to perform an analysis on the CPU that I have yet to transform into a CIFilter. The way I plan on designing this application is to have an NSOpenGLView subclass to display my camera feed, and another class to control the camera and all of the image processing. Questions: 1. Should I stick with this design path? Some of the sample code I have seen puts what I have broken down into two classes all in the NSOpenGLView subclass, ie CIVideoDemoGL. 2. If I leave the code in two seperate files, do I need two OpenGLContexts, one for the view and one to link to a CIContext for the image filters, or can I just use the one from the NSOpenGLView? 3. When I bring the images back in from the GPU they will already be rendered with the CIFilters, so is it worth it to push them back out to OpenGL for drawing? ___ 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: Question about respondsToSelector
Sorry about the sketchy details. Basically I have a wrapper class for the Sequence Grabber, and I want to setup a delegate for the decompression callback. This is where I use the respondsToSelector method: static void SGVideoDecompTrackingCallback( void *decompressionTrackingRefCon, OSStatus result, ICMDecompressionTrackingFlags decompressionTrackingFlags, CVPixelBufferRef pixelBuffer, TimeValue64 displayTime, TimeValue64 displayDuration, ICMValidTimeFlags validTimeFlags, void *reserved, void *sourceFrameRefCon ) { #pragma unused(reserved) #pragma unused(sourceFrameRefCon) SGVideo* sgVideoChan = (SGVideo*)decompressionTrackingRefCon; id _delegate = sgVideoChan.delegate; if (result == noErr){ if ([_delegate respondsToSelector: @selector(SGDecompDataProc:)]){ [_delegate SGDecompDataProc:pixelBuffer trackingFlags:decompressionTrackingFlags displayTime:displayTime displayDuration:displayDuration validTimeFlags:validTimeFlags]; } } } Header file where the function I am checking is prototyped: @interface VideoController : NSObject { SeqGrab* mSeqGrab; SGVideo* mVideoChan; IBOutlet SampleCIView* mPreview; } -(void)SGDecompDataProc: (CVPixelBufferRef)pixelBuffer trackingFlags: (ICMDecompressionTrackingFlags)decompressionTrackingFlags displayTime: (TimeValue64)displayTime displayDuration:(TimeValue64)displayDuration validTimeFlags:(ICMValidTimeFlags)validTimeFlags; @end Please let me know if you need to see anything else. Once again I apologize for the sketchy details. Thank you all for your help! Carmen On Aug 18, 2008, at 4:39 PM, Andy Lee wrote: Also: note that method names are case-sensitive, so @selector(doSomething) is not the same as @selector(doSomeThing). Also, if the method you are referring to takes an argument, make sure you aren't forgetting the colon at the end. The name of the method contains all its colons; @selector(doSomething) is different from @selector(doSomething:). --Andy ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Question about respondsToSelector
*Smacks forehead* Believe it or not I had that originally and it didn't work. I must of had a type-o in the function header that I was passing to respondsToSelector. Thank you all. I am going to go back to making an ass out of myself in the privacy of my own home. Cheers, Carmen On Aug 19, 2008, at 9:55 AM, Jonathan del Strother wrote: GDecompDataProc: trackingFlags: displayTime: displayDuration: validTimeFlags: ___ 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]
Question about respondsToSelector
Does the id type have enough information for the respondsToSelector method to work. I have a class with an ivar of type id, and when I invoke the respondsToSelector method it fails when it should succeed. I am assuming it should work fine, because if I skip checking with the respondsToSelector method and just make the call, it executes the method. Can someone please tell me what I am doing wrong? Thanks, Carmen ___ 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]