Posts

Post not yet marked as solved
2 Replies
1.4k Views
I’m tracking down a bug report with a game that has a bunch of achievements that do work. I am trying to reveal the name of a hidden achievement once a player learns it is possible, but before they have any progress towards it. GKAchievement* a = [[GKAchievement alloc] initWithIdentifier: anAchievement]; a.percentComplete = 0; [GKAchievement reportAchievements: @[ a ] withCompletionHandler: ^(NSError * _Nullable error) { if (error != nil) { NSLog(@"revealAchievement: %@ failed %@", anAchievement, error); } }]; The documentation says “isHidden is set to NO anytime this method is invoked” but the achievement is not showing up in the UI. The achievement in question is returned by +loadAchievementsWithCompletionHandler:, but it is considered hidden there (lldb) po a <GKAchievement: 0x6000027993e0>id: MonsterKiller.DarkAge 0.000000 (lldb) p a.hidden (BOOL) $3 = YES I am pretty sure this code worked fine (it’s in a game that came out several years ago). Has Game Center changed (I know hidden is technically deprecated now, but I don’t see anything explaining how to reveal an achievement other than by using +reportAchievements:withCompletionHandler:. And yes, the achievement in question is configured on the server (it can be earned, just not revealed with zero progress).
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
2 Replies
2.9k Views
I’m using Xcode 12.2 to build a tool I normally run from a script. (Previously on macOS 10.14 and earlier.) When I build and run it from Xcode, it runs fine. If I try to run it from Terminal, I get the message Killed This is the first time I’ve used Big Sur, do I now need to worry about signing my own tool? I’ve attempted to have Xcode manage this, and Sign to Run Locally. But nothing seems to make a difference. How can I build a program to be run from command line, for Apple Silicon?
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
0 Replies
788 Views
I am going to be using AVAudioPlayer to play sound effects and looping music in a game. I haven’t been able to find any recent discussion of what format to use (given I almost certainly need to compress it). https://developer.apple.com/library/archive/documentation/AudioVideo/Conceptual/MultimediaPG/UsingAudio/UsingAudio.html#//apple_ref/doc/uid/TP40009767-CH2-SW28 is deprecated (and talks about “AAC” but afconvert -hf shows at least 7 different formats that can be saved in a CAF). Has that guide been updated? Does hardware vs software playback still matter in iOS 9+? I’m not really worried about performance in terms of impacting frame rate.
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
9 Replies
4.9k Views
I had set a breakpoint on objc_exception_throw, and added the debugger command po $arg1 (as mentioned in the latest WWDC, or http://natashatherobot.com/xcode-debugging-trick/For a while it worked great, but I recently updated Xcode and now I geterror: use of undeclared identifier '$arg1'Is there a new way to get the actual exception when you hit it?
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
1 Replies
1k Views
I just saw a developer claim that the App Store will no longer accept 32-bit builds. Which presumably means we won’t be able to submit universal. I had wanted to continue to support our few remaining iPad 2 customers, but it sounds like that won’t be possible. I haven’t had any luck finding any official statement about this. I’ve been using Xcode 13.1 and it still lets me target iOS 9…
Posted
by ddunham.
Last updated
.
Post marked as solved
1 Replies
580 Views
I just updated to Xcode 13.0. Now every time I choose a file in a File Review window/tab, Xcode decides I want to see line numbers. I have line numbers turned off in Preferences. And since I am using a GUI, and have side-by-side comparisons on, there is no reason I need line numbers. They take up space and make a side-by-side comparison less useful. There doesn’t appear to be a preference, is there a CLI default I can set?
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
4 Replies
1.9k Views
I just realized that my game has some problems on the iPad mini’s 2266×1488 screen. It’s actually a UIKit app, and I do a fair amount of adapting to different screen sizes. However, my designer made the (then-reasonable) assumption that iPad screens were at least 768 points high. The mini is only 744 points, and so UI screens that were designed to exactly hold their content, don’t have enough room. If this were a Unity game, everything would probably just be scaled down a little from a 1024×768 display. Is there a way to do that as a UIKit app? This wouldn’t be ideal, but it would let mini owners play the game.
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
2 Replies
3.8k Views
I’m preparing an update and can’t post it until I have 6.5 inch (iPhone XR) screen shots. I don’t own a device, so I am trying to take them from Simulator with File &gt; New Screen Shot. This generates 1792 * 828 pixel images, which are rejected for not being 2688 * 1242.How do I get the full resolution screen shot while running Simulator? (Choosing Pixel Accurate doesn’t seem to make a difference.)
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
11 Replies
3.7k Views
I recently upgraded to Xcode 11 and ran into a very annoying problem: it is breaking my formatting when I copy &amp; paste lines of code (which happen to be in Lua or a DSL).I had been doing this for years, and what I copied was always pasted intact. I did some searching, and verified that “Re-indent on paste” was unchecked (as was “Indent when typing:” in the Indentation preferences).I am still on macOS Mojave, if that matters.Since I do this a lot, it is extremely frustrating. Is there a way to get the old (correct) behavior back?Note: I just filed FB7422240 since this seems to be a regression with no known workaround.
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
3 Replies
6.1k Views
I am migrating my game from UIWebView to WKWebView.I use HTML to show the game manual and lore.In the UIWebView version, I specified a font size in my CSS, and (as near as I can tell), UIWebView rendered text at that size.WKWebView is deciding on its own how to render. I have added this line to each HTML file&lt;meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no"&gt;but it doesn’t seem to give me consistent results. I actually seem to be getting a different type size depending on the amount of text (i.e. when it scrolls, it is larger!).I looked at https://webkit.org/blog/7367/new-interaction-behaviors-in-ios-10/ which seems to suggest that ignoresViewportScaleLimits is false by default and gives you the iOS 9 behavior (which is good because I need to support iOS 9). But I am not seeing any way to tell WKWebView to do no scaling and just show the font at the size I asked for. This is not arbitrary HTML that WK needs to guess at. It comes from a local file and is intended to match the rest of the UI.
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
1 Replies
594 Views
Just gave my game (which is landscape-only, and implemented with UIKit) a trial. My iPad is (naturally) in portrait mode. When I launched my game, the trackpad did not take the rotation into account.Is this a bug, or is there an API I need to use?(If I turn off rotation lock, things seem OK. But users should not have to do that.)
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
0 Replies
618 Views
I’ve got a game I would love to bring to macOS. Since it uses UIKit, Catalyst is the obvious choice. However, scaling my 1024 * 768 pt iPad game to 77% would be silly. Is there a way to make it pixel-identical in a 1024 * 768 window?
Posted
by ddunham.
Last updated
.
Post not yet marked as solved
1 Replies
1.1k Views
I’m trying to update an old Cocoa app to be 64-bit. It’s NSDocument-based, so I would like its windows to be tabbed, the way say TextEdit handles it.The “Show Tab Bar” item didn’t appear in the view menu. As an experiment, I set tabbingMode to preferred in the window .xib file. That made tabbing work — too much. All windows appeared in tabs, which is not what my users expect (or how the Dock preferences were set:p [NSWindow userTabbingPreference](NSWindowUserTabbingPreference) $0 = NSWindowUserTabbingPreferenceManual).I tried making a brand new app and everything just worked.The tabbingIdentifier is blank, so I would not expect windows to be grouped.Documentation for tabbing is a bit sparse, so any pointers on how to get the default Cocoa behavior would be appreciated.
Posted
by ddunham.
Last updated
.