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
Doc Block
Apr 15, 2003
Fun Shoe

lord funk posted:

Ew. Just found one of my 3rd party libraries creates its own thread locking class that wraps up an NSMutableArray. It's ugly and huge and doesn't dealloc properly. And there's a small rant at the top of the header which calls out Apple on 'voodoo bullshit' when passing NSMutableArrays around.

LOL post the rant.

Adbot
ADBOT LOVES YOU

Kallikrates
Jul 7, 2002
Pro Lurker
https://github.com/mrRay/vvopensource/blob/master/VVBasics/src/MutLockArray.h

first result of "voodoo bullshit nsmutablearray"

Doc Block
Apr 15, 2003
Fun Shoe
LOL

:qq: "You can't read & write to NSMutableArray at the same time without bad things happening! :argh:"
:qq: "You can't pass my class that isn't descended from NSMutableArray to something expecting an NSMutableArray because of Apple's 'voodoo bullshit'! :argh:"
:qq: "Foundation container classes use isEqualTo: instead of just comparing pointers!"

lord funk
Feb 16, 2004

Yeah I didn't want to call the guy out by name since I'm using his useful free software, but I did squint at the screen for a good minute trying to figure out what I was reading.

Flobbster
Feb 17, 2005

"Cadet Kirk, after the way you cheated on the Kobayashi Maru test I oughta punch you in tha face!"
Tried reading his rant on my phone, got sick of horizontally scrolling after about 10 screens-worth. On a big-rear end iPhone 6 Plus, even.

That just adds to the stupidity of the rant!

Doctor w-rw-rw-
Jun 24, 2008
I wish there was a corresponding __attribute__((objc_requires_override)); to clang's __attribute__((objc_requires_super));

Any chance of that happening?

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

lord funk posted:

Yeah I didn't want to call the guy out by name since I'm using his useful free software, but I did squint at the screen for a good minute trying to figure out what I was reading.

His selector names are awful; is rd really worth saving two characters over read? But it gets worse... Besides apparently not understanding class clusters or the point of isEqual, he also undermines himself by exposing a ton of non-thread-safe methods instead of using blocks promoting misuse everywhere and poorly duplicating the NSMutableArray methods. If he was going to go down that stupid dusty road he should have looked into NSProxy.

This automatically makes me suspicious of the entire library.

Hughlander
May 11, 2005

Anyone notice generateIdentityVerificationSignatureWithCompletionHandler's certs not validating after Apple switched to the new certificate over the weekend?


EDIT: figured it out, the signature algorithm changed, and I was hardcoding it to the old type not checking the signature to see what it was.

Hughlander fucked around with this message at 01:16 on Mar 3, 2015

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Doctor w-rw-rw- posted:

I wish there was a corresponding __attribute__((objc_requires_override)); to clang's __attribute__((objc_requires_super));

Any chance of that happening?

It's problematic because we can't see your entire class implementation; we'd have to require it to be defined in the main @implementation. But if you can live with that, we could make it happen.

dc3k
Feb 18, 2003

what.

Doctor w-rw-rw- posted:

I wish there was a corresponding __attribute__((objc_requires_override)); to clang's __attribute__((objc_requires_super));

Any chance of that happening?

I think I saw a snippet the other day that crashed your app on launch if you didn't override a method in a subclass that you were supposed to. Would that help?

Built 4 Cuban Linux
Jul 15, 2007

i own america

Built 4 Cuban Linux posted:

...
"/Users/.../Library/Developer/Xcode/DerivedData/.../Build/Intermediates/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/SwiftyJSON.framework: No such file or directory
Command /usr/bin/codesign failed with exit code 1"

/Applications/Xcode-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: can't move temporary file: /Users/.../Library/Developer/Xcode/DerivedData/...-.../Build/Intermediates/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/SwiftyJSON.framework/SwiftyJSON to file: /Users/.../Library/Developer/Xcode/DerivedData/...-.../Build/Intermediates/ArchiveIntermediates/.../IntermediateBuildFilesPath/UninstalledProducts/SwiftyJSON.framework/SwiftyJSON.lipo (No such file or directory)
...

Fixed it. CocoaPods isn't ready for Swift (at least when making extensions).

Got another question: anyone know a way to submit an app made with Xcode 6.3-beta for TestFlight testing? Application Loader & Xcode are both rejecting me because I'm using a beta Xcode. Seems sort of ridiculous that you can't beta tests apps made with Xcode beta. Any ways around this?

Built 4 Cuban Linux fucked around with this message at 03:35 on Mar 3, 2015

Glimm
Jul 27, 2005

Time is only gonna pass you by

Built 4 Cuban Linux posted:

Fixed it. CocoaPods isn't ready for Swift (at least when making extensions).

