Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
fankey
Aug 31, 2001

Doc Block posted:

Assuming you're adding it the way I mentioned earlier, I don't think SVGKit is the problem. I just built and archived a test app that contains SVGKit and it got added to the iOS Apps section of the Organizer window.

SVGKit is the only 3rd party framework I'm including and moving the source directly into my project fixed the issue so there was some interaction with the framework that was causing issues. It could be a setting in my own project causing the issue but without any information from Xcode as to what the actual problem is I'm not sure what's going on.

Adbot
ADBOT LOVES YOU

Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

fankey posted:

SVGKit is the only 3rd party framework I'm including and moving the source directly into my project fixed the issue so there was some interaction with the framework that was causing issues. It could be a setting in my own project causing the issue but without any information from Xcode as to what the actual problem is I'm not sure what's going on.

Were you archiving the correct scheme? Did the archive's bundle identifier still match your app or did it change?

fankey
Aug 31, 2001

Ender.uNF posted:

Were you archiving the correct scheme? Did the archive's bundle identifier still match your app or did it change?

As far as I know I was archiving the correct scheme - I only have one defined in my project. The version and Identifier are blank in the Archive manager and the Type is 'Generic XCode Archive'.

Doc Block
Apr 15, 2003
Fun Shoe
Was your project linking to the right SVGKit platform (iOS)? If the archiver finds something it doesn't like inside the final built product then (if it builds the archive at all) it will call it a "Generic Xcode Archive".

fankey
Aug 31, 2001

Doc Block posted:

Was your project linking to the right SVGKit platform (iOS)? If the archiver finds something it doesn't like inside the final built product then (if it builds the archive at all) it will call it a "Generic Xcode Archive".

Yes, libSVGKit-iOS.2.0.0.a is listed in Linked Frameworks and Libraries. I removed SVGKits references to CocoaLogger and still had the issue. As this point I think I'm going to leave the source directly in my project and move on.

Doc Block
Apr 15, 2003
Fun Shoe
You could always open the archive and see what's in there. Like apps, the bundle is just a folder. Right click->Show Package Contents

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Has anyone figured out how to properly test deferred in-app purchases? I set simulatesAskToBuy on the SKPayment and... it continues entirely as normal. I also can't seem to create tester accounts which have a parent-child relationship. Should I worry about it or just send this, untested, into the wild? The reports I've seen on stackoverflow and the apple developer forums seem to be all along the lines of "I dunno!"

fankey
Aug 31, 2001

Doc Block posted:

You could always open the archive and see what's in there. Like apps, the bundle is just a folder. Right click->Show Package Contents

Would having the SVGKit headers included in the archive cause the issue? They are in /Products/usr/local/include. If so, how do I stop them from being included? I tried setting Skip Install to be Yes on SVGKit but that didn't remove them from the archive.

Doc Block
Apr 15, 2003
Fun Shoe
I'm not sure. When I'm back at my computer I'll check my little test app (which archives successfully) and see.

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe
I've been trying out the new Xcode 8, and I have yet to figure out what I need to enable in my build or run settings to make the Runtime Issues page populate. I'm pretty sure I have some Runtime Issues, since I know there are some leaked objects here and there, especially file handles.

(For instance, I cannot add more than 10-12k files to a playlist at once, without running out of file handles and the rest failing. Then info retrieval fails for the whole lot, because the handles are still allocated. My file access is through an Objective C @protocol declaration, and nothing seems to be retaining the files with a strongly typed variable anywhere, but they're not being released. Also, the Instruments panel isn't showing the source address for some of the variables or functions in my project, so maybe some debug information is being discarded somewhere? Hard to tell...)

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Good lord almighty, Apple really doesn't want to make Core Data version migrations simple, do they?

After a day of working on it and cobbling together bits of information from StackOverflow and various blog posts, I finally figured out how to do a reasonably simple custom migration, and write unit tests for it that actually execute properly. Either I'm slow as molasses or the migration process should be way better documented than it is (maybe both!)

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe
I gave up on Xcode 8 and deleted it from my system, after even attempting to build and link something with Xcode 7 caused it to attempt to import headers from the macOS 10.12 SDK, which resulted in such lovely errors as missing headers for random things. I don't recall what off hand, but it was something I didn't feel like tracking down and fixing. First time I've ever used AppCleaner on an Xcode bundle.

EngineerJoe
Aug 8, 2004
-=whore=-



My app has a photo picker that's crashing in the iOS 10 simulator, I tried a sample app and it crashes just the same, so that's good I guess. If anyone here is running 10 on a real device, I'd love it if you can try this sample on it and test out the Take/Select Photo button.

http://www.appcoda.com/ios-programming-camera-iphone-app/

Nevermind, I found this: https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/270

stuffed crust punk
Oct 8, 2004

by LITERALLY AN ADMIN

EngineerJoe posted:

