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
Simulated
Sep 28, 2001
Lowtax giveth, and Lowtax taketh away.
College Slice

hackbunny posted:

I'm getting NSURLErrorNotConnectedToInternet when I try to use a v6 IP address as the hostname of NSURLRequest.URL, I assume because the network has no IPv6 connectivity. However, the IPv6 address is just a mapped IPv4 address (e.g. ::ffff:10.0.0.1), and it seems NSURLConnection is being too smart for its own good because regular sockets handle the same address just fine. Is there anything I can do, save for unwrapping the address back into an IPv4 address?

Why am I using NSURLConnection instead of NSURLSession? super-old critical code I won't touch unless absolutely necessary

Why an IP address as the HTTP hostname? Because NSURLConnection either doesn't support DNS failover or its implementation is far too slow for our standards, and there is no way to replace the resolver used by NSURLConnection. I doubt NSURLSession would help because even Safari fails to connect when the "wrong" node is down. Don't worry! I set the Host header manually and I replace the IP address with the hostname in the SSL policy (:barf:)

Why an IPv4 address mapped to IPv6? Because I'm adding IPv6 support and it would be simpler if everything was IPv6 all the time

Just a quick check: are you enclosing the address in brackets like the RFC says?

Adbot
ADBOT LOVES YOU

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av

Ender.uNF posted:

Just a quick check: are you enclosing the address in brackets like the RFC says?

Same effect, only difference is when I don't put it in brackets, the colons are percent-encoded. Apart from that, same exact behavior

lord funk
Feb 16, 2004

So is it not possible to have a universal app where one device idiom 'requires full screen' but the other doesn't?

edit: I guest 7.3.1 doesn't complain about it, but 7.2 does. :shrug:

lord funk fucked around with this message at 22:26 on May 12, 2016

kode54
Nov 26, 2007

aka kuroshi
Fun Shoe
My fellow project developer is having an issue with TestFlight. He just uploaded a version "1.0.20 build 1" to the App Store, our first public release. This release is free, with some features disabled. Unlike the TestFlight version, this one supports down to iOS 6.1.

So, herein lies a new problem: it obliterated the beta release. Even pushing a "1.0.20 build 2" to TestFlight does not appear for testers.

If this iOS 6.1 thing becomes a point of contention, we'll need to switch to another beta release platform. Perhaps Crashlytics...

Doc Block
Apr 15, 2003
Fun Shoe
What is the actual build number string?

lord funk
Feb 16, 2004

One day I dream of an Xcode where you can drag files into the project navigator and they actually copy into your project. :allears:

stuffed crust punk
Oct 8, 2004

by LITERALLY AN ADMIN
Crashlytics is good bc the builds are available in 1/60 the time

Doh004
Apr 22, 2007

Mmmmm Donuts...

Regular Nintendo posted:

Crashlytics is good bc the builds are available in 1/60 the time

1/60th of the time it works every time.

Doc Block
Apr 15, 2003
Fun Shoe

lord funk posted:

One day I dream of an Xcode where you can drag files into the project navigator and they actually copy into your project. :allears:

Is the "Copy if Needed" box checked? Because this works 100% of the time for me. Also, make sure the correct target is selected.

eschaton
Mar 7, 2007

Don't you just hate when you wind up in a store with people who are in a socioeconomic class that is pretty obviously about two levels lower than your own?

lord funk posted:

One day I dream of an Xcode where you can drag files into the project navigator and they actually copy into your project. :allears:

Usually this is because you previously added a reference to an item that you didn't want copied, and we remember the state of the check box from one addition to the next.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Also gets weird inside of .bundles iirc

nah thanks
Jun 18, 2004

Take me out.

hackbunny posted:

The most ridiculous App Store rejection yet:


And the screenshot is... the About screen of the application. The external mechanism for purchases is the link to our website I guess? Or maybe the "send logs" button. Meanwhile the nearly identical sister application was approved

This is basically why none of my new side projects are iOS apps anymore. It's just not worth dealing with the review process, never mind the debate of "do I release a new update and wipe out all of my reviews?" Web apps are so much more pleasant (not that the web doesn't have its own obnoxious stuff).

