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
Hog Obituary
Jun 11, 2006
start the day right
Anyone else unable to download command line tools?
https://devforums.apple.com/message/884961

never mind it's working now.

Hog Obituary fucked around with this message at 22:12 on Sep 10, 2013

Adbot
ADBOT LOVES YOU

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Do you folks know if there's a library out there that can take care of queueing up AFNetworking operations in case the connection is temporarily down? The Parse iOS SDK had this neat feature where you could say "make this call in the background" and it would attempt to complete it during the lifetime of the app with a simple backoff strategy. Eventually the call would make it.l Alternatively, you could call something like "save later" which meant that the call object was serialized to disk and the library would attempt to submit it at some point in the future when the connection is up again. You could even kill the app and it'd still be there in the queue.

I could implement this myself, but it'd certainly take a while to iron out all of the possible kinks with timing and different error conditions, so I'd prefer if there was a well-tested solution out there I can use. Is there such a thing, or does everybody have to roll their own?

Our use case is that our users practice some stuff on the app for a half hour and their progress must be saved successfully or they've effectively wasted their time. There was a wifi issue on their network at one point and the API became unreachable yada yada.. and they got pissed off pretty hard :)

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
OK, I've had it enough with the external build system that builds our third-party libraries. It's a lovely system based on shell scripts and makefiles partially based on autotools. It's poo poo, crap, poo, it's slow, it doesn't support incremental builds, and it makes debugging the libraries from XCode nearly impossible. Plus I'm 99% certain that it doesn't generate debug symbols for release builds, and I mean not even dSYMs. It's utter crap, grown in an incontrollable way, and we should migrate to XCode projects like yesterday

That said, the dependency graph looks like this:

code:
             /------------> Expat
            /         /--->
           /         /
Application --> PJSIP 
           \         \
            \         \--->
             \------------> OpenSSL
And I have, in fact, two questions:

  • What's the best way to structure the projects, considering that the dependencies aren't a strict tree, so I can't really nest projects?
  • The application project has 5 schemes, and the PJSIP project is going to have 2. 3 of the application schemes should correspond to one of the PJSIP schemes, the other 2 application schemes to the other. Is this even possible? and how?