Got another question: anyone know a way to submit an app made with Xcode 6.3-beta for TestFlight testing? Application Loader & Xcode are both rejecting me because I'm using a beta Xcode. Seems sort of ridiculous that you can't beta tests apps made with Xcode beta. Any ways around this?

Apple's takeover of TestFlight as a whole seems pretty half baked :(

We've been using Crashlytics

Doctor w-rw-rw-
Jun 24, 2008

status posted:

I think I saw a snippet the other day that crashed your app on launch if you didn't override a method in a subclass that you were supposed to. Would that help?
Crashing at runtime is trivially easy. I want a slightly safer way to build an abstract base class (or class cluster, whatever) in ObjC - specifically, warnings when I forgot to implement something in a subclass.

rjmccall posted:

It's problematic because we can't see your entire class implementation; we'd have to require it to be defined in the main @implementation. But if you can live with that, we could make it happen.
I can. Apologies if I'm asking for something that is actually impossible; I'm just doing a frustrating and terrible refactor at the moment so I haven't thought through what's theoretically possible.

Also on the wish list are:
* NS_UNAVAILABLE equivalent that I can leave in public headers and turn off inside the implementation (or other headers, e.g. internal headers intended for subclasses) when I really want to. Unless I'm missing something and this is already possible, or impossible for good reason.
* @override for ObjC. Unless my brain is so addled at the moment that I'm forgetting something vital.

(I have like 3-4x the work to get done this week than I originally planned. My brain is stupid and tired this time of night.)

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Glimm posted:

Apple's takeover of TestFlight as a whole seems pretty half baked :(

I have so many things to say about this.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
To be clear, you should file a bug; I can't unilaterally volunteer us for unrequested ObjC work.

You really can't implement an unavailable method? That seems wrong. Unless you mean that you want an unavailable method that you can still use in the @implementation, in which I have to admit that we would never actually consider it worth our time to implement that, and you should just use one of the dozens of ways you can mock this up on your own (macros that remove the attribute, helper functions, "private" methods, performSelector...).

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe
I believe he wants it to spit out warnings or errors on every method he hasn't bothered to implement yet. Sort of like how C++ compilers tend to spit out errors if you leave one or more functions as pure virtual from the base class. I think.

Doctor w-rw-rw-
Jun 24, 2008

rjmccall posted:

To be clear, you should file a bug; I can't unilaterally volunteer us for unrequested ObjC work.

You really can't implement an unavailable method? That seems wrong. Unless you mean that you want an unavailable method that you can still use in the @implementation, in which I have to admit that we would never actually consider it worth our time to implement that, and you should just use one of the dozens of ways you can mock this up on your own (macros that remove the attribute, helper functions, "private" methods, performSelector...).

kode54 posted:

I believe he wants it to spit out warnings or errors on every method he hasn't bothered to implement yet. Sort of like how C++ compilers tend to spit out errors if you leave one or more functions as pure virtual from the base class. I think.
Right. The things I was looking for were:

1. Base class that isn't useful on its own uses an attribute to force its subclasses to override a method in their main implementation. Currently, a similar effect can be had if one is willing to suffer runtime errors instead of compile warnings and runtime errors on erroneous calls to super.

The best semantics for this might be hard to get right. Does the attribute allow the class to forego defining the method, or does it simply require the subclass override it? (probably the latter) If the same method is declared in the subclass's header with the same attribute, does that mean that the subclass's subclasses require implementation? (probably, but that means that two identical declarations have two subtly different effects)

2. Adding an "override" attribute to method implementations that warns or errors when the compiler can't determine what it's overriding

Are those reasonable enough to propose in a radar? I'd rather bounce ideas against you to see what would stick enough to file a radar on before doing so.

Also - When you say "macros that remove the attribute", are you saying there's a way to negate attributes? I thought you could only apply attributes, not remove them.

(As for the other thing, with making NS_UNAVAILABLE methods usable again, that was a half-baked idea that I didn't really think through. Might have a good reason I'd want to use it later.)

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Doctor w-rw-rw- posted:

Right. The things I was looking for were:

1. Base class that isn't useful on its own uses an attribute to force its subclasses to override a method in their main implementation. Currently, a similar effect can be had if one is willing to suffer runtime errors instead of compile warnings and runtime errors on erroneous calls to super.

Right, we were talking about this before, you should file it.

Doctor w-rw-rw- posted:

2. Adding an "override" attribute to method implementations that warns or errors when the compiler can't determine what it's overriding

Reasonable, even fits in with some other stuff we're doing, please ask for it.

Doctor w-rw-rw- posted:

Also - When you say "macros that remove the attribute", are you saying there's a way to negate attributes? I thought you could only apply attributes, not remove them.

