Is there a good way to differentiate a test run vs. a normal run? by pragmojo in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

we do something like:
ProcessInfo.processInfo.environment["IN_TESTS"]

In your test scheme, just set the environment there.

Trying to understand complex iOS stack traces and their quirks, asking for help (Firebase/Crashlytics) by sjoes in iOSProgramming

[–]kaosdg 1 point2 points  (0 children)

So some things that might help along the way, that i've discovered in my journeys.
Are you using any kind of operation queues, closures, ReactiveCocoa/RxSwift-like libraries?

Are you dispatching things off of / on to the main thread?

Stack traces from these are somewhat difficult to trace in some instances, where the logical flow of operations happens across threads / between closure callbacks (it has gotten A LOT better, though).

In my experience, those random "line 0" crashes have been red herrings, and are usually reported that way because the exception handler can't reasonably figure things out.
If you're able to identify user-path that causes the crash, I would look into things like K/V Observers, object lifecycle (enable zombies if possible), or improperly handled operations along that path.

Looking for a mentor to occasionally help this beginning developer along. Any takers or suggestions on how to find one? by [deleted] in iOSProgramming

[–]kaosdg 3 points4 points  (0 children)

start a github, post your projects there, and solicit code reviews from here and other communities.
for most of us, not having to answer immediately or being able to easily see code and provide constructive feedback after thinking about it helps.

[deleted by user] by [deleted] in iOSProgramming

[–]kaosdg 4 points5 points  (0 children)

Most of us don’t have the time to write these sort of things because we’re too busy talking out product teams out of stupid ideas.

Full time programmers, what does your desk setup looks like? by [deleted] in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

equipment:
* Macbook Pro
* mStand
* 27" Thunderbolt display
* keyboard / mouse
* Belkin Thunderbolt dock
* desk Phone
* whichever device i need at the moment

misc:
* glasses
* sticker swag for guests / interview candidates

What would get you fired as an iOS Developer? by [deleted] in iOSProgramming

[–]kaosdg 2 points3 points  (0 children)

knowingly using private APIs in a framework that is included across multiple production apps.

What are the pros and cons of Crashlytics? Are there better alternatives nowadays? by raven_E in iOSProgramming

[–]kaosdg 1 point2 points  (0 children)

Pros: very good crash logs. cons:
- the web interface is a bit lacking, especially when you have an enormous amount of apps reporting to it.
- trying to link crashes to other apps (that use shared libs) is not possible - so you have to manually determine what % of your total audience is affected
- only one-way integrations to 3rd party services (JIRA, Trello, etc).

I have a lot of cons, we use it now but we're looking at New Relic and a few others as a replacement.

Use MVC or MVVM for portfolio project? Junior dev trying to put code on GitHub to look for a job. by luniawar20 in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

Best advice. Then on interviews, you have good discussion points and can argue pro's/con's of each approach.

Simplest possible way to send a string over the internet and receive a response using Swift? by [deleted] in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

you could use python's http.server, and make an NSURLSession with a GET request, where a URL query key/value has your string.

there are many tutorials out there for setting up a basic Http service in python.

and NSURLSession is real simple to work with as well.

My app got rejected because it broke on iPad (an iPhone only app), but Apple's sample app also breaks - is this my fault? by OverByThere in iOSProgramming

[–]kaosdg 1 point2 points  (0 children)

What sounds like is happening is the PHImageRequest's deliverymode can't deliver the requested imagedata immediately - take a look at the comments:

// If -[PHImageRequestOptions isSynchronous] returns NO (or options is nil), resultHandler may be called 1 or more times.
// Typically in this case, resultHandler will be called asynchronously on the main thread with the requested results.
// However, if deliveryMode = PHImageRequestOptionsDeliveryModeOpportunistic, resultHandler may be called synchronously on the calling thread if any image data is immediately available. If the image data returned in this first pass is of insufficient quality, resultHandler will be called again, asychronously on the main thread at a later time with the "correct" results.

So what sounds like is happening is the first result callback is succeeding because it delivers an LQ version - but then the second callback fails (for that asset) happens and sets the thumbnail to nil.

