network volume names changing etc.
I've noticed that Mac OS sometimes silently changes the UNIX mount name of network volumes. For example, if I mount a network volume of Media, it would normally be /Volumes/Media, but sometimes it isn't. For example, if another user on the same machine mounts Media first, then you might end up having it mounted as /Volumes/Media-1 or some such. Is there any document that discusses it? And what is the recommended way to store paths in this case? I don't know if its right, but I'm in the habit of storing UNIX paths, but this doesn't work very well for network shares because the UNIX path keeps changing because of the above. How can I store a path and get it back in a way that takes into account the above? Also as an aside, is there a way to have network volumes mounted for all users at once instead of just one user at a time? ___ 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
Bindings don't work with cut and paste
I have a NSTextView's value bound to an object. I do not have Continuous update turned on. The binding works when I type into the field and exit the field. However if I *paste* text into the field, then exit the field, the binding set: method is never called. What am I missing? ___ 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
encoding of file names
If I take a string from an NSTextField with an accented character: café and I make this into a file name and write a file, then I read that file name back in (using NSFileManager contentsOfDirectoryAtPath), then the string read back in, still looks the same: an accented café, but the strings don't compare anymore. The one in the text field was unichars: 99,97,102,233 and the one in the file name is now99,97,102,101,769. What does it mean, and how can I make sure I get them both the same and comparable? ___ 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
App Store code signing
Is this the right forum to ask about the whole business of verifying signatures etc for apps in the app store for Mac? I've been trying to get the code to work, but I'm stumped. ___ 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
Joining App Developer Program
Sorry if this is a little off topic, but I don't know who to ask and I can't get any sense out of Apple. I attempted to join the Mac dev program the day Steve Jobs announced it. A couple of days later I was asked to submit some company documents, which I did, and which was acknowledged. Now I've been waiting a week with no word, and I'm eager to start making any necessary changes to my app to support the app store. When I go to the site it says we are trying to contact the legal representative of your company, which kind of contradicts a separate email which says they are processing my documentation. How long should this process take? When should I get worried? Is there any way to get access to technical documentation without waiting? Is there any way to contact Apple since they don't answer emails? ___ 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
Multiple instances of [NSUserDefaults standardUserDefaults]
I'm printing out the address of [NSUserDefaultsstandardUserDefaults] in several places in my app, and getting a different result! This is causing me problems. I'm using a plugin architecture, so I'm guessing this has something to do with it, but even so, I haven't seen anything like this happen before as far as being multiple instances of global variables. Has anyone got any thoughts? ___ 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: Multiple instances of [NSUserDefaults standardUserDefaults]
Well, I've got some code, which I presume used to work, which relies on observing a value in the user defaults. The observer isn't getting triggered, so I am guessing it is because they are separate instances. Both should be on the main thread. - Original Message From: Dave Keck davek...@gmail.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Sat, 23 October, 2010 10:05:01 PM Subject: Re: Multiple instances of [NSUserDefaults standardUserDefaults] Has anyone got any thoughts? I wouldn't be surprised if there's a separate NSUserDefaults instance for each thread. Regardless though, it's an implementation detail that shouldn't be relied on unless the docs guarantee certain behavior. Could you explain why you need to rely on NSUserDefaults returning the same instance on each invocation of -standardUserDefaults? ___ 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: Multiple instances of [NSUserDefaults standardUserDefaults]
Some stuff on the net seems to indicate that NSUserDefaults does support KVO. If it doesn't, how would NSUserDefaultsController accurately notify of all changes to NSUserDefaults? Or maybe one has to always access it through NSUserDefaultsController to get consistent notifications? In which case, it kind of seems pointless that they are two separate classes. - Original Message From: Dave Keck davek...@gmail.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Sat, 23 October, 2010 10:48:01 PM Subject: Re: Multiple instances of [NSUserDefaults standardUserDefaults] Well, I've got some code, which I presume used to work, which relies on observing a value in the user defaults. The observer isn't getting triggered, so I am guessing it is because they are separate instances. Both should be on the main thread. Are you observing an instance of NSUserDefaults or NSUserDefaultsController? NSUD doesn't support KVO – perhaps that's the problem? Also, for testing at least, you might as well allocate your own NSUserDefaultsController instance and stick it in an ivar. That way, pointer comparison in -observeValueForKeyPath: should always work as expected if different instances are indeed being returned by the convenience constructor. ___ 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
configurePersistentStoreCoordinatorForURL:ofType: modelConfiguration: storeOptions:error
According to the doco, the above method is used to customise creation of the persistent store especially with regards to the store type. So I've been using the below code, which works perfectly fine for NSBinaryStoreType and NSXMLStoreType, but with NSSQLiteStoreType I get lots of merge errors when saving documents that I don't get if I completely remove the below code and let the framework handle it. Apparently I'm doing something subtlety wrong. Does anyone know what? At times like this I wish Apple would make their source code visible to developers. - (BOOL)configurePersistentStoreCoordinatorForURL:(NSURL *)url ofType:(NSString *)fileType modelConfiguration:(NSString *)configuration storeOptions:(NSDictionary *)storeOptions error:(NSError **)error; { if(![[[selfmanagedObjectContext] persistentStoreCoordinator] addPersistentStoreWithType:NSSQLiteStoreTypeconfiguration:nilURL:url options:[NSDictionarydictionaryWithObjectsAndKeys:[NSNumbernumberWithBool:YES], NSMigratePersistentStoresAutomaticallyOption, [NSNumbernumberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil] error:error]){ [[NSApplicationsharedApplication] presentError:*error]; returnNO; } else { returnYES; } } ___ 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
core data could not merge changes
I've done a lot of core data development, but all using the XML file format. Now I'm trying to work with sqlite. I've got an app that was working, but when I change to sqllite I get errors. I've got a really basic application, nothing particularly special about it as far as I see, and when I change something and hit save, I get the sheet The document blah etc could not be saved. Could not merge changes.. The documentation talks about this happening with multiple managed object contexts, but I only have one, the default one created by the guts of core data document based infrastructure. I know NSManagedObjectContext has some methods to do with conflict resolving, but I'm reluctant to go to those until I understand what is going on and if I'm doing something wrong. Has anyone got any advice? ___ 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
accessing core data sqlite from utility
I've got a core data database in sqlite format, and I thought I'd download a utility to look inside it. But I've downloaded about 4 utilities that purport to be able to open sqlite databases and none of them can open it, they give errors along the lines of it being encrypted and needing a password. Can anyone enlighten me about the situation? ___ 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: accessing core data sqlite from utility
OK, my stupidity, I was looking at a NSBinaryStoreType and not sqlite. Next question: is there any utility for looking inside a NSBinaryStoreType? - Original Message From: Jens Alfke j...@mooseyard.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 25 June, 2010 10:35:10 AM Subject: Re: accessing core data sqlite from utility On Jun 24, 2010, at 5:02 PM, Chris Idou wrote: I've got a core data database in sqlite format, and I thought I'd download a utility to look inside it. But I've downloaded about 4 utilities that purport to be able to open sqlite databases and none of them can open it, they give errors along the lines of it being encrypted and needing a password. Can anyone enlighten me about the situation? Umm … that’s weird. I thought they were just regular sqlite databases. I’m pretty certain they’re not encrypted, as encryption isn’t supported in the version of sqlite built into the OS. Try using the command-line tool. Enter “sqlite3 /path/to/file”, then at the prompt type “pragma integrity_check;” including the semicolon at the end. If that doesn’t give errors, try entering “.schema” (without a semicolon!) to check the db schema, or your favorite SQL command. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Notification of window visible?
Is it? Can't a window become visible without becoming key? - Original Message From: Reinhard Segeler macmeid...@googlemail.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 4 June, 2010 4:18:03 PM Subject: Re: Notification of window visible? The notification NSWindowDidBecomeKeyNotification will do it for you. -- Reinhard Am 04.06.2010 um 07:11 schrieb Chris Idou: How does one get notification that a window has become visible? I can see notifications for most every type of window event except this most obvious one. ___ 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/macmeideln%40googlemail.com This email sent to macmeid...@googlemail.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
Notification of window visible?
How does one get notification that a window has become visible? I can see notifications for most every type of window event except this most obvious one. ___ 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: Stealing settings from Mail.app
Hi, I personally use smtp.me.com as my server, so I think you need to add that. As far as I see, [@macdonald.org rangeOfString:@mac].location would be a wrong match. I think you need to look for [hostName hasSuffix:@.me.com] || [hostName hasSuffix:@.mac.com] Right now I'm using http://github.com/tcurdt/edmessage to send mails. Does your framework have any benefits over that one? - Original Message From: Dante Palacios palacios.da...@gmail.com To: Chris idou...@yahoo.com Sent: Tue, 1 June, 2010 1:38:04 PM Subject: Re: Stealing settings from Mail.app Hi Chris, There's no bug in the code, so far as I know (I can be wrong), the smtp server for a MobileMe account remains smtp.mac.com. The userName must be the user name only E.g with John Doe j...@mac.com or John Doe j...@me.com as the full email address, would be jdoe and the hostName would be smtp.mac.com I made a small framework (free and open source) for sending emails that do what you want to do and a little more... https://code.google.com/p/maildelivery On May 31, 2010, at 8:35 PM, Chris wrote: Thanks, it was the iTools bit I needed. But looks like there is a bug in this code it won't notice me.com and could wrongly think say macdonald.com is mobile me. But thanks, it gives me what I needed. -- Chris On 31/05/2010, at 8:11 PM, Dante Palacios palacios.da...@gmail.com wrote: NSString *GetPassword(NSString *userName, NSString *hostName) { if (!hostName.length || !userName.length) return nil; const char *serviceName = [hostName UTF8String]; const char *serviceUserName = [userName UTF8String]; const char *path = ; UInt32 passwordLength = 0; char *pass = nil; OSStatus status = noErr; SecKeychainItemRef itemRef; if ([hostName rangeOfString:@mac].location != NSNotFound) { serviceName = iTools; //= note this status = SecKeychainFindGenericPassword(NULL, (UInt32)strlen(serviceName), serviceName, (UInt32)strlen(serviceUserName), serviceUserName, passwordLength, (void **)pass, itemRef); }else { status = SecKeychainFindInternetPassword(NULL, (UInt32)strlen(serviceName), serviceName, 0, NULL, (UInt32)strlen(serviceUserName), serviceUserName, (UInt32)strlen(path), path, 0, kSecAuthenticationTypeAny, kSecAuthenticationTypeAny, passwordLength, (void **)pass, itemRef); } if (status != noErr) { CFStringRef errMess = SecCopyErrorMessageString(status, NULL); NSLog(@%@, (NSString *)errMess); CFRelease(errMess); return nil; } return [[[NSString alloc] initWithBytes:pass length:passwordLength encoding:NSUTF8StringEncoding] autorelease]; } On May 31, 2010, at 12:11 AM, Jn wrote: Would you have the API code to retrieve it? Not sure what to pass to get the mobile me password. -- Chris On 31/05/2010, at 2:43 AM, Jens Alfke j...@mooseyard.com wrote: On May 30, 2010, at 12:55 AM, Chris Idou wrote: OK, I see. So is Mobile-Me the only special case, or is there a more general rule about other places to find smtp server passwords? AFAIK it’s the only special case. In general, an SMTP server’s password is stored under that server name in the keychain, as you’d expect. —Jens ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/palacios.dante%40gmail.com This email sent to palacios.da...@gmail.com All the best, Dante. All the best, Dante. ___ 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
Re: Stealing settings from Mail.app
BTW, what exactly are the downsides of sending the mail to local machine sendmail? ___ 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: Stealing settings from Mail.app
OK, I see. So is Mobile-Me the only special case, or is there a more general rule about other places to find smtp server passwords? - Original Message From: Greg Guerin glgue...@amug.org To: list-cocoa-dev cocoa-dev@lists.apple.com Sent: Sat, 29 May, 2010 2:37:30 AM Subject: Re: Stealing settings from Mail.app Chris Idou wrote: I've got an app that needs to send out emails. I'm trying to import mail settings from Mail.app. For some reason my keychain has passwords for smtp.gmail.com, but not for smtp.me.com. AFAIK, there is only the one MobileMe password for all uses. Double-click your MobileMe password in Keychain Access.app and look at its Access Control tab. Note that Mail.app is always granted access by default. -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.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
Stealing settings from Mail.app
I've got an app that needs to send out emails. I'm trying to import mail settings from Mail.app. For some reason my keychain has passwords for smtp.gmail.com, but not for smtp.me.com. Does anyone know where Mail.app stores other passwords? Or why my keychain has smtp.gmail.com passwords, but not passwords for other smtp servers I have setup in Mail.app? ___ 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
NSTableView delete row with key?
What would be the appropriate way to have an NSTableView notice that you hit the delete key and delete the current row? ___ 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
NSTableView Key Value Observing performance pickle
I seem to have got myself into some pickle with key value observing whereby things to do with NSTableView are freezing up for minutes at a time. Every time I pause the program there are things to do with adding and removing observers, but all of it is in Apple's code, so I'm not quite sure what I've done to cause this problem. #00x7fff8453d06b in append_referrer_no_lock #10x7fff8453ea58 in weak_register #20x7fff845366e2 in auto_assign_weak_reference #30x7fff81d6a36e in -[NSConcretePointerArray arrayGrow:] #40x7fff81c64cdd in -[NSConcretePointerArray addPointer:] #50x7fff81c6aa99 in -[NSKeyValueObservationInfo _initWithObservances:count:] #60x7fff81c70399 in _NSKeyValueObservationInfoCreateByRemoving #70x7fff81c6fcfe in -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] #80x7fff81c6fc3f in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] #90x7fff81c70522 in -[NSKeyValueNestedProperty object:didRemoveObservance:recurse:] #100x7fff81c7077f in -[NSKeyValueUnnestedProperty object:didRemoveObservance:recurse:] #110x7fff81c6fd5b in -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] #120x7fff81c6fc3f in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] #130x7fff81c70522 in -[NSKeyValueNestedProperty object:didRemoveObservance:recurse:] #140x7fff81c7077f in -[NSKeyValueUnnestedProperty object:didRemoveObservance:recurse:] #150x7fff81c6fd5b in -[NSObject(NSKeyValueObserverRegistration) _removeObserver:forProperty:] #160x7fff81c6fc3f in -[NSObject(NSKeyValueObserverRegistration) removeObserver:forKeyPath:] #170x7fff810e23c7 in -[_NSModelObservingTracker _registerOrUnregister:observerNotificationsForModelObject:] #180x7fff810e1a07 in -[_NSModelObservingTracker clearAllModelObjectObserving] #190x7fff811bc4b3 in -[_NSModelObservingTracker setIndexReferenceModelObjectArray:clearAllModelObjectObserving:] #200x7fff811bc44c in -[NSArrayController _setObjects:] #210x7fff81255d9f in -[NSArrayController _arrangeObjectsWithSelectedObjects:avoidsEmptySelection:operationsMask:useBasis:] #220x7fff811bc9ff in -[NSArrayController setContent:] #240x7fff8125ad66 in -[NSArrayDetailBinder _refreshDetailContentInBackground:] #250x7fff81c791a1 in -[NSObject(NSKeyValueObservingPrivate) _notifyObserversForKeyPath:change:] #260x7fff810de96e in -[NSController _notifyObserversForKeyPath:change:] #270x7fff811e8575 in -[NSArrayController didChangeValuesForArrangedKeys:objectKeys:indexKeys:] #280x7fff811e894b in -[NSArrayController _selectObjectsAtIndexesNoCopy:avoidsEmptySelection:sendObserverNotifications:forceUpdate:] #290x7fff81c6f43d in -[NSObject(NSKeyValueCoding) setValue:forKey:] #300x7fff81ccdf42 in -[NSObject(NSKeyValueCoding) setValue:forKeyPath:] #310x7fff8126a3ed in -[NSBinder _setValue:forKeyPath:ofObject:mode:validateImmediately:raisesForNotApplicableKeys:error:] #320x7fff8126a2a5 in -[NSBinder setValue:forBinding:error:] #330x7fff812655c8 in -[NSTableBinder tableView:didChangeToSelectedRowIndexes:] #340x7fff81261e8f in -[_NSBindingAdaptor tableView:didChangeToSelectedRowIndexes:] #350x7fff811368e2 in -[NSTableView _enableSelectionPostingAndPost] #360x7fff811f8556 in -[NSTableView mouseDown:] #370x7fff81199f1b in -[NSWindow sendEvent:] #380x7fff810cf662 in -[NSApplication sendEvent:] ___ 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
Reordered columns and [tableView editColumn:0 row:ind withEvent:nil select:YES];
I've got some code that uses editColumn:0 to force the user into edit mode on the first column. But I've noticed that if user column reordering is allowed, this no longer edits the correct column. This seems odd to me because I thought Cocoa pretty much shielded the programmer from all the user reordering stuff. Even more oddly, if the user puts a checkbox as the first column, the checkbox seems to start behaving like a text box, albeit with invisible characters. Could I be doing something wrong, or is this some kind of bug? And do I have to somehow translate column 0 to find out the real column? I know Java tables have methods to translate between model and view column numbers because of user reordering, but I haven't noticed such a thing 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
Tricky binding and continuous update problem
I've got a problem that I had working, but my app suddenly seems broken, and I'm not sure if I did something or what. All I know is old versions of my app work, but now my code base doesn't. I've got a UI with a NSTableView at the top, and some individual fields at the bottom. Typical UI where you click on a table row and it shows you the values in the fields. Now one of the fields shown in the table is a derived value from the base fields. I have continuous update values set in the NSTextField at the bottom. So what I expect as you type in the field, the value in the table gets continuously updated also. (I'm using keyPathsForValuesAffecting etc for the derived field). But what's happening is if I type in the lower field, the value gets sent to the derived field in the table, but then Text field gets immediately set back to the original value. So the effect is you type one character and it is lost as far as the lower field is concerned, but the derived value in the table is updated. You can only ever change one character. And also the lower text field loses focus. I've put break points in all the setters and getters, and there seems like no reason for this odd behavior. I can't see how the field would get set back to the old value. If I turn off Continuously Update Value, it works sensibly, albeit not as nice since you've got to exit the field to have everything in synch. Any thoughts? ___ 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: Tricky binding and continuous update problem
I am using an NSArrayController. I don't know, it seems to me like having everything always in synch is nicer. The user can see immediately how changing one field is affecting the other. And it used to work. - Original Message From: Jerry Krinock je...@ieee.org To: Chris Idou idou...@yahoo.com Sent: Wed, 7 April, 2010 10:24:18 AM Subject: Re: Tricky binding and continuous update problem On 2010 Apr 06, at 16:36, Chris Idou wrote: If I turn off Continuously Update Value, it works sensibly, Turn it off. Look at any of Apple's Sample Code. Also, Cocoa Design Rule #1: If something is off/on by default, don't change it unless you're knowingly doing something weird. albeit not as nice since you've got to exit the field to have everything in synch. That's the way most apps work. You did not mention using an array controller. To insure data integrity in case user tabs out, abruptly closes the window, etc., do not bind directly to the model. Instead, bind your text fields (detail views) to an NSArrayController to which the table columns are also bound. As a matter of fact, if you didn't use an array controller, you'd better look at Apple's DepartmentAndEmployees sample code and be prepared for a little re-work. There may be a way to make your design paradigm work, but why bother? The way I understand it, the NSArrayController superclass NSObjectController fulfills the same purpose of data integrity if you can't bind to an array controller, for example if you have an Inspector in another nib. NSObjectController seems like a heavy weight for this purpose, but it works. For an example of this, in DepartmentAndEmployees's MyDocument.nib, look at the NSObjectController named 'Department Controller'. It seems like it's useless but it's not. Probably someone else can give a more in-depth explanation. ___ 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: Tricky binding and continuous update problem
How does it wreak havoc with undo? Undo seems to work still. In something like TextExpander, you change the textfield where your expansion goes, and the table in the left hand side changes as you type. That's what I was aiming for. But I've found why it suddenly stopped working. I stumbled upon the URL below. Apparently the Automatically rearrange content for the NSArrayController makes this all go awry. It seems like I can choose between auto rearrange content, or continuously update values, but not both. Don't know if this is a bug or if there is some reason for it. http://stackoverflow.com/questions/1028700/core-data-strange-bindings-error-on-re-opening-a-document-help - Original Message From: Kyle Sluder kyle.slu...@gmail.com To: Chris Idou idou...@yahoo.com Cc: Jerry Krinock je...@ieee.org; cocoa-dev@lists.apple.com Sent: Wed, 7 April, 2010 11:21:28 AM Subject: Re: Tricky binding and continuous update problem On Tue, Apr 6, 2010 at 5:28 PM, Chris Idou idou...@yahoo.com wrote: I don't know, it seems to me like having everything always in synch is nicer. The user can see immediately how changing one field is affecting the other. And it used to work. That will wreak havoc with Undo. Continuously updating values is not pretty, and it's not how text fields behave on the Mac. Rich text does behave as you describe, but you can't use bindings for that. Avoid fighting the framework. ;-) --Kyle Sluder ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
SetFrontProcessWithOptions and NSPanel
I've got a NSPanel HUD that I need to be able to pop up above other applications, but I need to pop only the HUD, and not other windows in my application. So naturally I'm using: SetFrontProcessWithOptions(psn, kSetFrontProcessFrontWindowOnly); However, it still pops up all my windows, and not just the HUD panel. I notice this doesn't happen when it is a regular window. I notice the documentation says that kSetFrontProcessFrontWindowOnly only works for non-floating windows so I've set on the window: [self.windowsetLevel:NSNormalWindowLevel]; and: [(NSPanel *)self.window setFloatingPanel:NO]; But to no avail. Can anybody help? __ Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free at PLUS7. www.tv.yahoo.com.au/plus7 ___ 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
FSEventStreamCreate and File System Events Wierdness
I'm trying to use the file system events api, but what I'm seeing seems wierd. Firstly, the documentation as I read it says you can store the last event id, and pass that to FSEventStreamCreate next time to carry on where you left off. However what I'm seeing if I do that, is it immediately resends me that event. So lets say I process event 877921818. I store that and exit the program. Next time I pass 877921818 to FSEventStreamCreate and I immediately get another callback with event id 877921818, so I end up processing it again. So I'm thinking to myself, maybe what it really wants is the lastevent+1. So I pass 877921819 to FSEventStreamCreate instead. But then what happens is I immediately get a callback with event 877921819. This despite that nothing has changed. (I'm actually monitoring an empty folder, and nothing is changing, not even so much as timestamps or anything). If I pass lastEvent+10 I immediately get a callback with that id, even though nothing has changed. Interestingly, if I monitor multiple folders, it seems to only callback with whichever one is passed in first. It seems like if you pass an explicit event id into FSEventStreamCreate in absolutely insists on giving you an immediate callback that something changed with whichever is the first folder in the list, even though in fact nothing has changed. It seems to be broken in a major way, but its hard to believe something like is is *that* broken. Any comments? OS-X 10.6.2 __ Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free at PLUS7. www.tv.yahoo.com.au/plus7 ___ 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: FSEventStreamCreate and File System Events Wierdness
Firstly, I don't think that actually makes sense, given the whole point of the lastEventId. Secondly, it only does it for the first folder you pass in, so it isn't even consistent. But yes I guess one could compare and ignore. From: Graham Cox graham@bigpond.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 29 January, 2010 11:27:31 PM Subject: Re: FSEventStreamCreate and File System Events Wierdness Well, I have no experience of this API, but perhaps it's designed to do this so that when you restart a stream, you get an event that gives you a snapshot or starting point for the new session. Seems to me it would be trivial to compare the event ID and if it's the one you just passed in, ignore it. --Graham On 29/01/2010, at 11:22 PM, Chris Idou wrote: I'm trying to use the file system events api, but what I'm seeing seems wierd. Firstly, the documentation as I read it says you can store the last event id, and pass that to FSEventStreamCreate next time to carry on where you left off. However what I'm seeing if I do that, is it immediately resends me that event. So lets say I process event 877921818. I store that and exit the program. Next time I pass 877921818 to FSEventStreamCreate and I immediately get another callback with event id 877921818, so I end up processing it again. So I'm thinking to myself, maybe what it really wants is the lastevent+1. So I pass 877921819 to FSEventStreamCreate instead. But then what happens is I immediately get a callback with event 877921819. This despite that nothing has changed. (I'm actually monitoring an empty folder, and nothing is changing, not even so much as timestamps or anything). If I pass lastEvent+10 I immediately get a callback with that id, even though nothing has changed. Interestingly, if I monitor multiple folders, it seems to only callback with whichever one is passed in first. It seems like if you pass an explicit event id into FSEventStreamCreate in absolutely insists on giving you an immediate callback that something changed with whichever is the first folder in the list, even though in fact nothing has changed. It seems to be broken in a major way, but its hard to believe something like is is *that* broken. Any comments? __ Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free at PLUS7. www.tv.yahoo.com.au/plus7 ___ 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: FSEventStreamCreate and File System Events Wierdness
No, I'm not using FSEventStreamCreateRelativeToDevice, I'm using FSEventStreamCreate. What you quote is only relevant to FSEventStreamCreateRelativeToDevice. From: Graham Cox graham@bigpond.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 29 January, 2010 11:33:40 PM Subject: Re: FSEventStreamCreate and File System Events Wierdness I also note this in the documentation: FSEventStreamGetLatestEventId() - Initially, this returns the sinceWhen value supplied when the stream was created; thereafter, it is updated with the highest-numbered event ID mentioned in the current batch of events just before invoking the client's callback. Clients can store this value persistently as long as they also store the UUID for the device (obtained via FSEventsCopyUUIDForDevice()). Clients can then later supply this event ID as the sinceWhen parameter to FSEventStreamCreateRelativeToDevice(), as long as its UUID matches what you stored. This works because the FSEvents service stores events in a persistent, per-volume database. In this regard,the stream of event IDs acts like a global, system-wide clock, but bears no relation to any particular timebase. So, are you also storing the UUID and using FSEventStreamCreateRelativeToDevice? Sounds like you're not. --Graham On 29/01/2010, at 11:22 PM, Chris Idou wrote: Firstly, the documentation as I read it says you can store the last event id, and pass that to FSEventStreamCreate next time to carry on where you left off. However what I'm seeing if I do that, is it immediately resends me that event. So lets say I process event 877921818. I store that and exit the program. Next time I pass 877921818 to FSEventStreamCreate and I immediately get another callback with event id 877921818, so I end up processing it again. __ Yahoo!7: Catch-up on your favourite Channel 7 TV shows easily, legally, and for free at PLUS7. www.tv.yahoo.com.au/plus7 ___ 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: Confused about setting selection in NSBrowser
Yes, I'm doing 10.6. But I don't see anything about item based in NSBrowser.h, nor anything else that looks enlightening. From: Corbin Dunn corb...@apple.com To: Keary Suska cocoa-...@esoteritech.com Cc: Chris Idou idou...@yahoo.com; cocoa-dev@lists.apple.com Sent: Sat, 16 January, 2010 3:17:00 AM Subject: Re: Confused about setting selection in NSBrowser On Jan 15, 2010, at 8:07 AM, Keary Suska wrote: On Jan 14, 2010, at 9:56 PM, Chris Idou wrote: I'm trying to set the selected item in an NSBrowser. I don't want to use setPath: because the items I'm storing in the browser are not unique, so therefore paths are not unique. I'm trying to use setIndexPath: but when I try the program throws an exception: HIToolbox: ignoring exception 'setSelectionIndexPath: is not supported for browsers with matrix delegates.' that raised inside Carbon event dispatch ( 0 CoreFoundation 0x7fff80322444 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x7fff8055d0f3 objc_exception_throw + 45 2 AppKit 0x7fff8378e252 -[NSBrowser setSelectionIndexPath:] + 128 I don't understand what this exception means. Are you building against 10.6 SDK? Chris must be, otherwise he would have warnings. Chris -- read up about the item based browser in the NSBrowser.h header. corbin __ See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/ ___ 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
Confused about setting selection in NSBrowser
I'm trying to set the selected item in an NSBrowser. I don't want to use setPath: because the items I'm storing in the browser are not unique, so therefore paths are not unique. I'm trying to use setIndexPath: but when I try the program throws an exception: HIToolbox: ignoring exception 'setSelectionIndexPath: is not supported for browsers with matrix delegates.' that raised inside Carbon event dispatch ( 0 CoreFoundation 0x7fff80322444 __exceptionPreprocess + 180 1 libobjc.A.dylib 0x7fff8055d0f3 objc_exception_throw + 45 2 AppKit 0x7fff8378e252 -[NSBrowser setSelectionIndexPath:] + 128 I don't understand what this exception means. __ See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/ ___ 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: Time to drop PowerPC support?
Another factor to consider is that you will need to maintain PowerPC hardware to test on. --Kyle Sluder I had a 50,000 line Cocoa program, and I thought about restricting it to Intel for that reason, but then I thought heck, I'll build it universal and throw it out there. Not a single bug reported due to PPC, and a few happy customers for my trouble. I don't see the point in dropping PPC support, unless you have special issues. __ See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/ ___ 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
NSSpellChecker language guessing doesn't work
I'm trying to use guessesForWordRange:inString:language:inSpellDocumentWithTag: and have it use automatic language guessing, but it doesn't seem to work. At first I was just passing a word, and despite it being in Russian letters, I figured it didn't have enough context to guess. So I passed in a large document with the range of the word I want checked. But this didn't work either. So then I thought, maybe this API isn't one that guesses. So I tried calling checkSpellingOfString:startingAt:language:wrap:inSpellDocumentWithTag:wordCount: immediately prior with a unique tag the same as what I pass to guessesForWordRange:inString:language:inSpellDocumentWithTag. But this didn't help at all either. How can I force the spell checking to guess languages? __ See what's on at the movies in your area. Find out now: http://au.movies.yahoo.com/session-times/ ___ 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
core data and migration
If I have versions of my model, A, B and C, do I only need a mapping model from A-B and B-C, and if someone wants to upgrade A-C is core data smart enough to do the two migrations, or do I need a separate mapping model from A-C ? __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: tiffs on pasteboard
I thought the solution to big files was to use pasteboard promises... not to setup a pasteboard which is conflicted about what item it is trying to store. At least that's what I find documented by Apple. From: Alexander Spohr a...@freeport.de To: Chris Idou idou...@yahoo.com Cc: Jens Alfke j...@mooseyard.com; cocoa-dev@lists.apple.com Sent: Fri, 20 November, 2009 7:00:18 PM Subject: Re: tiffs on pasteboard Am 20.11.2009 um 03:04 schrieb Chris Idou: But what are the rules and conventions? Why would Finder put the icon in the pasteboard on the assumption that is what the user wants, but TextEdit would paste in the actual file on the assumption that is what the user wants? It seems schizophrenic. Yeah. Copying a 20MB image to the pasteboard would be what the user wants. Or better one Gig of video. I think not. You think like a user (who would assume that the file is really on the pasteboard) and not like a developer (who should know that the pasteboard content has to be lightweight). I just want a list of rules of how to use the Pasteboard in a way that conforms to what users expect. If I start ignoring the TIFF part of the pasteboard in favor of the URL on the assumption that is what the user wants, why is the tiff there anyway? The TIFF is a preview. The URL is the meat. And will that get me into trouble in other cases? That depends only on the pasteboard provider. There is no strict rule. The provider does not know the recipient and therefore puts everything on the pasteboard that will satisfy the task the provider offers. atze __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: asl_log aborts the program?
I just noticed something I didn't see before, namely that the doco says to call asl_open once for each thread, which I'm not doing. I guess this most likely is the cause. From: Jeremy Pereira a...@jeremyp.net To: Chris Idou idou...@yahoo.com; Cocoa Forum cocoa-dev@lists.apple.com Cc: Jeremy Pereira a...@jeremyp.net Sent: Fri, 20 November, 2009 9:35:01 PM Subject: Re: asl_log aborts the program? On 20 Nov 2009, at 06:33, Chris Idou wrote: I've got a report from a user of my program crashing. In the console they are getting this: 11/19/09 3:08:46 PM[0x0-0x18a18a]Progname[8699]Progname(8699,0x1167b) malloc: *** error for object 0x100563870: pointer being freed was not allocated 11/19/09 3:08:46 PM[0x0-0x18a18a] Progname[8699]*** set a breakpoint in malloc_error_break to debug Thread 2 Crashed: 0 libSystem.B.dylib 0x7fff87a7784d usleep$NOCANCEL + 0 1 libSystem.B.dylib 0x7fff87a96e3c abort + 93 2 libSystem.B.dylib 0x7fff879ae155 free + 128 3 libSystem.B.dylib 0x7fff879fa16e asl_set_query + 572 4 libSystem.B.dylib 0x7fff87a16239 asl_send + 824 5 libSystem.B.dylib 0x7fff87a15e56 asl_vlog + 570 6 libSystem.B.dylib 0x7fff87a15c19 asl_log + 153 7 Progname.CocoaTools0x000104567101 -[Log vlogLevel:format:arguments:] + 270 8 Progname.CocoaTools0x00010456730c -[Log notice:] + 164 etc Does this look like an Apple bug? It looks to me like the asl subsystem is freeing something it shouldn't and aborting the program. Normally when I see crashes involving calls to methods with format strings, I immediately assume that the arguments following the the format string do not match the format specifiers in the format string. e.g. if -[Log notice:] is declared like this -(void) notice: (NSString*) format, ...; [log notice: @blah blah blah %@ %s, blah]; The above line has an NSObject missing from its argument list. There's also [log notice: someNSStringofIndeterminateOrigin]; which may crash if the string contains format specifiers e.g. if it is a URL with % escapes in it. So you probably want to check your calls to -[Log notice:]. __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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/adc%40jeremyp.net This email sent to a...@jeremyp.net __ This email has been scanned by the MessageLabs Email Security System. For more information please visit http://www.messagelabs.com/email __ __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: tiffs on pasteboard
Well... now that in 10.6 the pasteboard types are UTI types, I'm not sure that one can say anymore that there is no mapping from files to pasteboard types. And 10.6 Finder puts a public.tiff into the pasteboard in this case, but I would argue it is the wrong tiff. On Nov 20, 2009, at 1:35 AM, Chris Idou wrote: I thought the solution to big files was to use pasteboard promises... not to setup a pasteboard which is conflicted about what item it is trying to store. At least that's what I find documented by Apple. You're correct that promises would overcome some of the inefficiencies (although I can envision other situations where the size would be a problem.) I suspect the real reason is that there isn't a straightforward mapping between file types and pasteboard types. There is not in general any table that says a file with extension .foo contains data that can be stored in a pasteboard using type 'FooPasteboardType'; so the Finder would not be able to decide in all cases what pasteboard type to use for the contents of the dragged/copied file.* You could argue that images are a useful special case; but I suspect that the engineers responsible decided that it was better to remain consistent.. (And actually, it doesn't even work for all image types. The old Mac 'PICT' format is infamous for having a slightly different representation in memory than in a file, so you can't just slurp a PICT file into the pasteboard and have it be useable.) —Jens * Especially for package file types that are actually directories; would the rule be to create a Zip archive? :-P __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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
Advice about crash requested
I've got a user getting the following crash, and I don't know what to make of it because it all happens in Apple code. Has anyone got any advice? Process: XXX [242] Path:/Applications/XXX.app/Contents/MacOS/XXX Identifier: XXX Version: 1.19 (19) Code Type: X86-64 (Native) Parent Process: launchd [180] Date/Time: 2009-11-15 23:34:52.052 -0500 OS Version: Mac OS X 10.6.2 (10C540) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x000b Crashed Thread: 0 Dispatch queue: com.apple.main-thread Application Specific Information: objc_msgSend() selector name: invalidate NSTextAttachmentImageView objc[242]: garbage collection is ON Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x7fff85a4210a objc_msgSend + 22 1 com.apple.AppKit 0x7fff8169871e -[NSImageCell(NSPrivateAnimationSupport) _stopAnimation] + 43 2 com.apple.AppKit 0x7fff819b60c2 -[NSImageView finalize] + 26 3 libobjc.A.dylib 0x7fff85a48f67 finalizeOneObject + 48 4 libauto.dylib 0x7fff85b113d5 Auto::foreach_block_do(auto_zone_cursor*, void (*)(void*, void*), void*) + 85 5 libobjc.A.dylib 0x7fff85a48b5c batchFinalize + 64 6 libobjc.A.dylib 0x7fff85a48e00 batchFinalizeOnMainThread + 87 7 libSystem.B.dylib 0x7fff879e3ce8 _dispatch_call_block_and_release + 15 8 libSystem.B.dylib 0x7fff879c287a _dispatch_queue_drain + 251 9 libSystem.B.dylib 0x7fff879c3127 _dispatch_queue_serial_drain_till_empty + 9 10 libSystem.B.dylib 0x7fff879f5e4c _dispatch_main_queue_callback_4CF + 37 11 com.apple.CoreFoundation 0x7fff86c99b00 __CFRunLoopRun + 2560 12 com.apple.CoreFoundation 0x7fff86c98c2f CFRunLoopRunSpecific + 575 13 com.apple.HIToolbox 0x7fff865b9a4e RunCurrentEventLoopInMode + 333 14 com.apple.HIToolbox 0x7fff865b9853 ReceiveNextEventCommon + 310 15 com.apple.HIToolbox 0x7fff865b970c BlockUntilNextEventMatchingListInMode + 59 16 com.apple.AppKit 0x7fff815f31f2 _DPSNextEvent + 708 17 com.apple.AppKit 0x7fff815f2b41 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155 18 com.apple.AppKit 0x7fff815b8747 -[NSApplication run] + 395 19 XXX 0x00010eea main + 76 20 XXX 0x00010e7c start + 52 Thread 1: Dispatch queue: com.apple.libdispatch-manager 0 libSystem.B.dylib 0x7fff879c0bba kevent + 10 1 libSystem.B.dylib 0x7fff879c2a85 _dispatch_mgr_invoke + 154 2 libSystem.B.dylib 0x7fff879c275c _dispatch_queue_invoke + 185 3 libSystem.B.dylib 0x7fff879c2286 _dispatch_worker_thread2 + 244 4 libSystem.B.dylib 0x7fff879c1bb8 _pthread_wqthread + 353 5 libSystem.B.dylib 0x7fff879c1a55 start_wqthread + 13 Thread 2: 0 libSystem.B.dylib 0x7fff879a7e3a mach_msg_trap + 10 1 libSystem.B.dylib 0x7fff879a84ad mach_msg + 59 2 com.apple.CoreFoundation 0x7fff86c997a2 __CFRunLoopRun + 1698 3 com.apple.CoreFoundation 0x7fff86c98c2f CFRunLoopRunSpecific + 575 4 com.apple.Foundation 0x7fff82021a24 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 270 5 au.com.tech.CocoaTools0x000101f152af -[InfiniteThread main] + 171 6 AutoFilerPlugin 0x00010352040c -[FilerExecutor main] + 72 7 com.apple.Foundation 0x7fff81fe6e99 __NSThread__main__ + 1429 8 libSystem.B.dylib 0x7fff879e0f8e _pthread_start + 331 9 libSystem.B.dylib 0x7fff879e0e41 thread_start + 13 Thread 3: Dispatch queue: Garbage Collection Work Queue 0 libSystem.B.dylib 0x7fff879e29ee __semwait_signal + 10 1 libSystem.B.dylib 0x7fff879e67f1 _pthread_cond_wait + 1286 2 libobjc.A.dylib 0x7fff85a48cd8 batchFinalizeOnTwoThreads + 250 3 libauto.dylib 0x7fff85b0b1e7 Auto::Zone::invalidate_garbage(unsigned long, unsigned long const*) + 71 4 libauto.dylib 0x7fff85afbbd1 auto_collect_internal(Auto::Zone*, unsigned int) + 481 5 libauto.dylib 0x7fff85afc16d auto_collection_work(Auto::Zone*) + 157 6 libSystem.B.dylib 0x7fff879e3ce8 _dispatch_call_block_and_release + 15 7 libSystem.B.dylib 0x7fff879c287a _dispatch_queue_drain + 251 8 libSystem.B.dylib 0x7fff879c26dc _dispatch_queue_invoke + 57 9 libSystem.B.dylib 0x7fff879c2286 _dispatch_worker_thread2 + 244 10 libSystem.B.dylib 0x7fff879c1bb8 _pthread_wqthread + 353 11
tiffs on pasteboard
I'm trying to read a TIFF off the pasteboard, but it doesn't seem to work for me. What I'm doing is going into Finder, finding a TIFF file and Command-C it. Among other types I then find on the pasteboard are: NeXT TIFF v4.0 pasteboard type and public.tiff If I take either of those from the pasteboard and write the NSData object to a file: [content writeToFile:@/tmp/foo.tiffatomically:YES]; or else if I make an NSImage from the data: [[NSImagealloc] initWithData:content] and display it in an NSImageView then I always see the generic TIFF icon, i.e. the one with a photo of a child scattered on the table, with a loupe on top of it. The same thing happens for JPEGs, GIFS and PNGs, but not for com.apple.icns. If I take the com.apple.icns, it displays correctly. What am I doing wrong? __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: Advice about crash requested
Mainly stuff to do with examining files, and on the odd occasion it needs to do anything in the GUI it executes it on the main thread. From: David Duncan david.dun...@apple.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 20 November, 2009 11:21:58 AM Subject: Re: Advice about crash requested On Nov 19, 2009, at 4:18 PM, Chris Idou wrote: I've got a user getting the following crash, and I don't know what to make of it because it all happens in Apple code. Has anyone got any advice? What are you doing on Thread 2 ([FilerExecutor main])? -- David Duncan Apple DTS Animation and Printing __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: tiffs on pasteboard
I notice that at least com.apple.icns works when I copy it from Preview, but it doesn't work when just copying from Finder. But either way TextEdit seems to be able to get the right thing if I paste into it. From: Chris Idou idou...@yahoo.com To: Kyle Sluder kyle.slu...@gmail.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 20 November, 2009 11:43:17 AM Subject: Re: tiffs on pasteboard If I double click the tiff in Finder, and open it in Preview, click it in Preview, Command-A, Command-C, the same thing happens. From: Kyle Sluder kyle.slu...@gmail.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 20 November, 2009 11:36:54 AM Subject: Re: tiffs on pasteboard On Thu, Nov 19, 2009 at 4:33 PM, Chris Idou idou...@yahoo.com wrote: I'm trying to read a TIFF off the pasteboard, but it doesn't seem to work for me. What I'm doing is going into Finder, finding a TIFF file and Command-C it. You've copied the file icon. If you want to copy the file's data, you need to open it in Preview and copy that. --Kyle Sluder __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: Advice about crash requested
This will help if I'm ever able to repeat it. Right now its just a user report and I can't repeat it. From: Sean McBride s...@rogue-research.com To: Jens Alfke j...@mooseyard.com; Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Fri, 20 November, 2009 12:03:33 PM Subject: Re: Advice about crash requested On 11/19/09 4:54 PM, Jens Alfke said: On Nov 19, 2009, at 4:18 PM, Chris Idou wrote: Thread 0 Crashed: Dispatch queue: com.apple.main-thread 0 libobjc.A.dylib 0x7fff85a4210a objc_msgSend + 22 1 com.apple.AppKit 0x7fff8169871e -[NSImageCell (NSPrivateAnimationSupport) _stopAnimation] + 43 2 com.apple.AppKit 0x7fff819b60c2 -[NSImageView finalize] + 26 Looks like NSImageCell is calling a bogus object, probably one that's already been freed. That's sort of unusual for a GC'd app -- usually this indicates a ref-counting bug. You're not calling AppKit from a background thread, are you? Turning on NSZombieEnabled might help shed some light on this. It won't, because NSZombieEnabled does nothing in GC apps. :( There's a So, You've Crashed In objc_msgsend FAQ out there on teh interwebz somewhere that goes into more detail on troubleshooting. It's here: http://www.sealiesoftware.com/blog/archive/2008/09/22/ objc_explain_So_you_crashed_in_objc_msgSend.html -- Sean McBride, B. Engs...@rogue-research.com Rogue Researchwww.rogue-research.com Mac Software Developer Montréal, Québec, Canada __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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: tiffs on pasteboard
But what are the rules and conventions? Why would Finder put the icon in the pasteboard on the assumption that is what the user wants, but TextEdit would paste in the actual file on the assumption that is what the user wants? It seems schizophrenic. I just want a list of rules of how to use the Pasteboard in a way that conforms to what users expect. If I start ignoring the TIFF part of the pasteboard in favor of the URL on the assumption that is what the user wants, why is the tiff there anyway? And will that get me into trouble in other cases? From: Jens Alfke j...@mooseyard.com To: Chris Idou idou...@yahoo.com Cc: Kyle Sluder kyle.slu...@gmail.com; cocoa-dev@lists.apple.com Sent: Fri, 20 November, 2009 12:29:51 PM Subject: Re: tiffs on pasteboard On Nov 19, 2009, at 5:24 PM, Chris Idou wrote: But I'm still confused about one thing: If copying from Finder actually copies the file icon, and not the actual tiff, how come it pastes ok into TextEdit? The Finder also puts the location of the file on the pasteboard, and I believe TextEdit sees that, recognizes that it's an image file, and reads the file into an image. You can do the same fairly easily. —Jens __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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
asl_log aborts the program?
I've got a report from a user of my program crashing. In the console they are getting this: 11/19/09 3:08:46 PM[0x0-0x18a18a]Progname[8699]Progname(8699,0x1167b) malloc: *** error for object 0x100563870: pointer being freed was not allocated 11/19/09 3:08:46 PM[0x0-0x18a18a] Progname[8699]*** set a breakpoint in malloc_error_break to debug And in the crash report: Process: Progname [11128] Path:/Applications/Progname.app/Contents/MacOS/Progname Identifier: Progname Version: 1.19 (19) Code Type: X86-64 (Native) Parent Process: launchd [180] Date/Time: 2009-11-19 17:40:42.570 -0500 OS Version: Mac OS X 10.6.2 (10C540) Report Version: 6 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x, 0x Crashed Thread: 2 Application Specific Information: abort() called objc[11128]: garbage collection is ON Thread 0: Dispatch queue: com.apple.main-thread 0 libSystem.B.dylib 0x7fff879a7e3a mach_msg_trap + 10 1 libSystem.B.dylib 0x7fff879a84ad mach_msg + 59 2 com.apple.CoreFoundation 0x7fff86c997a2 __CFRunLoopRun + 1698 3 com.apple.CoreFoundation 0x7fff86c98c2f CFRunLoopRunSpecific + 575 4 com.apple.HIToolbox 0x7fff865b9a4e RunCurrentEventLoopInMode + 333 5 com.apple.HIToolbox 0x7fff865b9853 ReceiveNextEventCommon + 310 6 com.apple.HIToolbox 0x7fff865b970c BlockUntilNextEventMatchingListInMode + 59 7 com.apple.AppKit 0x7fff815f31f2 _DPSNextEvent + 708 8 com.apple.AppKit 0x7fff815f2b41 -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] + 155 9 com.apple.AppKit 0x7fff815b8747 -[NSApplication run] + 395 10 Progname 0x00010eea main + 76 11 Progname 0x00010e7c start + 52 Thread 1: Dispatch queue: com.apple.libdispatch-manager 0 libSystem.B.dylib 0x7fff879c0bba kevent + 10 1 libSystem.B.dylib 0x7fff879c2a85 _dispatch_mgr_invoke + 154 2 libSystem.B.dylib 0x7fff879c275c _dispatch_queue_invoke + 185 3 libSystem.B.dylib 0x7fff879c2286 _dispatch_worker_thread2 + 244 4 libSystem.B.dylib 0x7fff879c1bb8 _pthread_wqthread + 353 5 libSystem.B.dylib 0x7fff879c1a55 start_wqthread + 13 Thread 2 Crashed: 0 libSystem.B.dylib 0x7fff87a7784d usleep$NOCANCEL + 0 1 libSystem.B.dylib 0x7fff87a96e3c abort + 93 2 libSystem.B.dylib 0x7fff879ae155 free + 128 3 libSystem.B.dylib 0x7fff879fa16e asl_set_query + 572 4 libSystem.B.dylib 0x7fff87a16239 asl_send + 824 5 libSystem.B.dylib 0x7fff87a15e56 asl_vlog + 570 6 libSystem.B.dylib 0x7fff87a15c19 asl_log + 153 7 Progname.CocoaTools0x000104567101 -[Log vlogLevel:format:arguments:] + 270 8 Progname.CocoaTools0x00010456730c -[Log notice:] + 164 etc Does this look like an Apple bug? It looks to me like the asl subsystem is freeing something it shouldn't and aborting the program. __ Win 1 of 4 Sony home entertainment packs thanks to Yahoo!7. Enter now: http://au.docs.yahoo.com/homepageset/ ___ 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
Of FontManagers and responder chains
I am trying to implement choosing default fonts, as found in the OS-X 10.6 version of TextEdit's Preferences dialog. i.e., you press a button, and it brings up the Font Chooser, and you select a font and it shows the name of the font in the dialog. Now I thought I had it all working, but the trouble is I have the option in System Preferences, Keyboard prefs called Full Keyboard Access to allow focus in all controls. When I turn that option off, nothing in my dialog has explicit focus, and so it seems, changeFont: is never called, presumably because my delegate object for the window is not in the responder chain. I've tried to explicitly make my window the first responder, and to make the button the first responder, but apparently no dice, they are not allowed to be first responder, or even in the responder chain, because they have no focusable objects. I could change the action for NSFontManager, but this breaks things for other uses of the NSFontManager, and seems like a bad idea. I notice that TextEdit when you press a change font in TextEdit Preferences it explicitly makes the text fields to NOT be first responder, so it seems like it is also using the first responder mechanism to make it work. But I can't seem to. __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
Odd window behavior LSUIElement=1
I have an app running without dock icon, and it exhibits odd behavior. Let's say I have existing applications running, A with a window on top of application B. My program pops up a window and forces it to the front. So I have MyApp on top of A on top of B. Now I click on Application A, bringing it to the front. Now I have A on top of MyApp on top of B. Now I quit A. As I quit A, MyApp suddenly pops behind B. The same thing happens whether I programmatically forced MyApp to the front, or whether I bring it to the front by clicking on it. It doesn't happen when I run LSUIElement=0 Can anyone tell me what is going on? __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: Snow Leopard: unsupported PointerFunctions configuration was requested
Below is the RegexKit code that causes the Snow Leopard error. After reading the doco, I don't feel very enlightened about what the unsupported configuration is, or what the solution might be. Can anyone give me a clue? + (void)load { RKAtomicMemoryBarrier(); // Extra cautious if(RKCacheLoadInitialized== 1) { return; } if(RKAtomicCompareAndSwapInt(0, 1, RKCacheLoadInitialized)) { if((cacheMapKeyCallBacks= dlsym(RTLD_DEFAULT, NSIntegerMapKeyCallBacks)) == NULL) { cacheMapKeyCallBacks= dlsym(RTLD_DEFAULT, NSIntMapKeyCallBacks); } #ifdef ENABLE_MACOSX_GARBAGE_COLLECTION id garbageCollector = objc_getClass(NSGarbageCollector); if(garbageCollector != NULL) { if([garbageCollector defaultCollector] != NULL) { id pointerFunctions = objc_getClass(NSPointerFunctions); RKCacheIntegerKeyPointerFunctions = [pointerFunctions pointerFunctionsWithOptions:NSPointerFunctionsIntegerPersonality]; RKCacheIntegerKeyPointerFunctions.acquireFunction = intPointerFunctionsAcquire; RKCacheIntegerKeyPointerFunctions.descriptionFunction = intPointerFunctionsDescription; RKCacheIntegerKeyPointerFunctions.hashFunction= intPointerFunctionsHash; RKCacheIntegerKeyPointerFunctions.isEqualFunction = intPointerFunctionsIsEqual; RKCacheIntegerKeyPointerFunctions.relinquishFunction = intPointerFunctionsRelinquish; RKCacheIntegerKeyPointerFunctions.sizeFunction= intPointerFunctionsSize; RKCacheObjectValuePointerFunctions = [pointerFunctions pointerFunctionsWithOptions:(NSPointerFunctionsZeroingWeakMemory| NSPointerFunctionsObjectPersonality)]; [[garbageCollector defaultCollector] disableCollectorForPointer:RKCacheIntegerKeyPointerFunctions]; [[garbageCollector defaultCollector] disableCollectorForPointer:RKCacheObjectValuePointerFunctions]; } } #endif // ENABLE_MACOSX_GARBAGE_COLLECTION } } From: Bill Bumgarner b...@mac.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Thu, 24 September, 2009 12:36:04 PM Subject: Re: Snow Leopard: unsupported PointerFunctions configuration was requested On Sep 23, 2009, at 7:09 PM, Chris Idou wrote: Very early in application startup, even before main() is called, I get the following error: 2009-09-24 12:07:11.462 MyApp[5534:a0f] *** An unsupported PointerFunctions configuration was requested, probably for use by NSMapTable, NSHashTable, or NSPointerArray. The requested configuration fails due to integer personality not using opaque memory It happens twice on startup, and below are the stack traces when it happens: What does it all mean? #00x7fff84b342f7 in NSLog #10x7fff84ac84d1 in +[NSConcretePointerFunctions initializeSlice:withOptions:] #20x7fff84aea796 in -[NSConcretePointerFunctions initWithOptions:] #30x7fff84aea74d in +[NSPointerFunctions pointerFunctionsWithOptions:] #40x10004b633 in +[RKCache load] One change to the NSPointerFunction based collection classes (which support a number of things that NSArray the like do not) between Leopard and Snow Leopard was to tighten up the validation of the pointer function validation such that a handful of non-sensical configurations are detected that weren't before. I.e. RKCache is trying to create a set of pointer functions that doesn't make sense (and for whose behavior is undefined). As someone else pointed out, RK is most likely RegexKit and, thus, the source is available and can be fixed. Given the relatively common use of RK*, please provide a patch to the author so it can be fixed upstream. b.bum __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
Fw: Snow Leopard: unsupported PointerFunctions configuration was requested
Below is the RegexKit code that causes the Snow Leopard error. After reading the doco, I don't feel very enlightened about what the unsupported configuration is, or what the solution might be. Can anyone give me a clue? + (void)load { RKAtomicMemoryBarrier(); // Extra cautious if(RKCacheLoadInitialized== 1) { return; } if(RKAtomicCompareAndSwapInt(0, 1, RKCacheLoadInitialized)) { if((cacheMapKeyCallBacks= dlsym(RTLD_DEFAULT, NSIntegerMapKeyCallBacks)) == NULL) { cacheMapKeyCallBacks= dlsym(RTLD_DEFAULT, NSIntMapKeyCallBacks); } #ifdef ENABLE_MACOSX_GARBAGE_COLLECTION id garbageCollector = objc_getClass(NSGarbageCollector); if(garbageCollector != NULL) { if([garbageCollector defaultCollector] != NULL) { id pointerFunctions = objc_getClass(NSPointerFunctions); RKCacheIntegerKeyPointerFunctions = [pointerFunctions pointerFunctionsWithOptions:NSPointerFunctionsIntegerPersonality]; RKCacheIntegerKeyPointerFunctions.acquireFunction = intPointerFunctionsAcquire; RKCacheIntegerKeyPointerFunctions.descriptionFunction = intPointerFunctionsDescription; RKCacheIntegerKeyPointerFunctions.hashFunction= intPointerFunctionsHash; RKCacheIntegerKeyPointerFunctions.isEqualFunction = intPointerFunctionsIsEqual; RKCacheIntegerKeyPointerFunctions.relinquishFunction = intPointerFunctionsRelinquish; RKCacheIntegerKeyPointerFunctions.sizeFunction= intPointerFunctionsSize; RKCacheObjectValuePointerFunctions = [pointerFunctions pointerFunctionsWithOptions:(NSPointerFunctionsZeroingWeakMemory| NSPointerFunctionsObjectPersonality)]; [[garbageCollector defaultCollector] disableCollectorForPointer:RKCacheIntegerKeyPointerFunctions]; [[garbageCollector defaultCollector] disableCollectorForPointer:RKCacheObjectValuePointerFunctions]; } } #endif // ENABLE_MACOSX_GARBAGE_COLLECTION } } From: Bill Bumgarner b...@mac.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Thu, 24 September, 2009 12:36:04 PM Subject: Re: Snow Leopard: unsupported PointerFunctions configuration was requested On Sep 23, 2009, at 7:09 PM, Chris Idou wrote: Very early in application startup, even before main() is called, I get the following error: 2009-09-24 12:07:11.462 MyApp[5534:a0f] *** An unsupported PointerFunctions configuration was requested, probably for use by NSMapTable, NSHashTable, or NSPointerArray. The requested configuration fails due to integer personality not using opaque memory It happens twice on startup, and below are the stack traces when it happens: What does it all mean? #00x7fff84b342f7 in NSLog #10x7fff84ac84d1 in +[NSConcretePointerFunctions initializeSlice:withOptions:] #20x7fff84aea796 in -[NSConcretePointerFunctions initWithOptions:] #30x7fff84aea74d in +[NSPointerFunctions pointerFunctionsWithOptions:] #40x10004b633 in +[RKCache load] One change to the NSPointerFunction based collection classes (which support a number of things that NSArray the like do not) between Leopard and Snow Leopard was to tighten up the validation of the pointer function validation such that a handful of non-sensical configurations are detected that weren't before. I.e. RKCache is trying to create a set of pointer functions that doesn't make sense (and for whose behavior is undefined). As someone else pointed out, RK is most likely RegexKit and, thus, the source is available and can be fixed. Given the relatively common use of RK*, please provide a patch to the author so it can be fixed upstream. b.bum Get more done like never before with Yahoo!7 Mail. Learn more. __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
NSDocumentController didCloseAllSelector
The doco for closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo: says that it should call the didCloseAllSelector. How would one do that? This is what I am doing: [delegate performSelector:didCloseAllSelector withObject:(id)YES withObject:contextInfo]; but I'm nervous about that typecast. Is that the way, or is there another way? __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: NSWindowController and GC
The right way is to make sure something in your program retains a pointer to your window controller. Sometimes there will be an obvious place, like a member of the object that created the window controller. That is most typical. Worst case is you retain a pointer in some global variable or similar, but that also has a greater danger that you will forget to zero it out when you are finished with it, and it won't get collected. Some of my temporary dialog box controllers inherit from a class that puts itself in a global dictionary when created, and removes itself when the window closes. From: Bryan Matteson brysco...@gmail.com To: cocoa-dev@lists.apple.com Sent: Thursday, 1 October, 2009 9:20:16 AM Subject: NSWindowController and GC I was just reminded of something. I use GC in my app, and unless I specifically disable collection for a window controller, it's destroyed as soon as it loses key. I solved it by setting the controller as the delegate of the window, disabling collection for the window controller in windowDidLoad, and re-enabling it in windowWillClose:. Is there another way? -B ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: Best Design Advice
If it displays a window it should be an app. If its an app it should be in /Applications and it should be started from Login Items. You can't install it automatically by security design. But once you get the user to install and run it, there are no permissions issues in adding it to login items (although asking the user is polite), and connecting to your web site. From: David Blanton aired...@tularosa.net To: cocoa-dev List cocoa-dev@lists.apple.com Sent: Sunday, 15 November, 2009 4:21:31 AM Subject: Best Design Advice I need to create an app the is auto downloaded and installed from a web site when the user clicks a web page button. The app needs to be installed so that it always runs when the user logs in. The app needs to periodically (by user preference setting) connect to a web server. The app needs to display a window with information gleaned from its last web server connect. = 1. Where should the app be installed. 2. Are there any permission issues. 3. Is this a background service or status like item. 4. Is it's periodic web connect fired by a timer or some other means. 5. Any other general tips / tricks. = Thanks in advance! db ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: NSDocumentController didCloseAllSelector
What I have is a document based app, but it automatically saves everything - I don't want to ask the user. So I'm saving all my documents in closeAllDocumentsWithDelegate. It's working pretty good, the only major hassle is the app doesn't die on machine shutdown, presumably because I wasn't calling didCloseAllSelector. I agree the whole setup is pretty confusing but after ponding it extensively, I think it is more or less sensible, given the need for the RunLoop and so on. (albeit, poorly documented). I'm not sure what you mean you can invoke the method easily enough. Maybe the right way to do it is with NSInvocation. But knowing what I know about objective-c, I can't see how setArgument:atIndex: would be able to know that the second argument is a BOOL which is one byte. Maybe it does know and it all just works. From: Graham Cox graham@bigpond.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Thursday, 1 October, 2009 11:42:05 AM Subject: Re: NSDocumentController didCloseAllSelector On 01/10/2009, at 11:00 AM, Chris Idou wrote: The doco for closeAllDocumentsWithDelegate:didCloseAllSelector:contextInfo: says that it should call the didCloseAllSelector. How would one do that? This is what I am doing: Chris, this stuff is a right old mess. No wonder you're confused. It says *it* will call that method if all documents are closed. You don't necessarily have to call anything - looking at the byzantine interactions between all these methods all I can say is, if you can avoid it, do so! What do you want to do? Unless you're overriding - (void)canCloseDocumentWithDelegate:(id)delegate shouldCloseSelector:(SEL)shouldCloseSelector contextInfo:(void *)contextInfo to do something in a non-standard way there's nothing to do. If you are overriding it, you need to handle the whole kit-n-kaboodle, including presenting the alert to the user and saving the document to disk, and finally invoking the mysterious callback selector. I can't actually see an easy way to invoke the callback selector with the signature as given - you need to pass it the document (self), a BOOL and the contextInfo. You can invoke the method directly on the delegate easily enough, but since you're supposed to use the callback supplied, that might not work. The only way I can see to do it is to create an NSInvocation with the selector, set each argument and call invokeWithTarget: passing the delegate. Someone else might have a brighter idea - this seems very involved and badly thought-out. --Graham __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
Snow Leopard, core data, read only and multiple threads
I've got an app that worked on Leopard. I ported it to Snow Leopard SDK 10.6, and now it works on Snow Leopard, but it doesn't work correctly on Leopard anymore. I haven't changed anything that ought to affect this. It's an app with a foreground gui that writes an XML coredata store. A background thread reads the repository and takes action. Both threads have the full core data stack with their own coordinators. As soon as I activate the background thread, the XML store gets set to zero bytes. When I encountered the problem I read the doco and I added the NSReadOnlyPersistentStoreOption when calling addPersistentStoreWithType in the background thread, but that hasn't helped. It wasn't necessary before. Has anyone got any thoughts? And also, how am I going to debug this? Xcode 3.2 doesn't run on 10.5 does it? And is an Xcode 3.2 project now going to work with XCode 3.1? __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
building and running on Snow Leopard
If you build an application on Snow Leopard, but against the 10.5 deployment target, and then you run the program on Snow Leopard, do you get all the Leopard 10.5 bugs as if you ran it on Leopard, or do you get to benefit from Snow Leopard bug fixes only if you build against the 10.6 deplotment target? __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: building and running on Snow Leopard
Ok, so if I don't desire bug for bug 10.5 compatibility, but I do want it to run on 10.5, then I select 10.6 SDK and 10.5 deployment target, is that right? I'm curious what happens if you use some external frameworks that were built against 10.5 SDK, yet your main app is 10.6 - I assume it will have to go with what your app says, I guess? Also, since I'd like to take advantage of Snow Leopard bug fixes, but I don't want to blow up on Leopard, what is the correct way to test whether you are running on Leopard so that the code at runtime can implement Leopard specific work arounds? From: Ken Thomases k...@codeweavers.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Wednesday, 23 September, 2009 5:37:01 PM Subject: Re: building and running on Snow Leopard On Sep 23, 2009, at 2:20 AM, Chris Idou wrote: If you build an application on Snow Leopard, but against the 10.5 deployment target, and then you run the program on Snow Leopard, do you get all the Leopard 10.5 bugs as if you ran it on Leopard, or do you get to benefit from Snow Leopard bug fixes only if you build against the 10.6 deplotment target? Not quite either. At runtime, your app can only use the frameworks provided on the host system. Just because you linked against the 10.5 SDK doesn't change the fact that Snow Leopard only provides Snow Leopard's frameworks. In general, your app will get the benefit of bug fixes in the Snow Leopard frameworks when running on Snow Leopard. However, there are some bug fixes which Apple has determined would break backward compatibility with apps built and tested on Leopard or earlier. For those fixes, they test which SDK the app was built against. For those built against the pre-Snow Leopard SDK, they continue to provide the old, compatible-bug-buggy behavior. This is documented in the release notes for the affected frameworks. Note that this tests for the SDK that the app was built against. You mentioned deployment target. That's not the same thing. If you build against the 10.6 SDK but with a 10.5 deployment target, it is expected that you will be testing on both 10.6 and 10.5. It is then your code's responsibility to handle both the old framework behavior the new behavior. The Snow Leopard frameworks _do not_ go out of their way to maintain the old behavior in this case. Regards, Ken __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: building and running on Snow Leopard
From: Ken Thomases k...@codeweavers.com Don't test whether you're running on Leopard. Just write your code to cope with either behavior of the framework. Read the release notes for the frameworks on which you rely for more guidance. I think when you see the sorts of bugfixes which are special-cased in this way, it will be obvious how you should code in response. Well I'm thinking of a particular bug on Leopard with MDItemCreate where you have to choose between your program crashing and leaking memory. Apple tells me it is fixed in Snow Leopard. On Leopard I choose to leak memory, but I'd rather not do that on Snow Leopard. __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
Snow Leopard: unsupported PointerFunctions configuration was requested
I'm porting an app to Snow Leopard. Very early in application startup, even before main() is called, I get the following error: 2009-09-24 12:07:11.462 MyApp[5534:a0f] *** An unsupported PointerFunctions configuration was requested, probably for use by NSMapTable, NSHashTable, or NSPointerArray. The requested configuration fails due to integer personality not using opaque memory It happens twice on startup, and below are the stack traces when it happens: What does it all mean? #00x7fff84b342f7 in NSLog #10x7fff84ac84d1 in +[NSConcretePointerFunctions initializeSlice:withOptions:] #20x7fff84aea796 in -[NSConcretePointerFunctions initWithOptions:] #30x7fff84aea74d in +[NSPointerFunctions pointerFunctionsWithOptions:] #40x10004b633 in +[RKCache load] #50x7fff8764141b in call_load_methods #60x7fff87641160 in load_images #70x7fff5fc0315a in __dyld__ZN4dyldL12notifySingleE17dyld_image_statesPK11ImageLoader #80x7fff5fc0bcdd in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj #90x7fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj #100x7fff5fc0bda6 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE #110x7fff5fc0210e in __dyld__ZN4dyld24initializeMainExecutableEv #120x7fff5fc06981 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ #130x7fff5fc016d2 in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKcl #140x7fff5fc01052 in __dyld__dyld_start #00x7fff84b342f7 in NSLog #10x7fff84aea7bd in -[NSConcretePointerFunctions initWithOptions:] #20x7fff84aea74d in +[NSPointerFunctions pointerFunctionsWithOptions:] #30x10004b633 in +[RKCache load] #40x7fff8764141b in call_load_methods #50x7fff87641160 in load_images #60x7fff5fc0315a in __dyld__ZN4dyldL12notifySingleE17dyld_image_statesPK11ImageLoader #70x7fff5fc0bcdd in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj #80x7fff5fc0bc9d in __dyld__ZN11ImageLoader23recursiveInitializationERKNS_11LinkContextEj #90x7fff5fc0bda6 in __dyld__ZN11ImageLoader15runInitializersERKNS_11LinkContextE #100x7fff5fc0210e in __dyld__ZN4dyld24initializeMainExecutableEv #110x7fff5fc06981 in __dyld__ZN4dyld5_mainEPK12macho_headermiPPKcS5_S5_ #120x7fff5fc016d2 in __dyld__ZN13dyldbootstrap5startEPK12macho_headeriPPKcl #130x7fff5fc01052 in __dyld__dyld_start __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: Controlling Spaces and retrieving information about the current Space?
Secondly, is there any way in any of those environments to programmatically switch Spaces? [ ... ] No, there is no API (in Cocoa or otherwise) to control the active space. But how does Spaces do it? Is it via an internal, private API that people like us don't have access to? There may not be any API, internal or otherwise. It might be all just built into the internal workings of the window manager process. One would presume there is an internal API for switching to the grid view, since Spaces.app does that. __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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: testing ppc on intel
10.5.8. Now that I try, a new empty Cocoa app in XCode works. My app is just a one window Cocoa program that links with two frameworks (both of which are universal with ppc). arch -ppc works with /bin/cat, iTunes and so forth. Just not with my programs. I'm pretty sure I have no input managers, I cleared the contents of ~/Library/InputManagers and /Library/InputManagers, and I don't think I have kexts, I haven't installed those sort of programs, or any haxies. If there is something wrong with my program, I'm not sure how to debug it. From: Greg Guerin glgue...@amug.org To: list-cocoa-dev cocoa-dev@lists.apple.com Sent: Monday, 14 September, 2009 5:33:48 PM Subject: Re: testing ppc on intel Chris Idou wrote: Every program that I build universal but run on intel (OS 10.5) with arch -ppc option, crashes with a report like the following, and I've tested quite a few, even simple ones. How simple is simple? Hello world, or simpler? What about programs you didn't write, such as /bin/cat? Exactly which version of Leopard? 10.5 covers at least nine revisions. Do you have any input managers, haxies, kexts, etc. active? -- GG ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
testing ppc on intel
Every program that I build universal but run on intel (OS 10.5) with arch -ppc option, crashes with a report like the following, and I've tested quite a few, even simple ones. Is it unreasonable to try to test ppc programs on intel, or am I doing something wrong, or what? Version: ??? (???) Code Type: PPC (Translated) Parent Process: bash [1652] Interval Since Last Report: 83 sec Crashes Since Last Report: 1 Per-App Interval Since Last Report: 0 sec Per-App Crashes Since Last Report: 1 Date/Time: 2009-09-14 15:05:30.700 +1000 OS Version: Mac OS X 10.5.8 (9L30) Report Version: 6 Anonymous UUID: FA165A8B-95AA-4C9A-9296-C70D9F3138FC Exception Type: EXC_CRASH (SIGTRAP) Exception Codes: 0x, 0x Crashed Thread: 2 Thread 0: 0 ??? 0x816a5e28 0 + 2171231784 Thread 1: 0 ??? 0x800bc286 0 + 2148254342 1 ??? 0x800c3a7c 0 + 2148285052 2 translate 0xb818b6ea CallPPCFunctionAtAddressInt + 202886 3 ??? 0x800ed155 0 + 2148454741 4 ??? 0x800ed012 0 + 2148454418 Thread 2 Crashed: 0 ??? 0x8019d402 0 + 2149176322 1 translate 0xb80b6b00 0xb800 + 748288 2 translate 0xb80b7007 0xb800 + 749575 3 translate 0xb80d49c0 0xb800 + 870848 4 translate 0xb813d75f spin_lock_wrapper + 4259 5 translate 0xb8011b64 0xb800 + 72548 Thread 2 crashed with X86 Thread State (32-bit): eax: 0x ebx: 0xb80b6c78 ecx: 0xb009adcc edx: 0x8019d402 edi: 0xb8208980 esi: 0x0005 ebp: 0xb009adf8 esp: 0xb009adcc ss: 0x001f efl: 0x0246 eip: 0x8019d402 cs: 0x0007 ds: 0x001f es: 0x001f fs: 0x001f gs: 0x0037 cr2: 0xf00fffd0 Binary Images: 0xb800 - 0xb81d7fe7 translate ??? (???) /usr/libexec/oah/translate Translated Code Information: NO CRASH REPORT __ Get more done like never before with Yahoo!7 Mail. Learn more: http://au.overview.mail.yahoo.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
Testing 32/64 bit and/or PPC
If you have a universal binary, 32/64 and/or PPC, is there a way to force it to run one way or the other for testing purposes? __ Find local businesses and services in your area with Yahoo!7 Local. Get started: http://local.yahoo.com.au ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Confusion about custom UITableViewCell
I'm trying to make a custom UITableViewCell, but the way I'm doing it, all the drawing of the table seems to be screwed up. The view seems to be working in some sense, because I can see the data, but only one row at the bottom can be seen and things are generally screwed up when scrolling. This is what I'm doing: 1) Create new Navigation based app. 2) Add a Table View Cell to the RootViewController.xib 3) Edit the TableViewCell in IB, add some Labels onto it. 4) Connect TableViewCell and Labels to outlets in RootViewController.h 5) modify tableView:cellForRowAtIndexPath: so that it sets data in the UILabels and returns the TableViewCell from the Nib outlet. Is there some reason this shouldn't work? __ Find local businesses and services in your area with Yahoo!7 Local. Get started: http://local.yahoo.com.au ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
CFBundleTypeName
http://devworld.apple.com/ReleaseNotes/Cocoa/AppKit.html Use of these keys becomes optional: CFBundleTypeName http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/Articles/PListKeys.html This key is required What is the truth? I'm trying to create a document by passing a type into makeDocumentWithContentsOfURL, but it doesn't seem to call the appropriate document handling class to create the document. Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
From: James Gregurich bayoubenga...@mac.com 3) I don't allow exceptions of any kind to propagate into alien codeparticularly the cocoa runtime. Given that Objective-C doesn't have declared exceptions (like Java), it seems more likely that you hope exceptions are not propagated into alien code. Unless that is you are in the unusual situation that you use no third party libraries, or you have full and perfect knowledge of where and when they might throw an exception. Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
From: James Gregurich bayoubenga...@mac.com I have read up on GC, and I don't like the idea of introducing non-deterministic behavior into my code base. I would question the assertion that GC introduces non-deterministic behavior, unless you consider the time it takes for particular code to execute to be behavior. In which case standard malloc/free is not deterministic either, since algorithms for amalgamating free areas in the heap are not exactly predictable, and the time they take will not be constant across different calls. That's why if you were controlling the space shuttle you wouldn't use malloc/free OR GC. Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
From: Bill Bumgarner b...@mac.com .. Bill I don't know if this was discussed before, but could you discuss the lack of GC on the iPhone? Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
I still use XCode in one location where I work on a core-solo Mini. Performance is good. No problems at all, no pauses. From: Rob Keniger r...@menumachine.com To: cocoa-dev Dev cocoa-dev@lists.apple.com Sent: Friday, 26 June, 2009 12:20:48 PM Subject: Re: GC pros and cons On 26/06/2009, at 10:58 AM, Chris Idou wrote: Bill I don't know if this was discussed before, but could you discuss the lack of GC on the iPhone? I suspect it is for performance reasons. The Objective-C garbage collector is designed to run in a separate thread on the Mac, which means it can run on its own CPU core separate to the main thread. In single-core systems, even on the Mac, performance of Garbage Collected code is very poor because the collector has to share CPU time with the main thread. When Xcode 3 (a GC app) was first released in the Leopard betas there were still quite a few people with single-CPU PowerPC laptops who found that Xcode could barely keep up with their typing. On dual-core machines it was fine. The iPhone has a single-core CPU and a slow one at that, so while I am sure that GC could be turned on, it would probably make developers very unhappy. -- Rob Keniger ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
I guess the necessity to scan and page in memory is a legitimate downside for VM systems. It's possible I've seen xcode pause when switching apps, but never thought about it being related to GC scans, but just paging in the app. I'd probably forgotten that XCode is GC. ...of course, the iPhone does not have virtual memory, so its not an issue there. From: Adam R. Maxwell amaxw...@mac.com To: cocoa-dev Dev cocoa-dev@lists.apple.com Sent: Friday, 26 June, 2009 1:32:51 PM Subject: Re: GC pros and cons On Jun 25, 2009, at 8:19 PM, Chris Idou wrote: I still use XCode in one location where I work on a core-solo Mini. Performance is good. No problems at all, no pauses. Interesting. I found the Xcode editor to be unusably slow on a PowerBook G4 when Leopard was released; in fact, contrary to Bill's statement, I found that it grew worse in the last few months of Leopard seeding. I'm still sore about having to buy a MacBook Pro just to avoid beachballs while typing (rdar://problem/5572897). Even said MacBook Pro needs 4 GB of RAM to avoid hanging when switching to Xcode, since the collector thread evidently causes paging in to scan memory (which caused a beachball and hiccups switching apps in Spaces). Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
On Jun 24, 2009, at 09:14, Philip Aker wrote: Like Gwynne, I'm comfortable with the traditional reap what you sow philosophy. This has benefits in that the basic policy spills over into other areas of programming and gradually, one learns as a matter of habit, to account for things all the time. This is good but can be lumped in with many other things learned from the school of hard knocks. With GC, the attitude is like one could fire a shotgun into a crowd and the walk away because the system will take responsibility for the consequences. Maybe you could say that's a moral issue. But it's certainly not something children should be taught in school. I think it depends what language you weaned yourself on. If you've used Lisp or some other functional language, manual reclamation is an unthinkable monstrosity. If you weaned yourself on C or similar languages, manual reclamation seems like the default state of play. Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: Confusion about NIB loading
On 24/06/2009, at 11:20 PM, Chris Idou wrote: Since the doco for loadNibNamed:owner: says that it looks in the bundle associated with the owner, I'm creating an object of a class that exists in the subframework to pass as the owner. However, it doesn't find the NIB. Am I understanding correctly what it means for a bundle to be associated with a class? To get the bundle for the class, you need to use [NSBundle bundleForClass:[YourClass class]]. You can then load the nib by calling loadNibNamed:owner:. But loadNibNamed:owner: is a class method, so I can't actually explicitly find the appropriate bundle, and call loadNibNamed: on it to find the right NIB. The doco says that loadNibNamed:owner: will look in the bundle associated with the owner, but passing in an object of a class in the appropriate Bundle doesn't seem to work for me. Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: GC pros and cons
On Jun 24, 2009, at 18:19, Jeff Laing wrote: we regularly cache hundreds of thousands of objects from a persistent (relational) store and it is absolutely critical to us that the instant that those objects aren't required, they give their memory back - that's how we can run in a machine with only(?) 1 gig of ram. So I'm one of those people I mentioned earlier that really really cares that cleanup happens as soon as possible, not That's the kind of scenario where an object database usually has the correct semantics. Objects are created in a pool, and usually you want them all freed when the transaction ends. Still, I don't see why GC wouldn't also work. People seem to have a perception that GC programs must always be bloated and late in cleaning up. That's probably not a correct assumption. Access Yahoo!7 Mail on your mobile. Anytime. Anywhere. Show me how: http://au.mobile.yahoo.com/mail ___ 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: Opinion on managed memory and garbage collection
I've written a reasonably non-trivial app using GC and using a fairly wide range of APIs. I've found several GC bugs in the Apple frameworks, which naturally enough are pretty annoying (as all memory problems are), but I don't think the annoyance is still anywhere near that of having to write memory release code, and then hunt down memory leaks. I haven't noticed GC pauses. It seems to me that the GC collects memory extremely quickly, relative to when it becomes unreachable. Given that it apparently does a lot of work in another thread, I wouldn't expect there to be much pausing in normal applications. From: Michael Ash michael@gmail.com To: cocoa-dev cocoa-dev@lists.apple.com Sent: Tuesday, 23 June, 2009 2:21:48 PM Subject: Re: Opinion on managed memory and garbage collection On Mon, Jun 22, 2009 at 10:58 AM, Phil Hystadphys...@mac.com wrote: Being relatively new to Cocoa and Objective-C, what is the consensus on using the new version 2.0 managed memory features (garbage collection). If you were writing a new Cocoa application from scratch, would garbage collection be the preferred method over the reference counting (retain/release) method. Having spent years in Java I would prefer a GC'd approach but I have also seen the great improvement of GC in Java over the years. Therefore, I am also curious on how the new Objective-C design for GC compares. The applications I have in mind are mostly graphic (Quartz 2D) oriented and likely also some OpenGL work. Thanks for your opinions and comments. IMO there are three major reasons to avoid GC at this point: 1) In 10.5 there are still significant bugs in the GC and, more importantly, the GC support in the system frameworks. The GC bugs are generally obscure and hard to hit, the frameworks are much easier to hit and harder to work around. If you search the list archives you'll probably turn up various posts where Apple people tell developers that you can't use this API under GC, or it has some huge speed hit, or the only way to avoid a crash is to deliberately leak an object, etc. Hopefully 10.6 is better, but as always, the people who know can't say and the people who can say don't know. 2) The GC pauses your threads at nondeterministic intervals and for an unknown amount of time in order to scan its stack. If this pause is significant enough, it could cause occasional visible stutter in your graphics output. I have no idea what the chances are of this causing problems for you, but it's something to watch out for. 3) By its very nature of trying to coexist in a C-based language, the GC doesn't cover everything. This is by design. The GC covers ObjC objects (including bridged CoreFoundation objects allocated in the default zone) and raw memory that you explicitly allocate with the collector. Anything that's allocated with raw malloc/free stays outside the garbage collector. This is a big advantage in that any raw C code that you happen to have (or load) will almost certainly Just Work in a garbage collected environment, which I'm sure is a big part of why the Apple GC guys chose to make it work this way. The downside is that your interactions with the collector often become more manual than you might like if you drop out of the Ideal Pure Objective-C World and into the guts of C. The code you write here will offset your savings from not having to write retain/release code, and worse, this code is usually much more complex and error-prone. I have not done a lot of serious work with GC, although I have a half-completed project and some toy projects that use it. My personal impression is that if you're doing a conventional, straightforward OS X program which never colors outside the lines, you're likely to have a good experience with it. If you're after high performance or are doing anything tricky then you're likely to run afoul of it and perhaps wish that you had gone the other way. Retain/release has a long history, is very well understood, and doesn't really require much mental (or typing) overhead once you know it. With GC you're much more like a test pilot at this stage in the game, especially since there are a lot of frameworks deficiencies under GC which are known to Apple but which they haven't actually put into the documentation. (List archives are your friend here.) GC has more risk and potentially more reward. If you can aim for 10.6+, the risk/reward ratio is probably going to be quite a bit lower, although that's just speculation. Obviously the ultimate choice is yours. Mike ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com Access Yahoo!7 Mail
Databases on Cocoa (was Re: Invoice program made in Objective c/Cocoa)
The database situation on Cocoa is not great. Apple should spend some of that cash hoard building or buying an object database. If anyone wants an interesting project, the db4o object database which is written in Java and GPLed comes with a program called Sharpen which translates Java into C#. It occurs to me that translating it into C or objective-c would be possible. Nobody would give a rip about core-data if there was a real object database available. On another note, Versant which seems to now run db4o has a very nice object database with c bindings that would probably be really easy to write objective-c bindings for, but its commercial and much too heavy weight for most of our purposes. From: Andreas Grosam agro...@onlinehome.de To: Cocoa-Dev List cocoa-dev@lists.apple.com Sent: Monday, 18 May, 2009 10:47:44 PM Subject: Re: Invoice program made in Objective c/Cocoa On May 18, 2009, at 4:01 AM, Michael Ash wrote: Perhaps you should have taken more than a first glance. For example, here: http://developer.apple.com/documentation/Cocoa/Conceptual/CoreData/Articles/cdBasics.html#//apple_ref/doc/uid/TP40001650 Core Data is not a relational database or a relational database management system (RDBMS). This is unrelated to the problem. Mike, I think you are using a straw man argument - or you totally misunderstood me. Why would you think I had ever designed a database application or framework? All I know is, CoreData is *not* a database framework, so your whining about how it fails some fundamental requirement for database frameworks makes no sense. I think you misunderstood me. Core Data could be a very useful *part* of a database application framework. But it is not, because it apparently lacks the ability to interface to other related parts of a database application framework (ORM, data access layer, storage management) - at least this is what I conclude from this discussion. Again, to make this clear: I don't claim that Core Data should implement all these layers of a database application framework (or even a RDBMS). And honestly, it should not! Rather it should provide a means to interface with them. And using your car example: having tires is certainly useful. But they become even more useful if you can mount them on your car. ;) Andreas ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com Need a Holiday? Win a $10,000 Holiday of your choice. Enter now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline ___ 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: Databases on Cocoa (was Re: Invoice program made in Objective c/Cocoa)
Core Data solves that through the use of a SQLite backing store. SQL based data storage is the standard means of achieving incremental retrieval and storage of data in our industry. If Core Data talked to standard databases like Oracle etc, then I can see that as a selling point. But since it doesn't, and since it tries to hide SQLite, it's hard to see how it is much of a selling point. That SQL is pervasive is irrelevant if you're hiding the existence of SQL. If you're going to make it look like an object database, but not talk to widely deployed SQL databases, then you really should make it an object database. I don't know how core-data handles inheritance, but all the ways of doing it with an SQL database make performance suck if you want to do anything serious, and they also make writing SQL queries intractable if one wanted to get some benefits of having an SQL back end. I guess some people don't want to use any inheritance because their problems are simple, and it *can* work for them, but having a proper object database with a query facility or SQL front to it could work for them too. We're in an object world now, and SQL databases can't cut it for many many problems. Accounting style applications, yes they *can* work. But there are vast areas of computing where its just too inefficient. Goto the web site of an object database like Versant and look at the wide variety of customers they have. They don't buy it because they are geeky, but because SQL databases can't do it. At that point, the choices are to fully document the schema and implement a whole bunch more code that tries to detect when someone has done something wrong in the database. Combined with the need to provide some kind of a means of making access to many different vendor's databases transparent -- some of which have notoriously odd implementations of the SQL spec -- make implementing (3) extremely costly both in $$$ and engineering hours spent. It's not *that* hard. Java tools like Hibernate do it. They still have the sucky performance implied by mapping object graphs to relational databases, but it at least gives you the ability to talk to any SQL database you want to, while still having a core-data like object access. Anybody else looking for an interesting project to work on could well port Hibernate to objective-c. In the case of (3), the assumption would be that -- like with the SQLite database -- Core Data would manage the entire schema of the database on the server. Certainly, that would be useful to a subset of developers, but how many? In studying the problem, I come up with not that many. In almost cases where I have looked at problems that required client/server database access, one of the requirements was to interface with some kind of a reporting engine, web service/server, or something else that wants to go trolling through the data store and, more likely, edit stuff. Nobody wants multi-user access unless they can interface with some 3rd party report engine? Firstly, that's not even nearly true. Tons of companies are buying object databases, and a relatively small group of them actually use them with reporting engines. Secondly an object database has the ability to upload object schemas derived from the object source code to a server without any difficulty. This is easy stuff for an object database. Thirdly, any decent object database can offer a legacy SQL interface that 3rd party reporting engines can talk to. So that brings up (4). (4) is a really really really hard problem to solve. It's not even an issue for object databases, and it's not *that* hard to solve for SQL databases as Hibernate shows. Need a Holiday? Win a $10,000 Holiday of your choice. Enter now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline ___ 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
menus within NSTable
I've got an NSTable where I've made one column to have a NSPopupButtonCell as its contents. Depending on the object that relates to a particular row, I only want two of four possible values to be selectable in each row. I tried to achieve this by setting the Enabled binding of each NSMenuItem in the cell to be bound to the Array Controller, with controller key arrangedObjects and a model key path to be a BOOL method on the objects in my table. However this blows up like this: Unhandled Exception: Cannot create BOOL from object ( 0 ) of class NSCFArray How would I make it work? Need a Holiday? Win a $10,000 Holiday of your choice. Enter now.http://us.lrd.yahoo.com/_ylc=X3oDMTJxN2x2ZmNpBF9zAzIwMjM2MTY2MTMEdG1fZG1lY2gDVGV4dCBMaW5rBHRtX2xuawNVMTEwMzk3NwR0bV9uZXQDWWFob28hBHRtX3BvcwN0YWdsaW5lBHRtX3BwdHkDYXVueg--/SIG=14600t3ni/**http%3A//au.rd.yahoo.com/mail/tagline/creativeholidays/*http%3A//au.docs.yahoo.com/homepageset/%3Fp1=other%26p2=au%26p3=mailtagline ___ 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: Packages vs bundles vs folders etc
I'm surprised that frameworks act like folders in Finder, yet don't conform to public.folder. To be more explicit, I'm writing some code that synchronises two folders. If directory A contains file X and directory B contains file Y, then synchronising them depends on what kind of directory it is. If it is a package, then a resulting package containing files X and Y would be wrong, it could be a corrupt package. Folders should be synchronised and have both X and Y. But I'm not sure about frameworks being neither a folder nor a package. What would users expect? Hmm, I see that bundle, package and folder are the three decendents of public.directory. framework conforms to bundle rather than package and appears in the finder like a folder. However applications descend from bundle and do NOT appear like folders. Why does finder decide that frameworks appear like folders? And which items does spotlight indexing delve into? Which items would iDisk synchronise atomically? From: Peter Ammon pam...@apple.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Monday, 11 May, 2009 4:02:17 PM Subject: Re: Packages vs bundles vs folders etc On May 10, 2009, at 10:43 PM, Chris Idou wrote: Would it be fair to say that if a path is a directory, and if the kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath would return YES? No. A non-package directory may not even conform to public.folder. For example, volume mount points have the type ID public.volume, which does conform; but frameworks have the type ID public.framework, which does not conform. But isn't a framework a package, thus making my statement correct? If a framework is not a package, then what specifically makes a package a package that a framework doesn't fit? Frameworks are not packages. A package is a directory that is presented as a single file to the user, but frameworks are shown as folders and are browsable like other folders. You can check the UTI hierarchy in the UTCoreTypes.h header (try open -h UTCoreTypes.h). Perhaps I should state my question more explicitly. I'm trying to figure out what things should be copied atomically. When a directory is really a bundle (is a bundle == package?), then it must be considered as one unit. If it's just a folder, then the files therein have their own unique reasons for existing. But I'm not sure which API exactly will give me the distinction I want to make. If you copy two folders, Finder reports the total number of items contained within them; but if you copy two applications, Finder reports only two items. Is that the sort of distinction you want to make? If so, I think you're on the right track. On Leopard, I would get the UTI of a file via -[NSWorkspace typeOfFile: error:], and then see if it conforms to kUTTypeFolder via -[NSWorkspace type:fileType conformsToType:(NSString *)kUTTypeFolder]. If it does NOT conform, it should be treated as a single item. If you need Tiger compatibility, you can do the same thing, except you would use LaunchServices functions like LSCopyItemAttribute(). -Peter ___ 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: Garbage collector related crash
When you are saying it is broken on Leopard, what exactly do you say you know is broken? GC in general, or the __strong thing, or ? From: Bill Bumgarner b...@mac.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Saturday, 9 May, 2009 3:58:11 AM Subject: Re: Garbage collector related crash On May 8, 2009, at 12:47 AM, Chris Idou wrote: I've got an object that holds onto a CF ref: mdref= MDItemCreate(nil, (CFStringRef)path); [NSMakeCollectable(mdref) autorelease]; I think I'm doing the right thing in the class declaration: @interface MetadataItem : NSObject { __strongMDItemRefmdref; @end But every now and then: CFTypeRefres = MDItemCopyAttribute(mdref, (CFStringRef)key); this makes it crash horribly. It's got to have something to do with garbage collection, but it seems like I'm doing things right. Any thoughts? It is broken on Leopard (and fixed in a future release); please file a bug and send me the bug #. Attach your binary to the bug with steps to reproduce. One workaround for now -- not a very good workaround, but a workaround -- is to CFRetain the mdref as soon as you create it. Then never ever CFRelease it. Yes, it'll leak (fortunately these are small). But it won't crash (unless some other subsystem does code like yours above out of your control). b.bum ___ 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: Garbage collector related crash
Is it fixed in a later version of Leopard, or in Snow Leopard? And it is a workaround to release it in the finalizer of the object that retains it and uses it? From: Bill Bumgarner b...@mac.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Monday, 11 May, 2009 2:47:43 AM Subject: Re: Garbage collector related crash On May 10, 2009, at 3:47 AM, Chris Idou wrote: When you are saying it is broken on Leopard, what exactly do you say you know is broken? GC in general, or the __strong thing, or ? There is a bug internal the MD* API that causes this particular crash because it creates dangling weak references that the collecter stumbles over. Purely a bug in MD* that is fixed in a later release. b.bum ___ 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
Packages vs bundles vs folders etc
Would it be fair to say that if a path is a directory, and if the kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath would return YES? And conversely if a path is not a directory or the kMDItemContentType == public.folder, then NSWorkspace.isFilePackageAtPath would return NO? ___ 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: Garbage collector related crash
Err, why isn't that a workaround? If retaining it but not freeing it is a workaround, why wouldn't retaining it and freeing it after I am done with it work? From: Bill Bumgarner b...@mac.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Monday, 11 May, 2009 11:59:11 AM Subject: Re: Garbage collector related crash On May 10, 2009, at 6:35 PM, Chris Idou wrote: Is it fixed in a later version of Leopard, or in Snow Leopard? Snow Leopard. And it is a workaround to release it in the finalizer of the object that retains it and uses it? No. b.bum ___ 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: Packages vs bundles vs folders etc
Would it be fair to say that if a path is a directory, and if the kMDItemContentType != public.folder then NSWorkspace.isFilePackageAtPath would return YES? No. A non-package directory may not even conform to public.folder. For example, volume mount points have the type ID public.volume, which does conform; but frameworks have the type ID public.framework, which does not conform. But isn't a framework a package, thus making my statement correct? If a framework is not a package, then what specifically makes a package a package that a framework doesn't fit? Perhaps I should state my question more explicitly. I'm trying to figure out what things should be copied atomically. When a directory is really a bundle (is a bundle == package?), then it must be considered as one unit. If it's just a folder, then the files therein have their own unique reasons for existing. But I'm not sure which API exactly will give me the distinction I want to make. And conversely if a path is not a directory or the kMDItemContentType == public.folder, then NSWorkspace.isFilePackageAtPath would return NO? I'm pretty sure this is true. All packages are directories, and no package type conforms to public.folder, or ever will. -Peter ___ 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
Garbage collector related crash
I've got an object that holds onto a CF ref: mdref= MDItemCreate(nil, (CFStringRef)path); [NSMakeCollectable(mdref) autorelease]; I think I'm doing the right thing in the class declaration: @interface MetadataItem : NSObject { __strongMDItemRefmdref; @end But every now and then: CFTypeRefres = MDItemCopyAttribute(mdref, (CFStringRef)key); this makes it crash horribly. It's got to have something to do with garbage collection, but it seems like I'm doing things right. Any thoughts? ___ 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
Vector Graphic Dock Icon?
Is it possible to use a vector graphic as a dock icon? The Apple doco seems to encourage using vector graphics, but I can't find it documented what format it would expect. I tried a PDF but that didn't seem to work. Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Vector Graphic Dock Icon?
Is there any point in doing that in the normal case, seeing as a non-running application (cover-flow) can potentially be a lot larger icon than a running one? (of course, if you need to have a badged dock icon, or something like that, I can see the point). From: Shawn Erickson shaw...@gmail.com To: Chris Idou idou...@yahoo.com Cc: cocoa-dev@lists.apple.com Sent: Thursday, 7 May, 2009 3:00:18 AM Subject: Re: Vector Graphic Dock Icon? On Wed, May 6, 2009 at 7:44 AM, Chris Idou idou...@yahoo.com wrote: Is it possible to use a vector graphic as a dock icon? Application icons currently cannot be vector images however you can set the dock image for a running application to an NSImage constructed from a PDF, etc. http://developer.apple.com/documentation/UserExperience/Conceptual/HiDPIOverview/HiDPIArt/HiDPIArt.html#//apple_ref/doc/uid/TP40003409-CH6-DontLinkElementID_2 -Shawn Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
MDItemCopyAttribute and kMDItemFinderComment
I've got a program which uses MDItemCopyAttribute to get the kMDItemFinderComment, and I was playing around testing it, by changing the value in the Finder and seeing if the value changed in my program, and they ended up out of synch. It ends up that mdls returns a different value than xattr -l, and MDItemCopyAttribute doesn't return the up to date value. Now that its out of synch, updating the value in Finder doesn't get it back in synch. Is this expected behavior? Should I be using something other than MDItemCopyAttribute to get the most up to date value? Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: MDItemCopyAttribute and kMDItemFinderComment
I don't really want to be sending apple events to the finder since this is a background app, and it could be calling it fairly frequently, and I believe this can impact the user's foreground use of Finder. Does anybody know what the issue is? Mostly the synchronization between Finder Comments and spotlight seems instantaneous, but then on this occasion they seemed to refuse to sync. On Apr 21, 2009, at 8:04 AM, Chris Idou wrote: I've got a program which uses MDItemCopyAttribute to get the kMDItemFinderComment, and I was playing around testing it, by changing the value in the Finder and seeing if the value changed in my program, and they ended up out of synch. It ends up that mdls returns a different value than xattr -l, and MDItemCopyAttribute doesn't return the up to date value. Now that its out of synch, updating the value in Finder doesn't get it back in synch. Is this expected behavior? Should I be using something other than MDItemCopyAttribute to get the most up to date value? You should be sending an Apple event to the Finder: http://www.cocoabuilder.com/archive/message/cocoa/2009/3/23/232927 --Michael Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
EXC_BAD_ACCESS and NSAttributedString driving me crazy
I'm getting NSRTFDPboardType and NSRTFPboardType objects as NSData from the pasteboard and I'm storing them in a core data XML repository and getting them out again, and when necessary I'm converting them into NSAttributedString with initWithRTF or initWithRTFD. This mostly works but every now and then, actually quite often, this initWithRTF(D) crashes with EXC_BAD_ACCESS. (stack traces below). The thing is, I'm doing an md5Hash on the NSData objects every single time I store them and retrieve them just to make sure they are not corrupted, and the exact same NSData that is working one minute as an argument to initWithRTF(D), makes it crash later on. I'm using garbage collection, but I've solved a lot of GC problems and this doesn't seem similar. Has anyone got any thoughts? #00x95a82688 in objc_msgSend #10x933b0b26 in -[NSCFDictionary setObject:forKey:] #20x90824684 in -[NSRTFD setObject:forKey:] #30x908f3c2f in -[NSAKDeserializer deserializePList:] #40x908f3961 in -[NSDocumentDeserializer deserializeNewPList] #50x908f3753 in -[NSRTFD(NSSerializationSupport) initWithPasteboardDataRepresentation:] #60x908f2fe9 in -[NSFileWrapper initWithSerializedRepresentation:] #70x908f2e32 in -[NSRTFReader initWithRTFD:] #80x9070b9a7 in _NSReadAttributedStringFromURLOrData #90x90709943 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:] #100x908f2de2 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithRTFD:documentAttributes:] .. #00x95a82688 in objc_msgSend #10x90894910 in processColor #20x9089395b in CharAttr #30x9088db34 in -[NSRTFReader attributedString] #40x9070bc03 in _NSReadAttributedStringFromURLOrData #50x90709943 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:] #60x9088c542 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithRTF:documentAttributes:] . Program received signal: “EXC_BAD_ACCESS”. Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy
Thanks for the links. If I run with libgmalloc, it dies the same way, but seemingly much quicker: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_PROTECTION_FAILURE at address: 0x0032 0x95a82688 in objc_msgSend () (gdb) where #0 0x95a82688 in objc_msgSend () #1 0x90894910 in processColor () #2 0x9089395b in CharAttr () #3 0x9088db34 in -[NSRTFReader attributedString] () #4 0x9070bc03 in _NSReadAttributedStringFromURLOrData () #5 0x90709943 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:] () #6 0x9088c542 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithRTF:documentAttributes:] () I also found a posting with someone with the exact same problem: http://www.mail-archive.com/cocoa-dev@lists.apple.com/msg27895.html I'm not sure what else to try. I'd be inclined to jump to the conclusion of blaming Apple, if it wasn't that this API must be a very widely called one. From: Sean McBride cwat...@cam.org To: Chris Idou idou...@yahoo.com; cocoa-dev@lists.apple.com Sent: Tuesday, 31 March, 2009 2:43:18 PM Subject: Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy Chris Idou (idou...@yahoo.com) on 2009-03-30 8:25 PM said: I'm getting NSRTFDPboardType and NSRTFPboardType objects as NSData from the pasteboard and I'm storing them in a core data XML repository and getting them out again, and when necessary I'm converting them into NSAttributedString with initWithRTF or initWithRTFD. This mostly works but every now and then, actually quite often, this initWithRTF(D) crashes with EXC_BAD_ACCESS. (stack traces below). The thing is, I'm doing an md5Hash on the NSData objects every single time I store them and retrieve them just to make sure they are not corrupted, and the exact same NSData that is working one minute as an argument to initWithRTF(D), makes it crash later on. I'm using garbage collection, but I've solved a lot of GC problems and this doesn't seem similar. Has anyone got any thoughts? What else have you tried? http://developer.apple.com/technotes/tn2004/tn2124.html http://www.sealiesoftware.com/blog/archive/2008/09/22/ objc_explain_So_you_crashed_in_objc_msgSend.html Enjoy a safer web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy
That's a good trick to know! When I bracket the calls thus, it crashes in a different but similar place: #00x95a82688 in objc_msgSend #10x90894910 in processColor #20x9089395b in CharAttr #30x9088db34 in -[NSRTFReader attributedString] #40x9070bc03 in _NSReadAttributedStringFromURLOrData #50x90709943 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:] #60x9088c542 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithRTF:documentAttributes:] #70x908e6f25 in +[_NSRTFPboardTypeConverter pasteboard:provideDataForType:] #80x908e6b58 in __NSPasteboardProvideData #90x918dd120 in __CFPasteboardResolvePromiseForItemLocal #100x918e0680 in CFPasteboardCopyData #110x9086763e in -[NSPasteboard _dataWithoutConversionForType:] #120x9086748a in -[NSPasteboard dataForType:] And then if I bracket the call to dataForType: as well, the crashes stop happening. I'm relieved to know I at least have a workaround. Does this tend to indicate some kind of Apple GC bug? From: Ali Ozer ao...@apple.com To: Chris Idou idou...@yahoo.com Cc: Cocoa Dev cocoa-dev@lists.apple.com Sent: Tuesday, 31 March, 2009 4:12:55 PM Subject: Re: EXC_BAD_ACCESS and NSAttributedString driving me crazy Can you try temporarily disabling garbage collection around the unarchiving of RTFD, and see if it helps? [[NSGarbageCollector defaultCollector] disable]; ... unarchive your RTFD ... [[NSGarbageCollector defaultCollector] enable]; Ali On Mar 30, 2009, at 5:25 PM, Chris Idou wrote: I'm getting NSRTFDPboardType and NSRTFPboardType objects as NSData from the pasteboard and I'm storing them in a core data XML repository and getting them out again, and when necessary I'm converting them into NSAttributedString with initWithRTF or initWithRTFD. This mostly works but every now and then, actually quite often, this initWithRTF(D) crashes with EXC_BAD_ACCESS. (stack traces below). The thing is, I'm doing an md5Hash on the NSData objects every single time I store them and retrieve them just to make sure they are not corrupted, and the exact same NSData that is working one minute as an argument to initWithRTF(D), makes it crash later on. I'm using garbage collection, but I've solved a lot of GC problems and this doesn't seem similar. Has anyone got any thoughts? #00x95a82688 in objc_msgSend #10x933b0b26 in -[NSCFDictionary setObject:forKey:] #20x90824684 in -[NSRTFD setObject:forKey:] #30x908f3c2f in -[NSAKDeserializer deserializePList:] #40x908f3961 in -[NSDocumentDeserializer deserializeNewPList] #50x908f3753 in -[NSRTFD(NSSerializationSupport) initWithPasteboardDataRepresentation:] #60x908f2fe9 in -[NSFileWrapper initWithSerializedRepresentation:] #70x908f2e32 in -[NSRTFReader initWithRTFD:] #80x9070b9a7 in _NSReadAttributedStringFromURLOrData #90x90709943 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:] #100x908f2de2 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithRTFD:documentAttributes:] .. #00x95a82688 in objc_msgSend #10x90894910 in processColor #20x9089395b in CharAttr #30x9088db34 in -[NSRTFReader attributedString] #40x9070bc03 in _NSReadAttributedStringFromURLOrData #50x90709943 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithData:options:documentAttributes:error:] #60x9088c542 in -[NSAttributedString(NSAttributedStringKitAdditions) initWithRTF:documentAttributes:] . Program received signal: “EXC_BAD_ACCESS”. Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/aozer%40apple.com This email sent to ao...@apple.com Enjoy a better web experience. Upgrade to the new Internet Explorer 8 optimised for Yahoo!7. Get it now. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSLog fixes output, but why?
Should we assume you have eliminated the obvious, that the arguments to NSLog don't have any method calls with side effects? Or are there multiple threads whose timing could be changed by the logging? From: James Maxwell jbmaxw...@rubato-music.com To: Cocoa Dev cocoa-dev@lists.apple.com Sent: Thursday, 19 March, 2009 9:05:31 AM Subject: NSLog fixes output, but why? I've got a really frustrating, and really silly problem. I have some fairly complex machine learning code I'm working on. I've noticed inconsistent output from a particular method. I'm doing some fairly nasty array and matrix stuff, which is all done in C, and I pass the arrays around wrapped in NSData objects. What's really strange is that, in this particular method, if I place an NSLog after calling and unwrapping a particular 2D matrix, then the output is as expected. If I remove the NSLog, the output is incorrect (or at least, unexpected). The system is pretty complex, and involves 4 different classes, so I won't post it here, and obviously I don't expect any magical help. But does anybody have any experience with something this flaky? Whereby literally adding a single NSLog (and thus obviously slowing things down a fair bit) makes the method run correctly?... It's just bizarre, to me. Maybe somebody here has worked their way into a similar corner? Obviously I've done something stupid somewhere, but I don't really know how to go about finding it. It was weird enough to realize that the NSLog could make or break my output - tracking down the actual reason why is just baffling... Everything being done in these classes is basically procedural stuff, so it doesn't seem like timing should dramatically influence the output. But I am doing *lots* of iterations over this data. Does that suggest anything? Any thoughts very much appreciated. cheers, J. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox ___ 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
Enforcing trial software on Mac
Is there any accepted, or preferred or standard way of enforcing a trial software period for a program on Mac, so that people can't just delete their preferences or something and start the trial again? Or does every developer hack their own little solution? (i.e. write a file to an obscure place). Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox ___ 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
Getting the front process path
I thought I'd figured out how to get the path of the currently running process: GetFrontProcess, then CopyProcessName, and then [[NSWorkspacesharedWorkspace] fullPathForApplication:app] This works most of the time, but some programs, for example Aquamacs Emacs, has just Aquamacs in the titlebar, and this gets returned by CopyProcessName. But fullPathForApplication can't find it unless you pass in the full Aquamacs Emacs. How do I fix this problem? Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox ___ 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
FOLDERS and document based apps (Open Recent)
If I add public.folder to my Info.plist as a valid type of document my app can open, some things don't work. Open Document doesn't work, albeit its not too hard to get around by subclassing NSDocumentController and redefining the openDocument: However Open Recent is more tricky because as far as I can tell its all hidden and invisible in the guts of NSDocumentController. Has anyone got any tips about changing the behavior of Open Recent? Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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: Adding Multiple NSWindow or NSPanel into another NSWindow
You can have an MDI interface on the Mac, but you have to do all the hard work yourself, because there is no MDI widgets provided. One alternative is a tabbed interface. There is some free code somewhere that does a Safari-like tabbed interface. Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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: At what point during loading can NSPersistentDocument fetch?
readFromURL is the appropriate place to start populating the document. From: Jerry Krinock je...@ieee.org To: Cocoa Developers cocoa-dev@lists.apple.com Sent: Tuesday, 17 February, 2009 12:49:44 PM Subject: At what point during loading can NSPersistentDocument fetch? My NSPersistentDocument subclass contains a singular managed object which I'd like to make an observer immediately after the document is loaded. So I invoked my little fetcher method to get it during -init, after invoking super, but was surprised to find that the fetch returned empty at this point. I found the same behavior in Apple's DepartmentAndEmployees [1] sample project by adding these two methods to the MyDocument implementation: - (void)logDepartment { // -department fetches the singular 'department' [2] NSLog(@ 'Department': %p, [self department]) ; } - (id)init { self = [super init] ; NSLog(@Fetch during init:) ; [self logDepartment] ; NSLog(@Fetched after delay) ; [self performSelector:@selector(logDepartment) withObject:nil afterDelay:0] ; return self ; } Here's the console log I get upon opening an existing document file: 17:06:02.259 Fetch during init: 17:06:02.268'Department': 0x0 17:06:02.269 Fetched after delay 17:06:02.388'Department': 0x1dc730 Besides the fact that it's a kludge, the performSelector:withObject:afterDelay occurs too late for my purposes. So, I've got one fetch that's too early and one that's too late. I looked in the debugger's call stack but don't see any other intermediate method I could legally hook in to. There are other ways I could set my observer, but I'm quite surprised that executing a fetch in an initialized NSPersistentDocument doesn't return a qualified object which is definitely in there, and understanding this might help me with other issues. Note that executeFetchRequest:error: is happy to return the incorrect answer of an empty array -- it does not set an NSError. Can someone please explain at what point, during loading, an NSPersistentDocument becomes ready to fetch and return correct results? Thanks as always, Jerry Krinock Note: In MyDocument.m, there is an implementation of -initWithType:error: which inserts a 'Department', but that method only runs for new documents and is not involved here. I'm trying to fetch a 'Department' from the store/file. [1] http://developer.apple.com/samplecode/DepartmentAndEmployees/index.html [2] The following method is right out of the box of MyDocument.m, reproduced here for convenience. - (NSManagedObject *)department { // Apparently, 'department' is cached as an ivar for efficiency. if (department != nil) { return department; } // The remainder of this method, executing a fetch, only executes // the first time this method is invoked on a document. NSManagedObjectContext *moc = [self managedObjectContext]; NSFetchRequest *fetchRequest = [[NSFetchRequest alloc] init]; NSError *fetchError = nil; NSArray *fetchResults; @try { NSEntityDescription *entity = [NSEntityDescription entityForName:@Department inManagedObjectContext:moc]; [fetchRequest setEntity:entity]; fetchResults = [moc executeFetchRequest:fetchRequest error:fetchError]; } @finally { [fetchRequest release]; } if ((fetchResults != nil) ([fetchResults count] == 1) (fetchError == nil)) { [self setDepartment:[fetchResults objectAtIndex:0]]; return department; } if (fetchError != nil) { [self presentError:fetchError]; } else { // should present custom error message... } return nil; } ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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
RTFD - HTML ( NSHTMLTextDocumentType )
When converting an AttributedString to HTML per http://www.cocoadev.com/index.pl?HTMLFromRTFD all the links begin with file:///. So trying to open the result in a browser results in broken links for all the images since apparently file:/// signifies the root directory. Why aren't the links relative? Am I missing something obvious? Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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: Network communications help
From what you are saying, I would get the classic intro to UNIX network programming and read the part on sockets: http://www.amazon.com/UNIX-Network-Programming-Richard-Stevens/dp/0139498761 From: gumbo...@mac.com gumbo...@mac.com To: Cocoa-Dev List cocoa-dev@lists.apple.com Sent: Wednesday, 11 February, 2009 12:44:30 PM Subject: Network communications help I currently have a RealBasic application that manages a furnace temperature controller. Using the TCPSocket class in RB the app listens to a port and I can query this application from other computers on the LAN and set parameters of the temperature controller, by passing strings. What I would like to be able to do, is the same thing from my iPhone with a Cocoa application. I have only 3 years experience with Cocoa and none with network comms. Can someone please explain what would be the best way to achieve this and where I should start reading. Cheers Rob ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/cocoa-dev/idou747%40yahoo.com This email sent to idou...@yahoo.com Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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
FSExchangeObjects / FSReplaceObject
As I understand it, we are supposed to use FSReplaceObject because FSExchangeObjects does not properly retain all meta-data. But it seems like FSReplaceObject is not actually documented. Sure it is mentioned here and there in release notes and so forth, but there is no actual proper API documentation for it. Is this correct? Is it an oversight on Apple's part, or should I read more into it? Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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: Advanced NSTextView use
That didn't seem to help. I tried overriding selectedRanges, and that makes you delete the whole range when you are clicked in it (good), but nothing seems to help the case of trying to simply backspace from the end of the range. In this case the selected range is not relevant because you are not inside the range yet as far as the existing range, and you can't predict in advance the user intends to backspace into it, and for the same reason, neither is the rangeForUserTextChange. On Feb 3, 2009, at 5:24 PM, Chris Idou wrote: So I want it that if you try and delete any character that is part of a token, it deletes the entire token. So I'm overriding rangeForUserTextChange to return a different range if the current range includes any part of a token. This seems to work if the user tries to type in any part. For example, clicking on the token and pressing space bar or a letter. However, it doesn't work if you press backspace or delete, even though rangeForUserTextChange is still called. I don't think you really want to override that method. Instead override -[NSTextView selectionRangeForProposedRange:granularity:] which should be called for every selection the user makes. ~Martin Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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
Advanced NSTextView use
I'm trying to use NSTextView so that it has tokens in the text (kind of like NSTokenField). So I want it that if you try and delete any character that is part of a token, it deletes the entire token. So I'm overriding rangeForUserTextChange to return a different range if the current range includes any part of a token. This seems to work if the user tries to type in any part. For example, clicking on the token and pressing space bar or a letter. However, it doesn't work if you press backspace or delete, even though rangeForUserTextChange is still called. In this case it does nothing if the range is zero length, or it does the normal thing and ignores my range, if the user starts off with a range selected. Has anyone got any other ideas how to achieve this? Stay connected to the people that matter most with a smarter inbox. Take a look http://au.docs.yahoo.com/mail/smarterinbox ___ 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
Triggering NSTextView changes and bindings
I've got an NSTextView whose attributeValue is bound to a core-data object. I've got a menu item which programmatically modifies the NSTextView's contents. The programmatic changes don't trigger a modification to the underlying object unless the user tabs to and exits the NSTextView manually. What is the correct way, when programmatically modifying an NSTextView, to make sure the system propagates changes to underlying bindings? Make Yahoo!7 your homepage and win a trip to the Quiksilver Pro. Find out more ___ 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