Your understanding is correct. I mean that you can use macros to prevent the attribute from being added in the first place, like a system header would.

Doctor w-rw-rw- posted:

(As for the other thing, with making NS_UNAVAILABLE methods usable again, that was a half-baked idea that I didn't really think through. Might have a good reason I'd want to use it later.)

No worries, just wanted to be clear that it was vanishingly unlikely we'd do anything there.

It's almost always possible to take any given feature and just add refinement after refinement ad infinitum. For central features like @properties, that's worthwhile, and anyone looking at the feature set of properties might notice they've had a little bit of effort put into making them expressive. For peripheral features like unavailable, we're happy to iterate to make the core model more "correct", but adding new avenues of complexity isn't really desirable; that's partly because we don't want somebody approaching the feature to feel completely daunted or confused by it, but it's also just because there's only so much engineering/documentation/evangelism time we have, and skimping on any of those kindof makes the whole effort pointless.

Hughlander
May 11, 2005

Hey rjmcall, can you go kick someone in GC operations please...

https://sandbox.gc.apple.com/public-key/gc-sb.cer
code:
        Validity
            Not Before: Feb 28 00:00:00 2013 GMT
            Not After : Mar  1 23:59:59 2015 GMT
It's after March 1 and the Certs aren't updated and I'm tired of explaining it to QA.

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Hughlander posted:

Hey rjmcall, can you go kick someone in GC operations please...

https://sandbox.gc.apple.com/public-key/gc-sb.cer
code:
        Validity
            Not Before: Feb 28 00:00:00 2013 GMT
            Not After : Mar  1 23:59:59 2015 GMT
It's after March 1 and the Certs aren't updated and I'm tired of explaining it to QA.

Did you file a radar? I'd be extremely surprised if rjmcall is able to make any major impact here.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Hi, I'm your churlish neighborhood compiler engineer and language designer. Things I can do include explaining C++ minutiae and ranting about ISAs and ABI designs. Things I cannot do include replacing the logic board on your MacBook Pro and janitoring the server configs behind URLs I have literally never seen before in my life. I hope you're having a great day here at the Apple Development thread.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Does GC stand for Game Center? I don't know if that's even under the Craig, it's probably Eddy Cue. I wouldn't remotely know who to ask about that, sorry; I'd just be filing a bug with absolutely zero context.

Hughlander
May 11, 2005

Yes I filed it. And my apologies it came off way less tongue in cheek when written then when I imagined it. Wasn't meant to imply this thread as tech support but to warn others running into the same issue like earlier in the week with the production gamecenter encryption type changing.

I'll go back to my hole now

lord funk
Feb 16, 2004

Why did I implement air drop file sharing. It's so flaky.

Found peer!
Changing state to connecting!
Accepted invitation!
Not connected.

:confuoot:

lord funk
Feb 16, 2004

What is going on? :psyduck: I've turned off an iPad and restarted the other device's app and it's seeing the iPad that's turned off. :wtc:

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

I assume that it's the OS and not the app that's managing the communications, since you can hand off to an app that's not running.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
I wish Xcode schemes weren't so goddamn opaque. Previously I've enjoyed the complete lack of logging for pre- or post-whatever scripts. Now I run into an issue with Awful where one framework target's Archive is using Debug, another is using Release, and so one can't import the other. Naturally the app's Archive is set to a nonexistent xcconfig that is neither Debug or Release. Xcode apparently deems none of this worth mentioning, leaving me to randomly stumble into the scheme editor flailing desperately for some idea of what's going on.

Anyway, if you can't figure out why frameworks are working great in Debug but not Archive, check your schemes.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

So you can now download code and feed it to standalone JSC, not just WebKit. The React Native folks are pretty psyched.

Doc Block
Apr 15, 2003
Fun Shoe
I don't think that's meant to be a way around submitting updates for review, so I don't see why the React Native people are so excited unless that's their plan. I hope Apple rejects any apps that try to bypass the app review process by being written mostly in JavaScript and fetching the app's code from the developer's server as a way of pushing out updates.

What's the point of app reviews and a (mostly) safe, curated app store if apps can download updates outside of the app store?

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Doc Block posted:

I don't think that's meant to be a way around submitting updates for review, so I don't see why the React Native people are so excited unless that's their plan. I hope Apple rejects any apps that try to bypass the app review process by being written mostly in JavaScript and fetching the app's code from the developer's server as a way of pushing out updates.

What's the point of app reviews and a (mostly) safe, curated app store if apps can download updates outside of the app store?

I don't know how else to interpret the exception, especially along with the caveat that it can't change the purpose of the app. What else would motivated the change?