Given what's happening with app review times lately, it's my hope that WWDC is going to seriously overhaul the process. Review times are like 1-2 days now instead of the 7-10 they always used to be. Good stuff, though the whole process is still not how releasing software work in 2016.

lord funk
Feb 16, 2004

@DocBlock @eschaton no, the problem is when you drag a folder of items into some folder reference (group? who cares) that has Xcode-y problems. So even when you Copy Items, and even when the items do copy (checked in Finder), the references are all red / missing.

lord funk
Feb 16, 2004

.. edit I'm an idiot

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



RT @lord_funk same

lord funk
Feb 16, 2004

Solid:

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Hi Kevin!

lord funk
Feb 16, 2004

pokeyman posted:

Hi Kevin!

How do you know that's me and I didn't beat up some guy named Kevin and steal his iPhone 6? Huh???

Carthag Tuek
Oct 15, 2005

Tider skal komme,
tider skal henrulle,
slægt skal følge slægters gang



obviously the files are all named "Project.xcodeproject"

idk how thats so hard to understand

Doc Block
Apr 15, 2003
Fun Shoe

Maybe quit the app before trying to modify it will help? IDK

Maybe add the images to one target when you're copying them, then once added select them and check the other projects they're supposed to belong to on the side panel?

stuffed crust punk
Oct 8, 2004

by LITERALLY AN ADMIN
Maybe open finder

Echo Video
Jan 17, 2004

zap the pram

lord funk
Feb 16, 2004

Doc Block posted:

Maybe quit the app before trying to modify it will help? IDK

Maybe add the images to one target when you're copying them, then once added select them and check the other projects they're supposed to belong to on the side panel?

I mean you can copy them to the folder in Finder, add them to Xcode and not 'Copy items' and that works. But the word 'works' is kind of misleading in that sentence.

The problem was the original 'Images' folder wasn't there, and had to be recreated Xcode.

Doc Block
Apr 15, 2003
Fun Shoe
Why is there no built-in way to reverse a CGPath?

:/

Doc Block fucked around with this message at 17:59 on May 16, 2016

