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
Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I guess choosing to program in obj-c is sort of like choosing to ride a fixie.

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
10.7 already supports 3.2.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Which requires membership in the $99/year Mac Developer Program.

Plorkyeran
Mar 22, 2007

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

Doc Block posted:

You can change Xcode's preferences so that it doesn't autocomplete as you type.
But typing a paragraph for every method call would be awful, so really you just need to get used to it. Xcode's autocomplete annoys me frequently, but the language would be pretty much unusable without it.

Plorkyeran
Mar 22, 2007

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

Gordon Cole posted:

In regards to sending arbitrary messages to id being a bad idea, out of curiosity, how do you think it could be done better? I don't see how you could restrict which messages are allowed to be sent to id without forcing the programmer to give the object some kind of type, which would make the id type not terribly useful.
There's probably some use-case I'm forgetting about, but I think typed collections and init* returning a concrete type would be enough to remove all of the cases where I actually want to send arbitrary messages to a non-protocoled id.

Plorkyeran
Mar 22, 2007

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

Ender.uNF posted:

Yes, we've actually discussed the need for something like generics which would eliminate a lot of the need for everything to return id, unfortunately protocols stole the most ideal syntax because you'd want to declare NSArray<FunkyTown>, where FunkyTown is a class... Though now that I think about the namespaceing issue maybe it doesn't matter... If the type is a protocol then use protocol semantics, if it is a class use generic semantics... I'm sure there are huge flaws with that idea though.
How does Obj-C++ manage to make it work? Even if you can't template Obj-C types it seems like it'd be a nightmare to handle the fact that vector<Foo> and NSArray<Foo> are both types yet very different sorts of types.

Plorkyeran
Mar 22, 2007

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

Toady posted:

I could have sworn one of the WWDC presentations stated that NSDate is nothing more than a boxed timestamp.
What else would it need to store? The complex part is the code to do anything interesting with that timestamp, not the data structure.

Plorkyeran
Mar 22, 2007

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

Gordon Cole posted:

Has anyone else been experiencing performance problems in Xcode since updating to 4.5? After about 2 or 3 hours I have to restart it because it becomes unusable.
Having to restart Xcode every few hours would not be anything new for me. It's one of the least stable programs I've spent any significant amount of time using.

At least it starts up quickly.

Plorkyeran
Mar 22, 2007

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

Doc Block posted:

Do people really care that badly about supporting the iPhone and iPhone 3g? Even the 3GS has an ARMv7 CPU.
No third-party apps on the original iPhone, so just the 3G.

The more relevant part is that Apple used to not allow removing armv6 support in an update. Has that changed?

Plorkyeran
Mar 22, 2007

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

tarepanda posted:

ALSO, is there a way to revert back to iOS 5 for testing (my app can't use the emulator) or should I just keep one of each device on iOS 5 and upgrade others to 6?
Only if you backed up the SHSH blob for the device before iOS 6 came out. If not, it's no longer possible to install 5 on a device capable of running 6.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
You can use CoreLocation to check the current permission status and specifically request permission, but it's probably not really worth the effort.

Plorkyeran
Mar 22, 2007

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

tarepanda posted:

I'm getting really, really fed up with Apple's library and how long it takes to save photos to specific albums.

Will Apple kill me if I start just saving them in the Documents folder?
Adding assets to albums is really awesome because fetching the album requires giving it a chance to invalidate the asset (or vice-versa if you do it in the other order), and there isn't actually any guarantee that you'll ever be able to have both a valid asset and a valid album at the same time.

What I ended up doing was writing images to a cache directory and adding stuff in that directory to the library on a background thread, which Apple did not object to.

Plorkyeran
Mar 22, 2007

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

tarepanda posted:

That's what I'm doing now -- my issue was/is that if I try saving directly to the album and they change the view before it actually does that, the photo ends up not being saved.

Once there's some nontrivial logic involved the code for saving stuff to the assets library shouldn't really be in a view controller anyway, and once you split it off to its own class then having the object doing the saving outlive the view isn't really an issue. There's still the possibility of the app exiting before it's saved, which I handled by moving all of the assets library adding logic off to a background worker which monitors the cache directory and is spawned at app startup, so that anything which was waiting to be written is just done the next time the app is run.

If you can get away with not doing stuff with the assets library it'd probably be much better for your sanity.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
FWIW I had an update rejected for the reason "Invalid Launch Image - You app contains a launch image with a size modifier that is only supported for apps built with the iOS 6.0 SDK or later." when doing the Xcode 4.4 + Default-568h@2x.png thing.

Plorkyeran
Mar 22, 2007

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

DreadCthulhu posted:

My concern is basically with easy short term gain in exchange for long term pain (afaik that's most people's experience with Rails's ActiveRecord).
ActiveRecord works out perfectly fine in the vast majority of cases. People mainly run into problems when they forget that it is just a pretty syntax for accessing a database.

Plorkyeran
Mar 22, 2007

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

Carthag posted:

That said, the example is pretty horrific and I would never write something like that. I only declare multiple variables on one line if they aren't also initialized on that line.
Something like int x = 0, y = 0; isn't too bad, but that's about the limit.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Exceptions combine pretty terribly with manual memory management, so pre-ARC you'd have to be crazy to use them for non-fatal errors. With ARC I guess you could make it work, but fighting against the established style of a language is rarely a good idea.

Plorkyeran
Mar 22, 2007

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

tarepanda posted:

If it were, wouldn't the Analyzer point it out?
No, not necessarily. Static analysis cannot be both complete and sound without running into the halting problem, and while clang's analyzer is quite impressive, it's not that hard to trick. It also has some outright bugs; at least in 4.3 it did not detect self-retains which used the dot syntax.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
You actually can just manually add the Pods project as a subproject of your main project and skip the xcworkspace; it just doesn't do it automatically.

Overall CocoaPods is decent, but you'll have to write your own Podspecs for a good chunk of your deps (which isn't very hard), and it's not all that polished yet. I really hope it manages to catch on, as it'd be really nice to have a standard package manager that everything uses.

Plorkyeran
Mar 22, 2007

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

bumnuts posted:

I disagree. It makes more sense to me to keep the decision in each view controller since it knows best how to lay out its own content. Relying on the app delegate or other container class just vastly complicates logic unless almost all of your views support the exact same orientation settings.
In most cases it's pretty trivial to just forward the messages to the current view controller if that's the behavior you want.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I doubt it's even possible to entirely avoid ever getting memory warnings; if there's only a few MB of ram available when your app is started, then you're going to get a memory warning before you've even done much of anything. You should try to keep memory usage down to avoid killing background apps as much as possible, but getting a memory warning is not at all a big deal.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If you have a developer account you can download old versions of Xcode from the developer download area.

Plorkyeran
Mar 22, 2007

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

Ender.uNF posted:

Of course the answer is mainQueue or BeginInvoke respectively, which begs the question: why can't these drat UI toolkits just do that for me?
It would do very bad things to performance.

Plorkyeran
Mar 22, 2007

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

Gordon Cole posted:

In this context it seems that it's supposed to make the variable visible only within that file. Since it's declared in a header file, it makes sense that it would be flagged as being unused, since it can only be used in that file and there's no code in there to use it. However, it's definitely not hidden from other files because I've been using these variables elsewhere for a long time.
Each translation unit has its own copy of the variable, which is is hidden from all of the other translation units (not other files).

One way to avoid having to declare each variable twice is the following:

In foo.h:
code:
#ifdef BUILDING_FOO_M
#define FOO_H_EXTERN(var, value) var = value;
#else
#define FOO_H_EXTERN(var, value) extern var;
#endif

FOO_H_EXTERN(NSString *FooNotification, @"FooNotification")

#undef FOO_H_EXTERN
In foo.m:
code:
#define BUILDING_FOO_M
#import "foo.h"
This is obviously only worth it if you're exporting a bunch of symbols.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
If using properties rather than ivars manages to cause performance issues then you're probably working with something that conceptually should be a struct rather than an obj-c class anyway.

Plorkyeran
Mar 22, 2007

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

Small White Dragon posted:

I see some Android phones are sporting ~460 dpi displays. What do people think the chances are we see an "@3x" display soon?
Extremely unlikely. Scaling things for a 50% increase in resolution looks terrible.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
0.1 is not a number than can be exactly represented by a double-precision IEEE-754 floating-point value.

Plorkyeran
Mar 22, 2007

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

Doh004 posted:

The next time I start one I will definitely be checking that out. How hard is it to convert over an existing project? I see that I have 8 frameworks currently in my solution.
Probably not very difficult if all your deps have podspecs, you have your deps well segregated, and aren't already using a xcworkspace.

My main complaint about CocoaPods is that it's still pre-1.0 and acts like it, so if you don't pin to a specific version you'll occasionally have things break from new releases and suddenly you're dicking around with Gemfiles and bundler for your iOS app (which isn't a big deal at all for people who use Ruby anyway, but for those that don't it's yet another thing to learn). I still wouldn't even consider not using it for a new project, though.

Plorkyeran
Mar 22, 2007

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

vapid cutlery posted:

Yeah when I was evaluating it I realized that it automatically upgrading would probably become a problem so I pinned everything to the version they were at when I started putting things together. The big problem I see now is that it isn't very apparent when libraries have updated if you pin the versions you're using. I haven't checked 0.20 for this feature, though.
The approach I've been taking is to not put version numbers in the Podfile (or major only) and commit Podfile.lock, then whenever I feel like pulling in updated versions of dependencies just delete Podfile.lock, rerun pod install, and commit the result after verifying that everything still works.

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:

I actually commit the pods along with the podfile and lock. No reason not to, IMO. Easiest to reproduce the build on machines where CocoaPods is not installed (that's how I was able to migrate a codebase to use it which was previously a huge mess).

It can make your repository huge and everything a lot slower (although you can partially mitigate that by adding Pods to .gitignore and force-adding it). I do agree that it's usually the right choice, though.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I used it for a toy app recently, and I'd be inclined to use it again on something larger. The documentation isn't great, and creating signals is way more convoluted than it should be (not in that there's dumb boilerplate, but that it's such a core thing to do that making it trivial to create signals should have been a core design goal). I've definitely become a fan of FRP, though. It makes a lot of common things absurdly simpler, and saves you from callback hell when writing async code. The documentation is mitigated somewhat by the fact that the source is pretty reasonable and well organized - it does have good high-level docs, and for a detailed reference it's easy enough to just look at the implementation.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
You are allowed to have things other than Models, Views and Controllers in your application. MVC is essentially just a guideline for how to separate the various concerns involved in a GUI, so anything not inherently coupled to the UI generally should be elsewhere.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Dev center's back up. Xcode 5 preview is out.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
The icons are still terrible, though.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I'm not at WWDC but I work two blocks from the Moscone Center if people want to meet for lunch or something.

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
Yesterday was very exciting for me and I completely forgot about it. I've PMed my number now.

Plorkyeran
Mar 22, 2007

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

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
I'm able to download the Mavericks DP without being in the Mac Developer program.

Plorkyeran
Mar 22, 2007

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

lord funk posted:

Where? I don't see it in the iOS Dev Center.
That would be because it's in the Mac Dev Center. Not everything in the dev centers requires the applicable subscription.

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
VLC had to put a lot of effort into relicensing to LGPL to get back into the App Store.

Apple doesn't explicitly ban GPL stuff so I guess you could just hope that the copyright owner doesn't complain, but I wouldn't build a business around that.

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