Apps have always been able to download things that would put them outside of review guidelines; a game updating its assets to include explicit images is one extreme example, and anything that used a webview to do the downloading and execution would be a less extreme one.

Changing your recipe app into a match-3 game is going to get you spanked. Fixing a bug or changing your layout or adding post preview to Awful isn't, I'm pretty sure. It's virtually certain that someone will test this experimentally soon, so we'll know.

Doc Block
Apr 15, 2003
Fun Shoe

Subjunctive posted:

I don't know how else to interpret the exception, especially along with the caveat that it can't change the purpose of the app. What else would motivated the change?

Apps have always been able to download things that would put them outside of review guidelines; a game updating its assets to include explicit images is one extreme example, and anything that used a webview to do the downloading and execution would be a less extreme one.

Changing your recipe app into a match-3 game is going to get you spanked. Fixing a bug or changing your layout or adding post preview to Awful isn't, I'm pretty sure. It's virtually certain that someone will test this experimentally soon, so we'll know.

Isn't the only change that they included JavascriptCore in the exception?

Updates should have to go through App Review. It completely defeats the purpose of a safe, curated App Store if you can do otherwise. That some apps have done this and still made it into the App Store isn't an argument against requiring updates to go through the review process.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Doc Block posted:

Isn't the only change that they included JavascriptCore in the exception?

Yes, so you can now download code without having to feed it to a webview. You've always been able to do it and feed it to a webview, but that's much more restrictive in terms of the flexibility of how the code is structured. (Good luck passing objects to native, f.e.)

Doh004
Apr 22, 2007

Mmmmm Donuts...
Hey, anyone use any A/B testing third party services for their apps? I've been tasked with researching some and I've found lists of the "best" ones to use but they all sound the same. I trust your opinions much more so than random blogger #21082.

Thanks!

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Writeup of FB's Components system, which is being readied for source release. I think Doctor has mentioned it in the past here.

http://www.objc.io/issue-22/facebook.html

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
For some reason I never realized that Objective-C++ lets you use C99 features not in C++ like designated initializes. I always thought it replaced the C with C++, rather than grafting things together.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

Plorkyeran posted:

For some reason I never realized that Objective-C++ lets you use C99 features not in C++ like designated initializes. I always thought it replaced the C with C++, rather than grafting things together.

It is all one glorious blob. Go hog wild with _Generic, too.

(Don't use it in a template function signature, we literally haven't decided how to mangle that yet.)

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe
I misread that to mean something about dynamically compiled code, which is something I know Apple will never allow. I wonder how their App Store review feels about console emulators that accept user supplied data, when the only function is to generate music?

LP0 ON FIRE
Jan 25, 2006

beep boop
In Xcode's console, I'm carefully tweaking variables while my program is running to achieve a desired effect. I'll then print out all those values and copy them into my code. I've been activating/deactivating break points and continuing the program via key commands after I entered a value at the (lldb) prompt, i.e. "expr waterLine.sinMult = 4.2f", but now all of the sudden it stopped responding to stopping at breakpoints even though they are activated, pausing or even stopping the application.

At least I can see my latest values that the console automatically printed upon changing, but it's still annoying. Has this happened to anyone else here, and there is a solution to getting the debugger to respond again?

Blakles
Mar 10, 2008

I have lived a great deal among grown-ups. I have seen them intimately, close at hand. And that hasnt much improved my opinion of them.
Hoping someone can guide me in the right direction. I am building a very basic iPad app where a user basically scrolls through screens all coming from one navigation controller. On every view, I need to have another view (I will call it a menu view) that slides into the frame when a button is clicked and then slides back out of frame when another button is clicked. This menu view does not cover the entire screen so whatever view they are on will be seen behind this menu view.

I am using storyboards and would like to have this menu view in the storyboard as well. I can very easily do this by adding the menu view as a sub-view to each controller, but that seems very tedious and inefficient. I could also make the menu view shown by modal segue, but it makes the entire frame slide in instead of just the small bar that I have.

I'm still learning iOS development and just wondered if anyone had suggestions on the best way to handle this where I can reuse one storyboard view controller across all other view controllers in the way I need. Any advice is appreciated. Thanks!

Here's what I have in my storyboard:

Navigation Controller --> View Controller 1 --> (View Controller A [-->more view controllers...], View Controller B [-->more view controllers...], View Controller C [-->more view controllers...])
Menu View Controller (need to be able to animate this partial view in across all other view controllers)

Adbot
ADBOT LOVES YOU

Kallikrates
Jul 7, 2002
Pro Lurker
There is no built in way to do that. The usual approach is a containing view controller that animates your navigation controller stack over top of the menu.

There are many libraries to do this. If you decide to do this on your own, don't try and do it by subclassing a navigation controller.

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