My app has a photo picker that's crashing in the iOS 10 simulator, I tried a sample app and it crashes just the same, so that's good I guess. If anyone here is running 10 on a real device, I'd love it if you can try this sample on it and test out the Take/Select Photo button.

http://www.appcoda.com/ios-programming-camera-iphone-app/

Nevermind, I found this: https://github.com/phonegap/phonegap-plugin-barcodescanner/issues/270

They did this with location services a few versions ago. A descriptive debugger message would have been nice

lord funk
Feb 16, 2004

Xcode can be a real nightmare sometimes, but I just renamed a product / workspace and everything didn't implode like it used to. So, uh, well done I guess.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane

lord funk posted:

Xcode can be a real nightmare sometimes, but I just renamed a product / workspace and everything didn't implode like it used to. So, uh, well done I guess.

Have you completed and exported a build yet? That's where it all came crashing down for me last time I renamed things!

stuffed crust punk
Oct 8, 2004

by LITERALLY AN ADMIN
Has refactoring completely poo poo the bed lately, even in objc?

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

PT6A posted:

Good lord almighty, Apple really doesn't want to make Core Data.

Fixed this for you.

And, yeah, migrations are a pain and hard to find help on. It's probably not helped by the fact that most app developers are probably using it as a read-through cache for a server and don't give a gently caress about data integrity between versions.

lord funk
Feb 16, 2004

PT6A posted:

Have you completed and exported a build yet? That's where it all came crashing down for me last time I renamed things!

I'm just as surprised as you are. I didn't have to go digging into .xcodeproj files or nothin'. Pretty sure my git remote is hosed, but whatever. This was all in prep to throw onto GitHub anyway.

lord funk
Feb 16, 2004

Okay where is your GitHub account stored in Xcode? It keeps committing under an old GitHub username. I deleted the Keychain login for that username, but it's still finding it somehow.

edit:

git config --global user.email

lord funk fucked around with this message at 00:51 on Jul 8, 2016

Huckleduck
May 20, 2007
giving you the hucklebuck
Anyone have any experience with WKView's evaluateJavaScript?

I can't get it to call functions in the JavaScript side of things, especially those with parameters. Or rather, the function in JS is being called, but all parameters are undefined, nothing is being passed in.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I've never had a problem. How are you calling it? Post some code.

Huckleduck
May 20, 2007
giving you the hucklebuck

let input = "new data"
self.webView!.evaluateJavaScript("drawUpdate(\(input));") { (response, error) in
print("fired eval JS, response was \(response) and error was \(error)")
}


From lldb I get:

fired eval JS, response was nil and error was Optional(Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={NSLocalizedDescription=A JavaScript exception occurred})

Vesi
Jan 12, 2005

pikachu looking at?

Huckleduck posted:


let input = "new data"
self.webView!.evaluateJavaScript("drawUpdate(\(input));") { (response, error) in
print("fired eval JS, response was \(response) and error was \(error)")
}


How about :