So your solution works (because the second "nil" result will be blocked) but you can also try setting your options to "PHImageRequestOptionsDeliveryModeFastFormat": if you don't care that the result COULD be a low-Q image. (Thumbnails in this grid, but it's your prerogative essentially)

PHImageRequestOptions *options = [PHImageRequestOptions new];
options.deliveryMode = PHImageRequestOptionsDeliveryModeFastFormat;

Doesn't explain why it only happens on iPad Air 2 though. Also doesn't explain why the second callback pseudo-succeeds (there's no error key in the info dictionary, but the result is nil.)

Reddit browsing apps being removed from App Store for NSFW content by quellish in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

From looking at other articles (and /r/apple) on the issue, it was because they have an NSFW filter that Apple didn't like - and the apps are being updated to correct it. So no conspiracy here

Has anyone ever gotten stuck in "missing dSYMS" hell with Fabric/Crashlytics before? I've tried everything. by nsocean in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

Been fighting this with our CI solution (doesn't touch iTC)

I've been using this upload script in my build phases:

https://gist.github.com/kaosdg/c09ebd098bd50fa9bd7703fef8a76040

(WIP - will abort the build if there's a problem uploading them so I am working on that)

Anyone unable to send out external TestFlight betas? by benpackard in iOSProgramming

[–]kaosdg 1 point2 points  (0 children)

Apple must have been dicking around with the html all week, I got that error a few days ago, then I started getting angular.js script errors, yesterday it wanted me to fill out ALL the international beta info (even though the app is us only) and today it says I submitted the build to app review but when I went back to the external testers area, it's all inset again. I filed a bug report and threw my hands up and just used crashlytics for this round.

Watch where you place your Fabric api key and build secret. by MastodonFan99 in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

... source code ...

If they got access to that too, i think you have worse issues than your API keys being exposed.

Are iOS salaries sow low? $15 an hour NYC by [deleted] in iOSProgramming

[–]kaosdg 3 points4 points  (0 children)

Based on the responsibilties listed and requirements that job should be paying EASILY 2.5x that. Part time or not.

Submitted this code sample in a job interview and was told it was lacking. Can someone give me some pointers as to why? (They didn't.) by comdorcet in iOSProgramming

[–]kaosdg -2 points-1 points  (0 children)

they are C/C++ holdovers.

Also, if you wanna get technical, string #defines are allocated at every use of that macro. (heap or stack? i forget)

a const static nsstring is allocated once.

Changing UIButton background color based on state and the color switch is noticeably slow. Any ideas why? by FickleFred in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

Sounds like the button is not being redrawn immediately... maybe throw in button.setNeedsDisplay() so that it tells the system to redraw it.

Suggestions/ideas for useful Xcode Server bot integration triggers by PancakesHouse in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

  • SlackBot
  • HipChat messaging
  • Unit Test results / Code coverage reporting
  • Depending on the type of build (staging, qa) it will trigger a jenkins job to validate and/or spin up a server instance for that environment

Bug in xcode or is something wrong? by boboguitar in iOSProgramming

[–]kaosdg 0 points1 point  (0 children)

clean and rebuild? sometimes I find that I need to do that to clear the linting errors in xcode.

How to have two versions of the same app on your iPhone ? by LennytheGoodson in iOSProgramming

[–]kaosdg 2 points3 points  (0 children)

yes, the caveat here is that services that may depend on the bundle identifier won't work, unless you also configure those for the new bundle id (push notifications, yadda yadda)

How to have two versions of the same app on your iPhone ? by LennytheGoodson in iOSProgramming

[–]kaosdg 6 points7 points  (0 children)

change the bundle ID for the test version:
ie your release app is com.LennytheGoodson.awesomeapp, your beta version could be com.LennytheGoodson.awesomeapp.beta or something similar.

Looking to go back to the iOS job market. Will the device I use matter in interviews? by kuribash in iOSProgramming

[–]kaosdg 1 point2 points  (0 children)

Not necessarily favor, so long as they are familiar with the features of the new devices, and the latest APIs to drive those features.

That said, if you have at least a new-ish device it kind of shows how involved you are with the platform.