Re: Mavericks CA Layer Issue
Hi Cody, Finally got the Working solution: We Subclassed CALayer and set it to Superview with WantsLayer and override masksToBounds property to return always NO. Question is: not getting why this is Mavericks specific? Is Apple fixed any issue in CALayer specific to this or it is a Bug in Mavericks? Regards, - Apparao Mulpuri On 12/23/13 12:57 AM, "Cody Garvin" wrote: >Did you make sure masksToBounds is set to NO? > >Please excuse mobile typos > >> On Nov 22, 2013, at 2:28 AM, Banisetty Avinash >> wrote: >> >> Hi All >> >> With latest Mac OS 10.9, I am facing an issue with layers. The issue is >>sublayers(CALayer) are not allowed to expand beyond the bounds of parent >>layer(CALayer), which is all working fine for rest of the OS Versions. >>We are using the 10.5 sdks and deployment target as 10.5 for our >>application. The truncations mentioned in the attachment is not >>happening for rest all OS versions. We haven't wrote any version >>specific coding or not changed any thing recently. So can you please >>help me to find out whether is there any work around. >> >> Issue: poker cards are added as sublayer to the player seat avatar on >>the game table. Player seat have some transparent part and that is the >>limit up to which cards are getting shown and beyond that limit >>everything is getting truncated. Adding more transparent layer may add >>to our woes as there may be variable number of cards and also increasing >>the transparent part would make us to recalculate all layers beside the >>poker cards. >> >> Thanks >> Ivy Dev >> This email and any attachments are confidential, and may be legally >>privileged and protected by copyright. If you are not the intended >>recipient dissemination or copying of this email is prohibited. If you >>have received this in error, please notify the sender by replying by >>email and then delete the email completely from your system. Any views >>or opinions are solely those of the sender. This communication is not >>intended to form a binding contract unless expressly indicated to the >>contrary and properly authorised. Any actions taken on the basis of this >>email are at the recipient's own risk. >> >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/cocoa-dev/cody%40servalsoft.com >> >> This email sent to c...@servalsoft.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: >https://lists.apple.com/mailman/options/cocoa-dev/apparaom%40ivycomptech.c >om > >This email sent to appar...@ivycomptech.com This email and any attachments are confidential, and may be legally privileged and protected by copyright. If you are not the intended recipient dissemination or copying of this email is prohibited. If you have received this in error, please notify the sender by replying by email and then delete the email completely from your system. Any views or opinions are solely those of the sender. This communication is not intended to form a binding contract unless expressly indicated to the contrary and properly authorised. Any actions taken on the basis of this email are at the recipient's own risk. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: HTML emails from Objective C
On 26 Nov 2013, at 21:16, Bryan Schmiedeler wrote: > I am trying to write an HTML email using Objective C. > > I have the HTML all done, now I am just putting it into mutable string line > by line. I am using / to escape when I need a quote in the HTML. > > This I think will work but sure seems tedious. Is there something I am > missing, some library that helps with this. Type your HTML in a text file, put that in your “Resources” folder, then use [[NSMutableString alloc] initWithContentsOfFile: … encoding:…] to load it, and maybe replaceOccurrencesOfString:… to fill in some placeholders? There are also some templating engines for things like this that handle things like filling in values more robustly and handle repeating sections etc. Cheers, -- Uli Kusterer “The Witnesses of TeachText are everywhere...” http://zathras.de ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing: Can't bookmark enclosing folder of user-selected file
___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: HTML emails from Objective C
On Nov 26, 2013, at 12:16 PM, Bryan Schmiedeler wrote: > I have the HTML all done, now I am just putting it into mutable string line > by line. I am using / to escape when I need a quote in the HTML. Are you saying you’re putting the HTML in hardcoded string constants in the code? Don’t do that. It’s awkward and it’s hard to maintain. Save the HTML in a file, add the file to your project, then use NSBundle to locate the resource file and then load it into a string or NSData at runtime. —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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iTune Plist changes from NSUserdefaults
On Dec 11, 2013, at 4:45 AM, Madhavi Gundeti wrote: > Please let me know what I am missing here. Why I am not able to change > these settings as root user. Because every user has their own defaults. If you use NSUserDefaults in a process whose userid is root, you’re changing the defaults of the ‘root' account, not a real user. —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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Sandboxing: Can't bookmark enclosing folder of user-selected file
Sounds to me you like you want to read up on the "Related Items" feature of the sandbox. On 22 Dec 2013, at 09:38, Leo wrote: > I'm sandboxing an app for the first time. The app has been out for a few > years by now, non-sandboxed. > > The app receives batches of PDF files and exports them with some changes. > Users can select files from NSOpenPanel or drag-and-drop. > > There are two options: > > -export files into a specific folder, or > -export each file into its original folder. > > The first option works with no problem: users select a destination folder in > NSOpenPanel, I create and then resolve the bookmark for this folder. Files > are being exported there as expected. > > > However, I'm not sure how to deal with the second option when each file > should be exported to its original enclosing folder. > > I tried to create a bookmark for file's enclosing folder when users add the > files: > > NSURL *url = [NSURL fileURLWithPath:[filePath > stringByDeletingLastPathComponent]]; > >NSData *bookmarkData = [url > > bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope >includingResourceValuesForKeys:nil >relativeToURL:nil >error:&err]; > > However, it results in this error: "The file “” > couldn’t be opened." > > As far as I understand, it happens because user selects the file, which still > doesn't grant the right to bookmark its enclosing folder. > > > If I create a bookmark for file's URL, I can't use this bookmark to export > the file: the bookmark doesn't grant permissions to the enclosing folder. > > > I did some extensive research and experimented with different options with no > luck. > > > What am I missing? How can I bookmark the enclosing folder of user-selected > file (if at all)? > > > Any help will be appreciated! > > > Thanks, > Leo > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/mabdullah%40karelia.com > > This email sent to mabdul...@karelia.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
On Dec 22, 2013, at 12:57 PM, Trygve Inda wrote: > So just declare it in a category and leave it out of the implementation? > > That of course gives me a warning that my implementation is incomplete. > > -(id)firstObject; The category should have no implementation (i.e. no @implementation NSArray (YourCategoryName) … @end). It's perfectly legal to have interface-only categories that merely declare methods. Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to accept drag of a URL on the dock icon?
Thanks, Ken. I stumbled onto the solution by way of an old page about how to drag text snippets onto the dock icon in an PyObjC app. Who knows how long I'd have been scratching my head if I hadn't guessed the same approach might work for URLs. For a minute it looked like I could use the same code to handle files dragged to the dock icon from the Finder. My service did get invoked, and it was passed an NSPasteboard that was superficially similar in that it contained URLs, in this case file URLs rather than web URLs. But when I tried to iterate through the file URLs I got messages like this: 2013-12-22 14:43:32.732 DockHow[34606:303] Failed to get a sandbox extensions for itemIdentifier (1). The data for the sandbox extension was NULL I didn't feel like messing with sandbox stuff, so I implemented application:openFiles: in addition to the service. And now I don't remember if that worked, because I decided I didn't really need to accept dragged URLs after all! But still, good to know for future reference. --Andy On Dec 21, 2013, at 7:48 PM, Ken Thomases wrote: > For what it's worth, this is documented somewhat in Cocoa Scripting Guide: > How Cocoa Applications Handle Apple Events – Apple Events Sent by the Mac OS > – Open Contents. > https://developer.apple.com/library/mac/documentation/cocoa/conceptual/ScriptableCocoaApplications/SApps_handle_AEs/SAppsHandleAEs.html#//apple_ref/doc/uid/20001239-1121328 > > Cheers, > Ken > > On Dec 21, 2013, at 5:22 PM, Andy Lee wrote: > >> To answer my own question, it looks like it's done by implementing a >> Service. I've gotten it working in a quick scratch application. >> >> --Andy >> >> On Dec 21, 2013, at 6:06 PM, Andy Lee wrote: >> >>> I know how to accept files that are dragged from Finder to the application >>> icon. It's a matter of adding some settings to Info.plist and implementing >>> the application:openFiles: application delegate method. >>> >>> This does not work for dragging URLs from a web browser -- for example, >>> dragging from Safari's URL field, or dragging an image being displayed in >>> Safari to the dock icon. What happens is, my application:openFiles: method >>> is never called, and the URL is given back to Safari to reload. >>> >>> Yet it is clearly possible for applications to accept dragging of URLs to >>> their Dock icons, because it works for other browsers. What are those >>> other browsers doing? >>> >>> I tried using a custom contentView for the dock tile, and having that view >>> be a drag destination (call registerForDraggedTypes: and implement >>> NSDraggingDestination methods). But that didn't make any difference. >>> >>> --Andy >> >> >> >> ___ >> >> Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) >> >> Please do not post admin requests or moderator comments to the list. >> Contact the moderators at cocoa-dev-admins(at)lists.apple.com >> >> Help/Unsubscribe/Update your Subscription: >> https://lists.apple.com/mailman/options/cocoa-dev/ken%40codeweavers.com >> >> This email sent to k...@codeweavers.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Mavericks CA Layer Issue
Did you make sure masksToBounds is set to NO? Please excuse mobile typos > On Nov 22, 2013, at 2:28 AM, Banisetty Avinash > wrote: > > Hi All > > With latest Mac OS 10.9, I am facing an issue with layers. The issue is > sublayers(CALayer) are not allowed to expand beyond the bounds of parent > layer(CALayer), which is all working fine for rest of the OS Versions. We are > using the 10.5 sdks and deployment target as 10.5 for our application. The > truncations mentioned in the attachment is not happening for rest all OS > versions. We haven't wrote any version specific coding or not changed any > thing recently. So can you please help me to find out whether is there any > work around. > > Issue: poker cards are added as sublayer to the player seat avatar on the > game table. Player seat have some transparent part and that is the limit up > to which cards are getting shown and beyond that limit everything is getting > truncated. Adding more transparent layer may add to our woes as there may be > variable number of cards and also increasing the transparent part would make > us to recalculate all layers beside the poker cards. > > Thanks > Ivy Dev > This email and any attachments are confidential, and may be legally > privileged and protected by copyright. If you are not the intended recipient > dissemination or copying of this email is prohibited. If you have received > this in error, please notify the sender by replying by email and then delete > the email completely from your system. Any views or opinions are solely those > of the sender. This communication is not intended to form a binding contract > unless expressly indicated to the contrary and properly authorised. Any > actions taken on the basis of this email are at the recipient's own risk. > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/cody%40servalsoft.com > > This email sent to c...@servalsoft.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: HTML emails from Objective C
On 26 Nov 2013, at 20:16, Bryan Schmiedeler wrote: > I am trying to write an HTML email using Objective C. > > I have the HTML all done, now I am just putting it into mutable string line > by line. I am using / to escape when I need a quote in the HTML. > > This I think will work but sure seems tedious. Is there something I am > missing, some library that helps with this. We publish KSHTMLWriter at https://github.com/karelia/KSHTMLWriter It may be a bit excessive for your needs I don't know; but takes full care of escaping characters for HTML/XML. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
> Yes. This method is there since 10.6 so you can safely call it. using latest > header or category on it. On Dec 23, 2013, at 1:49, Seth Willits > wrote: > On Dec 22, 2013, at 9:31 AM, Trygve Inda > wrote: > >> Available in OS X v10.6 and later. >> > >> This seems to be an error in the docs as the method does not seem to > exist >> for me. > > What do you mean? > > As I recall, when it was > announced at WWDC the method become public only recently, but they explicitly > said it was actually implemented since 10.6. So you can safely use it as the > docs mention. If you're not using the latest SDK(s) with the API change in it, > then you'll simply need to declare the method yourself in a category and it'll > work fine. > > > > -- > Seth Willits > > > > So just declare it in a category and leave it out of the implementation? That of course gives me a warning that my implementation is incomplete. -(id)firstObject; ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: HTML emails from Objective C
Can you post your code please? Op Nov 26, 2013, om 9:16 PM heeft Bryan Schmiedeler het volgende geschreven: > I am trying to write an HTML email using Objective C. > > I have the HTML all done, now I am just putting it into mutable string line > by line. I am using / to escape when I need a quote in the HTML. > > This I think will work but sure seems tedious. Is there something I am > missing, some library that helps with this. > > Thanks, > Bryan > > Bryan Schmiedeler > 12263 Rosewood Drive > Overland Park, KS 66209-3517 > bryanschmiede...@me.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: > https://lists.apple.com/mailman/options/cocoa-dev/diederik%40tenhorses.com > > This email sent to diede...@tenhorses.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
iTune Plist changes from NSUserdefaults
Hi, I am developing one MAC application to change iTunes Parental control setting programmatically. I am using NSUserdefaults class to achieve above. Please find the sample code. #define kBundleIdentifier @"com.apple.iTunes" NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; NSDictionary *defaultPreferences1 = [defaults persistentDomainForName: kBundleIdentifier]; [defaults synchronize]; NSMutableDictionary *mprefs = [defaultPreferences1 mutableCopy]; [mprefs setValue:@"YES" forKey:@"restrictExplicit"]; [mprefs setValue:@"YES" forKey:@"restrictMovies"]; [mprefs setValue:@"200" forKey:@"moviesLimit"]; [mprefs setValue:@"YES" forKey:@"restrictTVShows"]; [mprefs setValue:@"400" forKey:@"tvShowsLimit"]; [mprefs setValue:@"YES" forKey:@"restrictGames"]; [mprefs setValue:@"200" forKey:@"gamesLimit"]; [defaults removePersistentDomainForName:kBundleIdentifier]; [defaults synchronize]; //Adding modified Prefs [defaults setPersistentDomain:mprefs forName:kBundleIdentifier]; [defaults synchronize]; I have a daemon running as root user.But root user unable to set the iTunes preferences. When I run the above code as login user then the iTune parent control settings got changed. Please let me know what I am missing here. Why I am not able to change these settings as root user. I tried one more method also: NSString *usrPlistPath = @"/Users/madhavi/Library/Preferences/com.apple.iTunes.plist"; NSLog(@"Madhavi usrPlistPath is %@", usrPlistPath); NSDictionary *defaultPreferences = [NSDictionary dictionaryWithContentsOfFile:usrPlistPath]; [defaults registerDefaults:defaultPreferences]; [defaults synchronize]; [defaults setBool:YES forKey:@"restrictExplicit"]; [defaults setBool:YES forKey:@"restrictMovies"]; [defaults setBool:YES forKey:@"restrictTVShows"]; [defaults setBool:YES forKey:@"restrictGames"]; [defaults setInteger:200 forKey:@"moviesLimit"]; [defaults setInteger:400 forKey:@"tvShowsLimit"]; [defaults setInteger:200 forKey:@"gamesLimit"]; [defaults synchronize]; With the above code I am able to create Userdefaults as root user, but these values are not reflecting in plist. so that iTune preferences also not getting changed. It would be helpful to me if you provide any clue on above. How to change iTunes plist using NSUserdefaults as root user.(Because I don't want to change plist file directly) Please suggest me on this. Thanks and Regards, Madhavi G. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Question about adding NSTextView into a zoomed parent view (10.9)
Hi, guys. I have got a problem with adding NSTextView into a zoomed parent view. I've got the following situation: - A custom NSView in an NSScrollView, let's denote this NSView by viewA. - viewA is zoomed by -scaleUnitSquareToSize: - I create an instance of NSTextView with an NSScrollView (and all the other required classes of Cocoa text system) and add the scroll view into viewA. - I scroll the scroll view of viewA such that the newly added text view is visible by -scrollRectToVisible: - The app crashes after showing the zoomed NSTextView Odd points so far: - When viewA is not zoomed, then the app does not crash. - I first add the text view into unzoomed viewA, then remove it by -removeFromSuperview. Then zoom viewA and add the (used) textView again, then the app does not crash, however, the text view does not have the same magnification as viewA. - The code worked on 10.8, but now on 10.9 it crashes as described. If my description is too vague or not precise enough, you can also look at the source code: - https://github.com/qvacua/qmind/blob/issue-20/Qmind/QMMindmapView.m : This is the (zoomable) parent view. - https://github.com/qvacua/qmind/blob/issue-20/Qmind/QMCellEditor.m : In this class I add/remove the text view. To reproduce (on 10.9), you create a new mindmap, zoom in (by pinching for example), select the root node ("New Mindmap"), then enter the Return-key to edit the node. I don't see what I'm doing wrong... Any help would be greatly appreciated. Best, Tae -- @hataewon http://qvacua.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: OS X : Different icon for Status Item
Hi Jerry, there are two methods which are used with NSStatusItem: - (void)setImage: - (void)setAlternateImage: They both do exactly what you think they would. The setImage method just sets the standard image and alternate image is when it's activated. They both take an NSImage See the reference code: https://developer.apple.com/library/mac/documentation/Cocoa/Reference/ApplicationKit/Classes/NSStatusItem_Class/Reference/Reference.html Cheers Simon On 8 Dec 2013, at 3:47 pm, Jerry Krinock wrote: > How can I make my app’s Status Item (“menulet", right side of menu bar) have > a different icon than its icon shown in the Dock and Finder? > > I cannot find any mention of this in “Status Item Programming Topics”, and > tests indicate that it simply uses the same .icns resource indicated by > CFBundleIconFile in Info.plist. But I’ve seen other non-Apple apps do it, so > apparently it can be done. > > Thanks, > > Jerry Krinock > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/smaurice%40mac.com > > This email sent to smaur...@mac.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
DockTile sample code, Principal class is "DockTile" ?
In Apple's "DockTile" sample code there is a an app and a dock tile plug-in. In the DockTilePlugIn-Info.plist, the "Principal class" is valued as "DockTile", but there is no such class-- the class in the source code is "DockTilePlugIn". Isn't that a mistake? But the thing works anyway? The name of the bundle is "DockTile.docktileplugin", so... does "Principal class" really refer to the name of the bundle? Regardless, I can change the name of the finder file and it still works. In fact, I can delete the value for "Principal class" and it still works... although I can't be sure the working version of something wasn't cached somewhere... Probably a foolish question, but this is my first time with loadable bundles, I just want to understand... ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
HTML emails from Objective C
I am trying to write an HTML email using Objective C. I have the HTML all done, now I am just putting it into mutable string line by line. I am using / to escape when I need a quote in the HTML. This I think will work but sure seems tedious. Is there something I am missing, some library that helps with this. Thanks, Bryan Bryan Schmiedeler 12263 Rosewood Drive Overland Park, KS 66209-3517 bryanschmiede...@me.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: iOS screen physical size (or px density)
In the ideal world, you would scale your content to work on an arbitrarily sized UIView and not worry about actual screen dimensions/density. From my experience, this pays off most in the long run, especially when new devices come out. This involves designing your app so it doesn't use fixed size bitmap images and working toward a design with vector drawing art, or using stretching versions of image artwork. See here for example: -[UIImage resizableImageWithCapInsets:] There was a really great session from a recent WWDC that covered appearance customization. It's the best way to learn how to design your app to use custom artwork correctly and should be required viewing for iOS developers. Unfortunately, I can't discuss this on a public forum due to Apple restrictions on "confidential information" but registered Apple developers can email me for more info. Again, your time is best spent following best practices before trying to use specifics of an output screen. That said, here are some pointers to getting the actual size of the displays that your device is being output: -[UIScreen currentMode] https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScreen_Class/Reference/UIScreen.html#//apple_ref/occ/instp/UIScreen/currentMode -[UIScreenMode size] -[UIScreenMode pixelAspectRatio] https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIScreenMode_class/Reference/Reference.html#//apple_ref/occ/instp/UIScreenMode/ Good luck! Doug Hill On Mon, November 25, 2013 4:40 am, Roland King wrote: > Is there yet a supported way of finding out the actual screen size (or > equivalently pixel density) on an iOS screen? > > I have an app, uses autolayout, works fine on iPhone (one storyboard), > iPad (another storyboard) and mostly looks fine between iPad and iPad > mini. One screen however has a number of test 'cards' on it. On the phone > one card == one screen looks great. On a full-sized iPad, about 6 to a > page is clear, on a mini however 6 is not ideal and 4, or 3, looks much > better and is much clearer to test. That's one of the fairly rare cases > where one size doesn't fit all and knowing the actual screen dimensions > would make a better user experience. > > I know there was lots of chat about this when the mini came out, there > wasn't anything then and I don't want to do one of the version or device > name hacks. Is there yet an API point for this? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSUserDefault setPersistentDomain:forName: crash issue
Hi all, I am getting a crash as below when i am trying to set the dictionary for persistent domain. Attempt to set a non-property-list object as an NSUserDefaults/CFPreferences value abort() calledThread 0 Crashed:: Dispatch queue: com.apple.main-thread 0 libsystem_kernel.dylib 0x98cef952 __pthread_kill + 10 1 libsystem_pthread.dylib 0x90852167pthread_kill + 101 2 libsystem_c.dylib 0x9a783340 abort + 155 3 com.apple.CoreFoundation 0x9b6ad26b -[CFPrefsPlistSource alreadylocked_setValue:forKey:] + 203 4 com.apple.CoreFoundation 0x9b657ef4 -[CFPrefsSource alreadylocked_setValues:forKeys:count:] + 68 5 com.apple.CoreFoundation 0x9b7d4f40 ___CFXPreferencesReplaceValuesInSourceWithBundleID_block_invoke_2 + 96 6 com.apple.CoreFoundation 0x9b65dd39 +[CFPrefsSource withSourceForIdentifier:user:byHost:container:perform:] + 969 7 com.apple.CoreFoundation 0x9b7d4ecc ___CFXPreferencesReplaceValuesInSourceWithBundleID_block_invoke + 140 8 com.apple.CoreFoundation 0x9b65754c doSetValuesInSourceWithKVO + 348 9 com.apple.CoreFoundation 0x9b7d4e35 _ CFXPreferencesReplaceValuesInSourceWithBundleID + 101 10 com.apple.Foundation 0x939fc745 -[NSUserDefaults(NSUserDefaults) setPersistentDomain:forName:] + 250 *Scenario* When user logs in to my application in System Preferences pane, app receives a few settings from a server which is updated to NSMutableDictionary. After updating the dictionary , I set the the values for the domain using below code, - (void) saveUserDefaults; { [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:[[NSBundle bundleForClass: [self class]] bundleIdentifier]]; [[NSUserDefaults standardUserDefaults] setPersistentDomain:profileDefaults forName:[[NSBundle bundleForClass:[self class]] bundleIdentifier]]; [[NSUserDefaults standardUserDefaults] synchronize]; } The issue of crash is not consistently reproducible as well. Please help to understand as to when this kind of crash can occur ? thanks, ~PR ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Mavericks CA Layer Issue
Hi All With latest Mac OS 10.9, I am facing an issue with layers. The issue is sublayers(CALayer) are not allowed to expand beyond the bounds of parent layer(CALayer), which is all working fine for rest of the OS Versions. We are using the 10.5 sdks and deployment target as 10.5 for our application. The truncations mentioned in the attachment is not happening for rest all OS versions. We haven't wrote any version specific coding or not changed any thing recently. So can you please help me to find out whether is there any work around. Issue: poker cards are added as sublayer to the player seat avatar on the game table. Player seat have some transparent part and that is the limit up to which cards are getting shown and beyond that limit everything is getting truncated. Adding more transparent layer may add to our woes as there may be variable number of cards and also increasing the transparent part would make us to recalculate all layers beside the poker cards. Thanks Ivy Dev This email and any attachments are confidential, and may be legally privileged and protected by copyright. If you are not the intended recipient dissemination or copying of this email is prohibited. If you have received this in error, please notify the sender by replying by email and then delete the email completely from your system. Any views or opinions are solely those of the sender. This communication is not intended to form a binding contract unless expressly indicated to the contrary and properly authorised. Any actions taken on the basis of this email are at the recipient's own risk. <>___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
UISlider with custom images & narrow thumb
I'm trying to get a UISlider working with custom images. I've gone through the docs, and I know how to set the images. The question (and the problem) is a little different. Our design department has given us a thumb image that is wide at the bottom, and narrow at the top (1 pixel). When I use this image, it does not line up properly with the current value of the slider. All the examples I've seen on the net show a thumb that's fairly fat and round – never one like I've been given. The docs don't SAY you have to use a fat one, but it seems implied. So the question is: can I use a thumb like this, and if so, how do I get the positioning of the narrow top of the image (center) to align with the current value of the slider? Thanks in advance. This message and any attachment may contain information that is confidential and/or proprietary. Any use, disclosure, copying, storing, or distribution of this e-mail or any attached file by anyone other than the intended recipient is strictly prohibited. If you have received this message in error, please notify the sender by reply email and delete the message and any attachments. Thank you. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSTextTable with only certain text selectabled
How do I make a drag select on a NSTextView with an NSAttributedString that contains a 2 column NSTextTable, only select the text in the 1st column? You can see a video of the mac app skype doing this here: https://dl.dropboxusercontent.com/u/2510380/skype.mov Thanks! ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
On 22 Dec 2013, at 19:01, Fritz Anderson wrote: > > On Dec 22, 2013, at 11:46 AM, Michael Starke > wrote: > >> It's been a private API until 10.9 and iOS 7. Clearly a documentation error. > > That's not what NSArray.h says… > > - (id)firstObject NS_AVAILABLE(10_6, 4_0); > > … and that's closer to what I remember. Perhaps it was private at the time > the 10.6 SDK was first published, but made available retroactively later. > > But you should be able to find it in the SDK — what version are you building > against? > As said by others in this thread, it's there since 10.6 as private but if you use anything below 10.9 as SDK NSArray.h doesn't list a "firstObject". At least not with my SDK. But since it's there, going the way of declaring it yourself and then just calling it should work down to 10.6. I did just check 10.8 and it's NSArray.h doesn't show any sign of firstObject. > — F > > -- > Xcode 5 Start to Finish — due in stores in April > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com > > This email sent to michael.sta...@hicknhack-software.com ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 3686136 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
On Dec 22, 2013, at 11:31 AM, Trygve Inda wrote: [Quotes the documentation that says -[NSArray firstObject] is available since Mac OS 10.6.] > This seems to be an error in the docs as the method does not seem to exist > for me. I didn't see the method at all in the docs until I drew upon a very recent version of the documentation, and I see what you see. On Dec 22, 2013, at 11:46 AM, Michael Starke wrote: > It's been a private API until 10.9 and iOS 7. Clearly a documentation error. That's not what NSArray.h says… - (id)firstObject NS_AVAILABLE(10_6, 4_0); … and that's closer to what I remember. Perhaps it was private at the time the 10.6 SDK was first published, but made available retroactively later. But you should be able to find it in the SDK — what version are you building against? — F -- Xcode 5 Start to Finish — due in stores in April ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
Yes. This method is there since 10.6 so you can safely call it. using latest header or category on it. On Dec 23, 2013, at 1:49, Seth Willits wrote: > On Dec 22, 2013, at 9:31 AM, Trygve Inda wrote: > >> Available in OS X v10.6 and later. >> >> This seems to be an error in the docs as the method does not seem to exist >> for me. > > What do you mean? > > As I recall, when it was announced at WWDC the method become public only > recently, but they explicitly said it was actually implemented since 10.6. So > you can safely use it as the docs mention. If you're not using the latest > SDK(s) with the API change in it, then you'll simply need to declare the > method yourself in a category and it'll work fine. > > > > -- > Seth Willits > > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/xcvista%40me.com > > This email sent to xcvi...@me.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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
On Dec 22, 2013, at 9:31 AM, Trygve Inda wrote: > Available in OS X v10.6 and later. > > This seems to be an error in the docs as the method does not seem to exist > for me. What do you mean? As I recall, when it was announced at WWDC the method become public only recently, but they explicitly said it was actually implemented since 10.6. So you can safely use it as the docs mention. If you're not using the latest SDK(s) with the API change in it, then you'll simply need to declare the method yourself in a category and it'll work fine. -- Seth Willits ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: NSArray firstObject?
It's been a private API until 10.9 and iOS 7. Clearly a documentation error. On 22 Dec 2013, at 18:31, Trygve Inda wrote: > https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Founda > tion/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/2137-SW40 > > firstObject > Returns the first object in the array. > > - (id)firstObject > Return Value > The first object in the array. If the array is empty, returns nil. > > Availability > Available in OS X v10.6 and later. > See Also > – lastObject > Declared In > NSArray.h > > > > This seems to be an error in the docs as the method does not seem to exist > for me. > > Comments? > > > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > Please do not post admin requests or moderator comments to the list. > Contact the moderators at cocoa-dev-admins(at)lists.apple.com > > Help/Unsubscribe/Update your Subscription: > https://lists.apple.com/mailman/options/cocoa-dev/michael.starke%40hicknhack-software.com > > This email sent to michael.sta...@hicknhack-software.com ___m i c h a e l s t a r k e geschäftsführer HicknHack Software GmbH www.hicknhack-software.com ___k o n t a k t +49 (170) 3686136 cont...@hicknhack.com ___H i c k n H a c k S o f t w a r e G m b H geschäftsführer - maik lathan | andreas reischuck | michael starke bayreuther straße 32 01187 dresden amtsgericht dresden HRB 30351 sitz - dresden ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
NSArray firstObject?
https://developer.apple.com/library/mac/documentation/Cocoa/Reference/Founda tion/Classes/NSArray_Class/NSArray.html#//apple_ref/doc/uid/2137-SW40 firstObject Returns the first object in the array. - (id)firstObject Return Value The first object in the array. If the array is empty, returns nil. Availability Available in OS X v10.6 and later. See Also – lastObject Declared In NSArray.h This seems to be an error in the docs as the method does not seem to exist for me. Comments? ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: CALayer's delegate prevents implicit animation?
On 18 Dec 2013, at 21:46, Sean McBride wrote: > Wait, what? You're saying a CALayer's delegate can't be its parent NSView? > Why? Where does it say that? I've been doing that for years without > apparent problem. I'd be interested to hear more… It broke with 10.9 at the latest. From then on, NSView drawing code implements -drawLayer:inContext:, which breaks any use of the ‘content’ property of a CALayer whose delegate is a view. I don’t have any documentation, but the fact is it simply doesn’t work anymore in certain cases, which is an obvious sign Apple doesn’t expect you to do this. To be safe (not to mention avoid the obvious code smell of making a view a controller), use a separate object as the delegate. Cheers, -- Uli Kusterer “The Witnesses of TeachText are everywhere...” http://zathras.de ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Sandboxing: Can't bookmark enclosing folder of user-selected file
I'm sandboxing an app for the first time. The app has been out for a few years by now, non-sandboxed. The app receives batches of PDF files and exports them with some changes. Users can select files from NSOpenPanel or drag-and-drop. There are two options: -export files into a specific folder, or -export each file into its original folder. The first option works with no problem: users select a destination folder in NSOpenPanel, I create and then resolve the bookmark for this folder. Files are being exported there as expected. However, I'm not sure how to deal with the second option when each file should be exported to its original enclosing folder. I tried to create a bookmark for file's enclosing folder when users add the files: NSURL *url = [NSURL fileURLWithPath:[filePath stringByDeletingLastPathComponent]]; NSData *bookmarkData = [url bookmarkDataWithOptions:NSURLBookmarkCreationWithSecurityScope includingResourceValuesForKeys:nil relativeToURL:nil error:&err]; However, it results in this error: "The file “” couldn’t be opened." As far as I understand, it happens because user selects the file, which still doesn't grant the right to bookmark its enclosing folder. If I create a bookmark for file's URL, I can't use this bookmark to export the file: the bookmark doesn't grant permissions to the enclosing folder. I did some extensive research and experimented with different options with no luck. What am I missing? How can I bookmark the enclosing folder of user-selected file (if at all)? Any help will be appreciated! Thanks, Leo ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderators at cocoa-dev-admins(at)lists.apple.com Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com