Live data from Hacker News

iOS Development Tips If You're Just starting Out

stuartkhall.com

101–105 of 105 posts

Re: iOS Development Tips If You're Just starting Out

#101
post #79

I've been programming iOS for a couple of years now and some of those tips where useful to me! Anyhow as we're contributing top tips, my one is 'Always run your app on target hardware.' Don't rely on the emulators, especially if your're doing OpenGL work. You will only know your framerate by running your app/game on the real hardware.

This is huge. Running on the emulator is good if you haven't paid the $100 to put it on device yet. After that, you better be running on your device every time. There's so much to be said for actually holding the device and using your app like your normally would, instead of pointing and clicking with a mouse. Even the pixels and text-size/color are WAY different when on the device. Seriously, do this if you aren't a…

Well this is a bit of a sweeping statement.

I don't think you ALWAYS have to run on your device. Emulators are much faster at launching and getting to it. I use the emulator for a majority of quick fixes, layout changes, API debugging, etc. I move over to the device when things are nearing a point where I need to test real-world things.

Using the emulator is fine, just be sure to test on the device before you deploy.

Re: iOS Development Tips If You're Just starting Out

#102

Can someone explain to me why I should use dispatch_once at all when a simple check whether the static variable is nil would suffice? It always seems so cluttered. Compare this: + (MyClass *)sharedClass { static MyClass *_shared = nil; static dispatch_once_t onceToken; dispatch_once(&onceToken, ^{ _shared = [[MyClass alloc] init]; }); return _shared; } ...to this: + (MyClass *)sharedClass { static MyClass *_shared =…

Should you call the singleton on multiple threads, there is a chance you could get inconsistent results based on a race condition. Using GCD ensures that the singleton is truly only created once.

Re: iOS Development Tips If You're Just starting Out

#103

Earlier quoted context omitted.

I haven't but I did look at the page as it was linked in the article. I never saw any mention of code formatting. An example of what I expect is like the Eclipse Source > Format option which will go in and make everything consistent including making lines less than 80 chars, adding space around operators (I never put in spaces which goes against almost every style guide), ensuring the arms of if/else always have brac…

AppCode is $100. $200 is you purchase a company license, which means anyone at the company can use it. If you are the only person using it, you only have to pay $100.

Late correction, I know, but Apple does not offer a $200 iOS developer program. Depending on which of their 4 iOS programs you choose, the costs can be free, $99, or $299. See https://developer.apple.com/programs/which-program/ for specifics. Most of the confusion I have seen is around the Developer Program (Company) and the Enterprise Developer Program.

Re: iOS Development Tips If You're Just starting Out

#104

Earlier quoted context omitted.

AppCode is $100. $200 is you purchase a company license, which means anyone at the company can use it. If you are the only person using it, you only have to pay $100.

Late correction, I know, but Apple does not offer a $200 iOS developer program. Depending on which of their 4 iOS programs you choose, the costs can be free, $99, or $299. See https://developer.apple.com/programs/which-program/ for specifics. Most of the confusion I have seen is around the Developer Program (Company) and the Enterprise Developer Program.

We were talking about the costs of AppCode not any program offered by Apple.

Re: iOS Development Tips If You're Just starting Out

#105

If you use ARC from the start, then can you really understand block retain cycles (which are just two bullet items below)? I would absolutely try to write one or two "Hello World" apps without ARC first. CMIIW but Xcode will highlight any instance where you do things differently than ARC would, there is plenty of feedback on what you are doing. And once you feel confident enough, upgrading the project just takes a fe…

I love your advice: start out learning how to manage memory and it only gets easier. While ARC is great compared to manual memory management, it doesn't work on non-Objective-C object, such as CFRefs (when dealing with sound, for example).

It's even worse when you have to mix CFRefs and Objective C. Without ARC you don't need any __keywords to do so, and when you switch you know where they come from.
Post reply on HN