Coming from Visual Studio, I find the XCode project model very confusing :( Thanks in advance, anyone

e: three questions: is there another way to create the projects than drag&dropping source files and inferring compiler flags from the makefiles?

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Out of curiosity, why the gently caress is there no return/done/next button when using a number pad? There's a blank spot where they could add one, even! What if I want users to be restricted to entering numerals only, and be able to continue to the next field easily?

Doctor w-rw-rw-
Jun 24, 2008

PT6A posted:

Out of curiosity, why the gently caress is there no return/done/next button when using a number pad? There's a blank spot where they could add one, even! What if I want users to be restricted to entering numerals only, and be able to continue to the next field easily?

Put a keyboard accessory view above the keyboard with a done/next button.

PT6A
Jan 5, 2006

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

Doctor w-rw-rw- posted:

Put a keyboard accessory view above the keyboard with a done/next button.

That works! I never really considered it, but that's a good solution.

I still don't know why they don't just put a completion button on the number pad like they do on the rest of the keyboard styles, mind you.

Hog Obituary
Jun 11, 2006
start the day right
So here's something neat...
Calling [[UITableViewCell appearance] setSeparatorInset:] will break MFMailComposeViewController only on the 64-bit ios7 simulator. The Mail compose view will popup and then immediately disappear. Perhaps the moral of the story is that you shouldn't be setting global styles like that on table views which are used by system dialogs.

lord funk
Feb 16, 2004

Doh004 posted:

We said gently caress it and we're going with a solid black background instead. Old habits die hard I guess.

Long distance quoting to say I finally got fed up and went full solid nav/tab bars. loving hell the translucent bars are ugly as sin if they ain't white.

lord funk
Feb 16, 2004

One of the 3rd party frameworks I use was just updated last week for iOS 7. But it looks like it doesn't include the armv7s architecture. :wtc: Why would you do that.

Doc Block
Apr 15, 2003
Fun Shoe
I don't think I'd keep using a framework that still hadn't updated to include ARMv7s a full year after it came out.

DreadCthulhu
Sep 17, 2008

What the fuck is up, Denny's?!
Anybody here had a great time implementing auto-renewing iTunes subscriptions?

One quirk I'm trying to understand here: what happens when an auto-renewing subscription renews? The app somehow gets a call somewhere? Does Apple really push that to you?

Edit: apparently you can't use it unless you're pushing new fresh media every month. So basically it's not for SaaS, but for publishers. Ok.. Link

DreadCthulhu fucked around with this message at 09:18 on Sep 15, 2013

lord funk
Feb 16, 2004

Doc Block posted:

I don't think I'd keep using a framework that still hadn't updated to include ARMv7s a full year after it came out.

The old version was developed by another group, and did compile to ARMv7s. A new group has taken it over and released a much needed update. The updated version gives an error that there is no ARMv7s 'slice' in the framework.

Trouble is, it's AudioCopy, a framework a bunch of apps use to copy audio files between themselves. There is no replacement.

Doc Block
Apr 15, 2003
Fun Shoe
If it's open source you could always just build it yourself.

Still, it makes zero sense for them to not also build for ARMv7s.

I get the feeling that Flurry, Facebook, etc, will take their sweet time coming out with ARM64 support :allears:

Doctor w-rw-rw-
Jun 24, 2008

Doc Block posted:

I get the feeling that Flurry, Facebook, etc, will take their sweet time coming out with ARM64 support :allears:
Why's that? It's just a recompile, isn't it?

Fate Accomplice
Nov 30, 2006




DreadCthulhu posted:

Anybody here had a great time implementing auto-renewing iTunes subscriptions?

One quirk I'm trying to understand here: what happens when an auto-renewing subscription renews? The app somehow gets a call somewhere? Does Apple really push that to you?

Edit: apparently you can't use it unless you're pushing new fresh media every month. So basically it's not for SaaS, but for publishers. Ok.. Link

This is really lame - any chance they've changed that policy in the 1.5 years since that post was made?

lord funk
Feb 16, 2004

Doc Block posted:

If it's open source you could always just build it yourself.

Still, it makes zero sense for them to not also build for ARMv7s.

I get the feeling that Flurry, Facebook, etc, will take their sweet time coming out with ARM64 support :allears:

They released an update today - works now. I have a feeling it was just an oversight.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

Doctor w-rw-rw- posted:

Why's that? It's just a recompile, isn't it?
Depends on how terrible your codebase is. I'd like to think no one was relying on id and int being the same size, but I have a feeling I will be disappointed.

Doctor w-rw-rw-
Jun 24, 2008

Plorkyeran posted:

Depends on how terrible your codebase is. I'd like to think no one was relying on id and int being the same size, but I have a feeling I will be disappointed.

Code quality aside (Facebook's iOS expertise has grown a lot very quickly, and is world-class now at he higher levels), mixing pointer types and value types is a really obviously bad idea but also very easily discovered and fixed. I'm positive our linter rules catch the stupidest ones. If I had to guess I'd say some issues would probably have to do with number or struct size assumptions, or complex toolchain issues, and I bet both should be quickly remedied.

Hughlander
May 11, 2005

For us doing an OSX version from the same code base fixed then a year ago.

Doc Block
Apr 15, 2003
Fun Shoe

Doctor w-rw-rw- posted:

Why's that? It's just a recompile, isn't it?

If your code doesn't do dumb things like cast pointers to integers or depend on the exact memory layout of a struct, then it should be fine. But there are some gotchas:
  • C functions have to have function prototypes when compiling for ARM64. This is because the ABI for function calls with variable arguments is different than the ABI for calling functions with a fixed number of arguments, so the compiler needs to know which type of function call to generate.
  • long is now 64 bits, so code that casts between long and int will have some precision issues.
  • NSInteger is 64-bit. int is still 32-bit.
  • CGFloat is typedef'ed to double instead of float.
  • Anything that is defined to be the same as NSIntegerMax or NSUIntegerMax (such as NSNotFound) will be different on 32-bit vs 64-bit code.
  • Data alignment. Pointers and long need to be 8-byte aligned for speed, which could cause some structs to get a lot of wasted padding space.
  • More memory use (see above).
  • ARM64 uses a completely different instruction set, so if any apps had some hand-written assembly code (games or something) then that code will have to be rewritten.
The biggest issue most apps will face is just more memory usage, but there's also the potential for worse cache performance due to certain data types being twice as large. And there will be the usual issues of transferring data from 64-bit devices to 32-bit ones.

Read the 64-bit Transition Guide on the iOS developer site if you're interested.

more like dICK
Feb 15, 2010

This is inevitable.
man daemon mentions that daemon is discouraged on OS X, in favour of launchd. If I have an existing UNIX daemon spawned in the traditional way (a call to daemon), what problems am I going to run into trying to run it on OS X?

Doc Block
Apr 15, 2003
Fun Shoe
Sounds like more of a sysadmin question than a programming one.

more like dICK
Feb 15, 2010

This is inevitable.
Daemon is a function in unistd.h available on both Linux and BSDs (including OSX). Since this is a C function being called in C code I'm pretty sure it falls under the purview of programming.

If it needs to be stated in a more programming-ish way: Is code that calls daemon generally portable between OSX and other Unixes?

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed

more like dICK posted:

man daemon mentions that daemon is discouraged on OS X, in favour of launchd. If I have an existing UNIX daemon spawned in the traditional way (a call to daemon), what problems am I going to run into trying to run it on OS X?

daemon still works fine; it's just that unlike with traditional init scripts running services via launchd doesn't require that the process handle daemonizing itself (but AFAIK it'll still work if the program is dumb and doesn't have a non-daemon mode).

ultramiraculous
Nov 12, 2003

"No..."
Grimey Drawer

Doc Block posted:

If it's open source you could always just build it yourself.

Still, it makes zero sense for them to not also build for ARMv7s.

I get the feeling that Flurry, Facebook, etc, will take their sweet time coming out with ARM64 support :allears:

Yeah, my first foray into building my main project into ARM64 was a hundreds of kinda-pedantic (CGFloat :argh:) implicit cast warnings (mostly from third party stuff) and then errors from Facebook/Flurry/Crashlytics needing to rebuild. Hopefully they take the time to recompile to support the 5S tidal wave of future-ness.

Doc Block
Apr 15, 2003
Fun Shoe
I just wanted to pop in here and say Holy Lolly, SpriteKit is a broken mess. Especially on my iPhone 4, with @2x images loading from texture atlases as if they were @1x, and all other kinds of fun things.

Broken broken broken.

edit: in fact, I've noticed more than a few ARMv7 problems in Xcode 5.

edit 2: deleting the texture atlas and adding the individual image files to the project fixes the problem. And this is a GM build :allears:

edit 3: apparently it's because I was setting the SKView's contentScaleFactor to [[UIScreen mainScreen] scale] so it would render at full Retina resolution, but leaving the SKView's contentScaleFactor at its default (which is 1.0) makes the texture atlas problems go away. It appears to still render at Retina resolution.

Ugh. I have half a mind to just give up and go with Cocos2D.

Doc Block fucked around with this message at 11:48 on Sep 16, 2013

Hog Obituary
Jun 11, 2006
start the day right
So I'm trying to migrate a large project to ARC. I had been working on resolving all the issues the Xcode4 ARC migration tool brought up, but then put the project on the back burner to work on iOS7 readiness. So now my app is ready for iOS7 and builds with Xcode5 and uses the newer APIs and everything... I'm ready to get back to working on ARC.

When I run the migration tool in Xcode5, it gives me hundreds of "undeclared identifier" errors so the migration can't proceed. These are all for autosynthesized ivars for properties where the ivar is referenced directly in the custom setter.

That is, I have a property declared in the header, but no declared ivar. I have no synthesize statement in the implementation. I write a custom setter (e.g. setFoo) which tries to set _foo relying on the fact that _foo was automatically created by the compiler.

The Xcode4 migration tool doesn't complain about this, but then my project won't build with Xcode4 anymore since it uses the new APIs.

It seems like I have two choices:
1. Run the migration with Xcode4 and accept the changes, then switch back to Xcode5
2. Fix all the undeclared identifier complaints by adding lots of @synthesize statements, and then run the migration with Xcode5, then remove all my newly added @synthesizes (to keep the code clean).

Am I doing something stupid here?

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Hog Obituary posted:

So I'm trying to migrate a large project to ARC. I had been working on resolving all the issues the Xcode4 ARC migration tool brought up, but then put the project on the back burner to work on iOS7 readiness. So now my app is ready for iOS7 and builds with Xcode5 and uses the newer APIs and everything... I'm ready to get back to working on ARC.

When I run the migration tool in Xcode5, it gives me hundreds of "undeclared identifier" errors so the migration can't proceed. These are all for autosynthesized ivars for properties where the ivar is referenced directly in the custom setter.

That is, I have a property declared in the header, but no declared ivar. I have no synthesize statement in the implementation. I write a custom setter (e.g. setFoo) which tries to set _foo relying on the fact that _foo was automatically created by the compiler.

The Xcode4 migration tool doesn't complain about this, but then my project won't build with Xcode4 anymore since it uses the new APIs.

It seems like I have two choices:
1. Run the migration with Xcode4 and accept the changes, then switch back to Xcode5
2. Fix all the undeclared identifier complaints by adding lots of @synthesize statements, and then run the migration with Xcode5, then remove all my newly added @synthesizes (to keep the code clean).

Am I doing something stupid here?

The undeclared identifier errors sound specious. I'd file a radar for that. (edit: lord funk is correct below, are you overriding the getter too?)

As for fixing your actual problem, I don't see any other choices. Option 1 sounds easiest, though won't it fail to compile and leave you screwed anyway?

pokeyman fucked around with this message at 19:05 on Sep 16, 2013

lord funk
Feb 16, 2004

You will need @synthesize if you override both the setter and the getter of your property. I've done ARC migration and Xcode 5 only had a problem when I had overridden both (as it should).

Hog Obituary
Jun 11, 2006
start the day right

lord funk posted:

You will need @synthesize if you override both the setter and the getter of your property. I've done ARC migration and Xcode 5 only had a problem when I had overridden both (as it should).

I'm not overriding the getter, only the setter. Also in some places it looks like the ivars are accessed directly by non setter/getter functions (I know this is bad style, some of this is legacy code, I'm working to clean it up)

I made a really simple test project where I just add this to the header file:
code:
@property (retain, nonatomic) UIView * foo;
and this to the implementation:
code:
- (void) setFoo:(UIView*) foo {
    _foo = [foo retain];
    _foo.backgroundColor = [UIColor redColor];
}
And then try to run the ARC migration and it gives me errors on those lines.

Simply adding
code:
@synthesize foo=_foo;
Fixes the problem

Hog Obituary fucked around with this message at 19:57 on Sep 16, 2013

Glimm
Jul 27, 2005

Time is only gonna pass you by

Hog Obituary posted:

Also in some places it looks like the ivars are accessed directly by non setter/getter functions (I know this is bad style, some of this is legacy code, I'm working to clean it up)

I don't think this is bad style? It's really more of a holy war. Certainly the ivar should be directly accessed in init. I tend to access the ivar directly from within a given class unless it's being lazily loaded in its getter. I guess given situations like that it makes sense just to use the getter all the time, except probably in init.


edit:

Sure, if you're setting the value don't use the ivar, except in init, I still don't see a problem with accessing the ivar directly.

vvv

Glimm fucked around with this message at 23:52 on Sep 16, 2013

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

Glimm posted:

I don't think this is bad style? It's really more of a holy war. Certainly the ivar should be directly accessed in init. I tend to access the ivar directly from within a given class unless it's being lazily loaded in its getter. I guess given situations like that it makes sense just to use the getter all the time, except probably in init.

If you're going to bother with public accessors, you should use them whenever your instance is fully initialized. It sucks when you change a property to lazily load and forget to update your direct ivar access. Or when you change a property to copy and assign to the ivar from somewhere else.

KVO is another reason to use your accessors. Generally, any side effects of your public accessors should probably trigger from internal code too.

Axiem
Oct 19, 2005

I want to leave my mind blank, but I'm terrified of what will happen if I do

Glimm posted:

Sure, if you're setting the value don't use the ivar, except in init, I still don't see a problem with accessing the ivar directly.

My experience is that my code (in any OO language) ends up having a lot fewer bugs if I always work with accessors/mutators, even inside my own class, instead of interacting with instance variables. It at least keeps side effects consistent.

ManicJason
Oct 27, 2003

He doesn't really stop the puck, but he scares the hell out of the other team.
I try to avoid directly accessing the ivars unless I have a good reason that triggering KVO immediately is going to cause problems. Will encasing several setter calls that you want to be atomic in willChangeValueForKey: and didChangeValueForKey: have the desired effect? That's the one place I can recall manually writing to the ivars. I never ran a test or found an answer, so I just wrote straight to the ivars around manual KVO calls.


I may be alone/dumb in this, but I totally avoided the ARC wizard when I converted projects to ARC, including some pretty massive projects. I turned ARC on and followed the errors where I had release/autorelease statements. Xcode's refactoring tools have never treated me very well.

pokeyman
Nov 26, 2006

That elephant ate my entire platoon.

ManicJason posted:

I may be alone/dumb in this, but I totally avoided the ARC wizard when I converted projects to ARC, including some pretty massive projects. I turned ARC on and followed the errors where I had release/autorelease statements. Xcode's refactoring tools have never treated me very well.

You can also turn ARC on or off per-file as desired, which lets you convert existing code over piecemeal. Simply add the flag -fobjc-arc or -fno-objc-arc as needed in the appropriate Build Phase.

Hog Obituary
Jun 11, 2006
start the day right
So what I ended up doing was adding all the @synthesize directives Xcode5 complained about and then committing that locally. Then I ran the wizard and it sailed through. Then I stashed those changes and also backed out the @synthesize commit. Then applied the stashed wizard changeset. A basic smoketest of the app seems to pass, so *shrug*. We'll see what the fallout is down the line.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Updating my apps for iOS 7 is making me realize how much I've learned since I started making apps (or, alternatively, what an utter moron I used to be). Jesus what the hell was I thinking?

Doh004
Apr 22, 2007

Mmmmm Donuts...

PT6A posted:

Updating my apps for iOS 7 is making me realize how much I've learned since I started making apps (or, alternatively, what an utter moron I used to be). Jesus what the hell was I thinking?

I've had so many :smith: moments doing this as well.

PT6A
Jan 5, 2006

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

Doh004 posted:

I've had so many :smith: moments doing this as well.

Well, it turns out I wasn't as stupid as I thought. After spending an hour trying to figure out how to get AutoLayout to do something rather than doing it in code (to account for the stupid 20px status bar thing), I finally gave up and just did it manually. Every time I try to do anything that isn't completely trivial with AutoLayout, it ends up behaving in a completely unintuitive and useless way. Here's a tip, Apple: if I have vertical spacing set on the top and bottom of a view, it might mean I want you to resize that view to maintain the vertical spacing constraints if the superview changes size!

EDIT: Of course, if I ever sustain the same sort of brain damage that seems to have occurred to whoever designed AutoLayout and it finally makes sense to me, I'll probably look back at this moment and wonder what I was thinking too.

PT6A fucked around with this message at 00:27 on Sep 18, 2013

Adbot
ADBOT LOVES YOU

Dr Monkeysee
Oct 11, 2002

just a fox like a hundred thousand others
Nap Ghost
I've just started getting into iOS development over the last couple months and Autolayout is by far the biggest wtf I've come across. I *still* don't understand it and trying to get a view to scale how I want comes down to deleting random constraints until both IB is happy and I get the behavior I want.

More often than not these are two conflicting requirements.

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