Doc Block
Apr 15, 2003
Fun Shoe
All I want to do is render text with a stroke that's outside the text, with no fill. The normal way of getting an "outside" stroke of drawing the stroke and then fill over top obviously can't be used (because there's no fill), so the stroke is the equivalent of using "Centered" mode in whatever drawing program you prefer, and looks lovely.

I thought reversing the glyph path and then setting that as the clipping path would work (since StackOverflow says that's how you get an outside stroke on non-text paths), but nope.

Gonna have to rethink this. I've got a ton of glyphs to draw all over the place. Maybe I can add them all to one path, then use that to make an image for use as a clipping mask...

Doc Block fucked around with this message at 18:00 on May 16, 2016

Doc Block
Apr 15, 2003
Fun Shoe
Was able to get the effect that I want. No matter how large the stroke width is, it never draws "inside" the characters, even when fill isn't rendered:



In this image the stroke width has been set to something comically huge as a test.

Instead of messing around with reversing paths etc., I just add all the glyph paths to one big CGPath, draw that as fill in an alpha mask, use the alpha mask as a clip mask in the main CGContext, and then draw the big CGPath with the requested stroke width in the main CGContext.

Doc Block fucked around with this message at 00:05 on May 17, 2016

LP0 ON FIRE
Jan 25, 2006

beep boop

Doc Block posted:

Why is there no built-in way to reverse a CGPath?

:/

I know... you'd have to convert the list of points into an array using CGPathApply, and then reverse the array. There's some helpful code I found here, though I didn't use it since I took an entirely different approach to my problem that wasn't based on the path's points.

Doc Block
Apr 15, 2003
Fun Shoe
Yeah, that's what I did, but it still didn't work for my purposes. Wound up using a clipping mask instead of a clipping path instead (see my previous post).

lord funk
Feb 16, 2004

God seriously gently caress the invasive system update alert and gently caress Apple for thinking that behavior is okay. Would it be okay that I post a system alert if the user hasn't touched my app in a few days?

code:
HEY USER! WOULD YOU LIKE TO SWITCH OVER TO MY APP?

[Switch Now]
[Later]
[Details]

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

If your app had pervasive security implications and couldn't be uninstalled, perhaps.

fankey
Aug 31, 2001

I'm trying to do the following
code:
@interface Helper : NSObject 

@property (weak,readonly, nonatomic) UIView* parent;

@end

@implementation Helper
-(void)setParent:(UIView * _Nullable)parent
{
  if( _parent )
  {
    NSLog(@"removing watchers from parent");
    [self.parent removeObserver:self forKeyPath:@"iconUrl"];
    [self.parent removeObserver:self forKeyPath:@"iconData"];
  }
  _parent = parent;
  if( _parent )
  {
    NSLog(@"adding watchers from parent");
    // watch parent IconUrl change
    [self.parent addObserver:self forKeyPath:@"iconUrl" options:nil context:nil];
    [self.parent addObserver:self forKeyPath:@"iconData" options:nil context:nil];
  }
}
@end
But am running into issues since my parent only gets set to nil after it has been dealloced and the dealloc is failing since I still have watchers attached to the parent. Is there any way to use observers with weak references?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.
Don't use weak?

fankey
Aug 31, 2001

pokeyman posted:

Don't use weak?

In this case the parent has a reference to to the helper so I have a retain cycle I was trying to fix.

The odd thing is I have one class using the Helper class without any issues and another one is throwing a NSInternalInconsistencyException on dealloc. The usage is the same so I'm not sure what's going on there.

fankey fucked around with this message at 21:02 on May 23, 2016

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
Weak reference don't magically call associated property setters when they get cleared; that's just not how the technology works.

fankey
Aug 31, 2001

rjmccall posted:

Weak reference don't magically call associated property setters when they get cleared; that's just not how the technology works.

Yeah I've figured that out. My code that was there to remove the observer was never getting called. The odd thing is that in one case the objects were able to be dealloced without any issue and in another case an exception is thrown. The usage is identical so the behavior is a mystery at this point.

One odd thing I'm noticing - if I step through dealloc on my Helper class the debugger has a valid value for _parent but printing _parent or any code that checks for parent against nil determines that it's nil.

I'm wondering if I should forgo KVO and just roll my own since I'm in control of all the classes that are in use.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
You can use associated objects to automatically unregister KVO observers on dealloc, but...

fankey posted:

I'm wondering if I should forgo KVO and just roll my own since I'm in control of all the classes that are in use.

this is nearly always the correct choice. KVO can be useful when you don't control the object being observed, but implementing your own form of change notifications when you do is nearly always going to be far better.

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe

fankey posted:

Yeah I've figured that out. My code that was there to remove the observer was never getting called. The odd thing is that in one case the objects were able to be dealloced without any issue and in another case an exception is thrown. The usage is identical so the behavior is a mystery at this point.

One odd thing I'm noticing - if I step through dealloc on my Helper class the debugger has a valid value for _parent but printing _parent or any code that checks for parent against nil determines that it's nil.

This is really just a debugger bug: the debugger ignores the fact that it's a __weak reference, so it just reports the underlying memory contents, which aren't necessarily immediately nil'ed out when dealloc starts.

Doh004
Apr 22, 2007

Mmmmm Donuts...

Plorkyeran posted:

You can use associated objects to automatically unregister KVO observers on dealloc, but...


this is nearly always the correct choice. KVO can be useful when you don't control the object being observed, but implementing your own form of change notifications when you do is nearly always going to be far better.

Agreeing with this.

While not directly a 1:1 with KVO, I love the willSet and didSet in Swift. Most of the time that provides the capabilities that I would have previously used KVO for.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
Where is the magical new location that Xcode is storing some fuckery that is not DerivedData? I used to always run into a problem where it would refuse to archive if I switched targets to a target with a different bundle ID (provisioning profile bundle ID does not match bundle ID.) I could always fix the problem by blowing away DerivedData. That no longer works.

edit/fixed: Xcode automagically put the wrong bundle ID in my project settings for some reason, even though the Info.plist was correct. Brilliant.

ManicJason fucked around with this message at 23:13 on May 23, 2016

Adbot
ADBOT LOVES YOU

lord funk
Feb 16, 2004

I was really proud long ago when I figured out how to implement KVO. Now I'm systematically removing it wherever possible because if I see another 'deallocated while observers were still watching' crash I'm going to kill myself.

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