Posts

Post marked as solved
11 Replies
1.8k Views
I have been using this code for a long time to get App Store reciepts: NSError *theError = nil; NSBundle *mainBundle = [NSBundle mainBundle]; NSURL *appStoreReceiptURL = [mainBundle appStoreReceiptURL]; NSData *receiptData = [NSData dataWithContentsOfURL: appStoreReceiptURL options: NSDataReadingMappedAlways error: &theError]; if (!receiptData) { NSURL *receiptURL = [mainBundle URLForResource: @"receipt" withExtension: @""]; receiptData = [NSData dataWithContentsOfURL: receiptURL options: NSDataReadingMappedAlways error: &theError]; } Now it has stopped working. I have had to use both methods to get a URL to the _MASReceipt/ directory because XCode seems to do it differently when debugging. Now the application crashes the second time I try to get recieptData. Both methods return a URL with a path to @"Contents/_MASReceipt/reciept. The first time I use dataWithContentsOfURL the error and data ptr are nil. The second time the app crashes and I get a warning that the app is damaged and to download a new copy from the App Store. Looking at the build folder it appears that XCode isn't creating a _MASReceipt folder. Do I have to put some special build instructions in the project to fix this? Why did this stop working? Before when I couldn't get a valid receipt the program would exit and ask me to enter my test user id and password. Then it would attach a valid receipt and run the app.
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
1 Replies
299 Views
There are a lot of other questions in the forums like this but they are so old that I thought I should start a new one. I want to add an outlet connection from my file's owner to an NSButton in a .xib. I can't do it. The NSButton is declared as an IBOutlet NSButton *myButton; in my .m file. In my .xib the button's class is declared as NSButton. When I control drag from the NSButton in Interface Builder to the File's Owner's New Referencing Outlet well in the pop-up or the File's Owner in Placeholders nothing happens. There are three other IBOutlets that were in my .m file that are connected. Since I upgraded to XCode 13.3 I can't connect the fourth IBOutlet in my .m file to objects in my .xibs. This has always been easy but now it can't be done in XCode 13.3. I spent a LONG time trying to do this but I can't. The Help documentation doesn't even begin to resemble what I actually see in XCode at all, starting with: "In Interface Builder, open the assistant editor (choose View > Assistant Editor > Show Assistant Editor)". What? There's no such menu item in the View menu. Is this a new super horrible bug in XCode? Should I file a bug report? Does anyone else have this problem?
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
8 Replies
1.2k Views
I recently switched to Mac OS 12 and XCode 13. I did some work on my application and rebuilt it. Now there is no Help Book. I didn't change the property lists and everything looks right. When I open the Help Book the application either opens a window with a message that the content is currently unavailable or it opens a Help Book window with no content. When this second thing happens the log window shows "entering AHRegistered help Book" but it doesn't appear. Does anyone have any suggestions?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
12 Replies
1.2k Views
I read the Apple Help Programming Guide. I very carefully re-organized my help book folders so the help book is localized (which I don't need to do). I had to edit the HTML files to get some links to work. Now that I renamed my help book folder to a .help it's a bundle and the file opening dialog in the 2015 Help Indexer application won't open it so I have to create a folder with a copy of the files and use that to create an index since the Help Indexer application doesn't support drag and drop either. Should I be indexing the .help bundle or the English.lproj folder that contains the index in the examples? The documentation is ambiguous, In the Help Book Registration section it gives two examples of how to register the help Book. First it says the <key>CFBundleHelpBookFolder</key> should be <string>SurfWriter.Help</string> then in the illustration it has it as Surf Writer Help. Then it has the <key>CFBundleHelpBookName</key> as <string>com.mycompany.surfwriter.help</string> but in the illustration it has it as Surf Writer Help. Which is it? The help Book is still not searchable but I'll clear the cache with the terminal command: rm -rf ~/Library/Caches/com.apple.help* and see if it helps. Like almost all of the Developer documentation the Apple Help Programming guide is not current and needs work. Sorry if these questions have been asked before. The Developer Forums seem to be broken. No matter what I search for there are no previous posts.
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
7 Replies
836 Views
When I set the icon for a file using[[NSWorkspace sharedWorkspace] setIcon: myImage forFile: [[sheet URL] path] options: NSExcludeQuickDrawElementsIconCreationOption];2019-11-21 14:34:44.954590-0700 Appname[4856:152311] [default] Invalid image size X: 1024 Y: 1152XCode 11.2.1 correctly sets the file icon to myImage but logs the error 14 times. This didn't happen in older versions of XCode. The Developer Documentation doesn't say anything about any particular requirements for the size if the NSImage. Setting the the options to either one of the two options doesn't change the error. Is this a spurious error? Am I missing something. Should I file a bug report?
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
1 Replies
481 Views
I have an NSSavePanel with a custom accessoryView in my Mac OS application. The accessory view is a popup menu with a list of file types that the user can use to save the file. I can initialize file name to be saved with a default .type when I am initializing the NSSavePanel, using [savePanel setNameFieldStringValue: (NSString*)fileName]; but not when I run the panel with [savePanel runModal]. The IBAction that is called when the user selects a new file extension creates a file name with the new file type extension but when the IBAction invokes the [savePanel setNameFieldStringValue: (NSString*)newFileName]; the name isn't updated in the panel. The savePanel and its nameFieldString don't respond to the setNeedsDisplay method. This needs to work so that the user can see what type of file he is saving to and also the savePanelDidEnd method uses this name to create a URL for saving the file with the file name and extension. There is a delegate method for the NSOpenSavePanelDelegate, panelSelectionDidChange. If I implement this as a delegate method will it work? The thin and very old developer documentation describes how to attach an accessory panel but not how to make it change the fileName.
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
4 Replies
432 Views
I’m trying to re-design a window in an .xib with XCodde 11.2.1. I want to delete an NSView but I can’t. I can’t drag it to the trash. When I highlight it in the hierarchy pane the Cut and Delete items are disabled. Using all of the possible modifier keys does nothing. I tried to drag it to the last position in the hierarchy but it still can’t be deleted and it also copies all of its sub-elements. If I cut and paste it it also copies all of its children in the hierarchy. The only way I can figure out how to do delete it is to start over with a new .xib and laboriously reenter all of the sub-views and manually reconfigure them. Is there any way to delete a view from the hierarchy? Isn't this this a bug? Is it a feature request? Should I file a bug report?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
8 Replies
4.5k Views
XCode 11.1 is so buggy that I can't use it to update a Mac OS X application. It can't deal with a lot of UI objects in .xibs and it logs many, many errors.I tried unsuccessfully to get it using time machine but it won't run. Is there somewhere I can get version 10.3?
Posted
by Tlaloc.
Last updated
.
Post not yet marked as solved
9 Replies
747 Views
I added a custom NSBox from the list of UI elements in interface builder to a window in a .xib. If the pop-up menu for custom is selected I can select the margins, frame color and width, etc. But when I run the program XCode reports an error:2019-10-07 09:55:37.680639-0600 Appname[1291:278976] Failed to set (keyPath) user defined inspected property on (NSBox): [&lt;NSBox 0x1006109a0&gt; setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key keyPath.This only happens when the Custom popup menu is selected. Is there some way to supress this error? Is this a problem in XCode 11? Can I fix this?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
4 Replies
5.1k Views
Since I switched to XCode 11 I get a a huge list of warnings: views without any layout constraints may clip their content or overlap other views. These are in non-resizeable panels or windows that don't use autosizing. My target OS is 10.10. I've tried to fix this by using all three options in the text field width, both options in the layout menu and checking/unchecking the lines in the autoresizing box but none of these things get rid of the warnings. Generally Interface Builder doesn't show the layout constraints inthe .xib. Also the popup menu asking me to add the needed layout attributes doesn't fix this.What can I do?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
1 Replies
380 Views
When I start my machine and also at random times I get an Alert warning me that I need the Java SDK to develop command-line applications. I'm not a Java developer and I don't want to develop command line scripts with Java. How can I make this stop?I've looked in my libraries for possible launch items that could be causing this but I can't find anything.I posted a similar question on the Apple support discussions and nobody seems to know what is causing this.
Posted
by Tlaloc.
Last updated
.
Post marked as solved
3 Replies
909 Views
I am rewriting the code I use to validate App Store receipts to use ComonCrypto instead of openssl. In my project is a folder named "_MASReceipt" with an example receipt that I got from Apple, called "receipt". When I call the NSURL method[code]NSURL *receiptURL = [[NSBundle mainBundle] appStoreReceiptURL];[/code]I get a URL that appears to be correct: "Contents/_MASReceipt/receipt.But when I use the URL to open the receipt, for example:[code]NSError *theError;NSData *receiptData = [NSData dataWithContentsOfURL: receiptURL options: NSDataReadingMappedAlways error: &amp;theError];[/code]The NSData pointer is nil and the NSError contains this error:domain: @"NSCocoaErrorDomain" Code: - 260Code 260 is a file not found error.Why cant the URL I get from the mail bundle be used to open the file?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
3 Replies
18k Views
This morning when launching my OS X application in XCode it it logs two strange messages that I haven't seen before:2018-07-29 12:11:57.265197-0600 appname[1642:302161] flock failed to lock maps file: errno = 352018-07-29 12:11:57.265620-0600 appname[1642:302161] flock failed to lock maps file: errno = 35In the header file sys/errno.h this is defined as:/* non-blocking and interrupt i/o */#define EAGAIN 35 /* Resource temporarily unavailable */This isn't a fatal error, the app runs normally after this. The project appears to log this before the multiple doc appplication loads its first doc window. I don't think I changed anything since yesterday when this wasn't happening.What does this mean and how can I fix it?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
2 Replies
5.5k Views
I put a new build on iTunes but I haven't submitted it for review. I wan't to submit this same version and build with a minor change before I do. I can't figure out how to delete the existing build on iTunes Connect Can. this be done?
Posted
by Tlaloc.
Last updated
.
Post marked as solved
1 Replies
264 Views
I have built an application for a newer version of OS X than what is on the App Store. The minimum version on the store is 10.6. The new version is build for 10.10. I can't see how I would update this on iTunes. The build settings and the Info.plist are set for 10.10. Will selling this automatically update the listing on iTunes?
Posted
by Tlaloc.
Last updated
.