self.webView!.evaluateJavaScript("drawUpdate('\(input)');") { ...

Huckleduck
May 20, 2007
giving you the hucklebuck
Alas, no change.

Huckleduck
May 20, 2007
giving you the hucklebuck
So this is where things get weird.
JavaScript Side

// posts data to the native app.
function callNativeApp (string) {
var message = {'message' : string}
try {
webkit.messageHandlers.callbackHandler.postMessage(message);
} catch(err) {
console.log('The native context does not exist yet');
}
}

// receives data from the native app
function drawUpdate(input) {
callNativeApp('dataUpdate was called with input of '+input);
callNativeApp('updated data!');
}


Calling drawUpdate from the native code with this:

let input = "new data"
self.webView!.evaluateJavaScript("drawUpdate('\(input)');") { (response, error) in
print("fired eval JS, response was \(response) and error was \(error)")
}


I get this from lldb (my callback handler just prints what was received from the JS side :

fired eval JS, response was nil and error was Optional(Error Domain=WKErrorDomain Code=4 "A JavaScript exception occurred" UserInfo={NSLocalizedDescription=A JavaScript exception occurred})
Received Callback from JS with this info: {
message = "dataUpdate was called with input of undefined";
}
Received Callback from JS with this info: {
message = "updated data!";
}


From this I can tell that evaluateJavaScript is in fact firing the javascript command. But it's not getting the input. Thoughts?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

What's the JS exception? Can you use the Safari debugger to see it?

Huckleduck
May 20, 2007
giving you the hucklebuck
Solved the problem, maybe.

EvaluateJavaScript wasn't actually doing anything except causing that JavaScript exception. I swapped that out for:


let input = "new data"
let userScript = WKUserScript(
source: "drawUpdate('\(input)');",
injectionTime: WKUserScriptInjectionTime.AtDocumentEnd,
forMainFrameOnly: true
)
self.webView!.configuration.userContentController.addUserScript(userScript)


And the JS side is now receiving data. This is fine, but I suspect it isn't the right way to do things. I kinda just want to understand how evaluateJavaScript works and what I was doing wrong.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Then what was calling your function?

Huckleduck
May 20, 2007
giving you the hucklebuck
I had done the add userScript bit of code in my viewDidLoad, as I was creating my webview.

I mistakenly thought that adding a script to my webView configuration was the only for evaluateJavaScript to work. In fact, adding a script also runs it.

Doc Block
Apr 15, 2003
Fun Shoe
I'm thinking about filing a feature request for tvOS & the remote app for iOS, but wanted to see what other tvOS/iOS devs thought before I did. Here goes:

Right now, if you play a game for AppleTV with the Remote app on your iPhone, when Remote.app is in Game Controller Mode you get this:



Which doesn't really help players know what to do. "Why doesn't the Play/Pause button pause the game?" (because when acting as a game controller, the Siri remote's Play/Pause button works as the A button instead, and Remote.app works the same way), it doesn't tell them that Select is the same as clicking the Siri remote, etc.

And while Apple could simply solve this by changing the buttons to "Click" and "A" instead, it'd be nice if games could change the Remote.app button text at run-time to be more contextual:



This could be done with 2 simple properties on the Microgamepad profile (which are simply ignored when set for an actual Siri remote)
Objective-C code:
@property (nonatomic, copy) NSString *dpadClickButtonTitle;        // or some other appropriate property name
@property (nonatomic, copy) NSString *buttonATitle;                // ditto
Allowing them to be set at run-time would enable the game to change the button titles based on context, so they could be changed to "Accept" and "Back" or some such when navigating the game menu, etc.



Better still would be allowing custom images, which could be stored in Xcode image assets and transferred to Remote.app when it's connected to the game as a controller.





Best case would be allowing the use of multiple image assets and letting the game change between them based on context. For example, when entering the game's menu, the game could change the button images from the above to this:



This could be done with a method on the Microgamepad profile (that gets ignored when called for a real Siri remote):
Objective-C code:
- (void)setButtonImageAsset:(NSString *)assetName;        // each image asset would have images for both buttons, so only one method call is needed
With the asset names also specified in Info.plist so Remote.app can start transferring them right away. To make sure the image assets that will be needed first are transferred first, Remote.app could simply transfer them in the order they appear in Info.plist, with developers made aware of this in the documentation. Something like a GCMicrogamepadImageAssets key with an array of strings, with each string being the name of an image asset.

And, of course, the image assets would be provided by the game in @2x and @3x sizes, with Remote.app copying the ones it needs for the iPhone size it's running on.

To keep games from going crazy with too many button images, there could be a limit on the number of button image assets allowed per game (say, 3 or 4).

Ideas? Thoughts? I'll probably file this as a feature request in a day or two, but I just wanted to see if other people thought this was dumb or had better ideas.

Doc Block fucked around with this message at 22:10 on Jul 8, 2016

Doc Block
Apr 15, 2003
Fun Shoe
At the very least, is it clear what I'm requesting?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
That makes total sense to me. Maybe pare it down to two images, one per button, specified in the Info.plist, with no code-level API. Easier for app review to handle. You can mention at the end that there's obvious room for expansion with multiple assets or a runtime API.

Then pull a quote from the iPhone unveiling keynote about how screens are better keyboards because you can easily change the keys.

Doctor w-rw-rw-
Jun 24, 2008
Sounds like a good feature request to me.

Btw, question: Is Apple still requiring games on AppleTV to support non-gamepad play? I'd suggest reporting that one too (because dupes->prioritization) if it makes sense. One of the biggest things holding the AppleTV back from also being really competitive in the gaming console market, IMO.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Next tvOS allows an app to require proper game pad.

Doc Block
Apr 15, 2003
Fun Shoe
Yeah, tvOS 10 allows games to require a game controller. My understanding is that if you try to buy one but have never paired a game controller with your AppleTV it'll warn you, but still let you buy it.

Doctor w-rw-rw-
Jun 24, 2008
Sweet. I might finally buy a controller, then, since AAA titles will have a reason to port to tvOS.

Doc Block
Apr 15, 2003
Fun Shoe
If any Apple employees that work on tvOS or Remote.app see this, I filed the feature request as rdar://27267903

edit: Also filed on open radar: https://openradar.appspot.com/27267903

Doc Block fucked around with this message at 20:46 on Jul 10, 2016

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Is there a consensus continuous integration opinion? I setup Jenkins at an old job a few years ago when it took absolutely forever to get it all working with Xcode and code signing and certificates and specific Java settings and blech.

I just started a gig as the sole mobile developer, so I don't need much. A former employee here was using Bitrise, who I had never heard of. They seem decent.. free for 200 builds a month, $50 a month after that.

Adbot
ADBOT LOVES YOU

Kallikrates
Jul 7, 2002
Pro Lurker
All I know is don't use bots. At least not up through Xcode 7+. We use jenkins at work but we are pretty averse to 3rd party tools companies. A I see many people talk up Circle CI but have no first hand experience.

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply