iOS is an operating system for mobile devices developed by Apple Inc. that is currently used in their iPhone, iPod touch, iPad, and Apple TV (2nd generation) devices. It shares a lot with Mac OS X, but is optimized for touch-based interfaces.

learn more… | top users | synonyms

3
votes
2answers
49 views

Simple iPhone Notes app

I'm a beginner developer, I'm learning online (mostly from the Apple documentation guides), and couple a days ago I started a notes app project. It's the first app I'm building without a guide. It's ...
4
votes
1answer
70 views

Obfuscating iPhone Password

If I need to obfuscate an iPhone password that is hardcode (Oauth Client Identifier and Client Secret), would this be a way to do it? ...
4
votes
1answer
52 views

Random quote generator

I just began learning programming and I'm learning Objective-C. I'm taking an online course and in that course we were doing a magic crystal ball app. Then I decided to use what I learned and make my ...
5
votes
2answers
102 views

Is this a decent first Objective-C project, and can others learn from it?

This isn't my first time coding in Objective-C, but I do sometimes fantasize about there being a de facto standard "practice" project. I'm toying around with this code, and I'd like your input. ...
2
votes
1answer
89 views

Separating Game Logic from Rendering - Sprite Kit

I've been working on a game prototype for a couple days and I think that code review would be really helpful. The basic idea of the game is that you are controlling some dwarves, and you dig up ...
2
votes
1answer
90 views

Best way to refactor this loop of animations with delay?

I have some animations happening after some delay calls the code to animate. It works fine, but the code to call the functions is not nice. ...
8
votes
1answer
178 views

NSInvocation Implementation

I'm using NSInvocation as a choke point in my app to help manage threading and reduce the amount of redundant code. The purpose of this class is to pass arguments ...
7
votes
1answer
55 views

Storing icons statically as strings in custom class

I have a class that I call "Icons" Icons.h ...
1
vote
0answers
48 views

Pick up and throw simulation in SpriteKit [closed]

Last days, I experimented some time with spriteKit and (amongst other things) tried to solve the problem to "throw" a sprite by touching it and dragging. I have tackled the major hurdles, and the ...
5
votes
3answers
106 views

Custom iOS chat interface design & functionality

Preamble So, as most of you have likely also noticed, chat components, at least at a basic level, are becoming very common with lots of apps. I found myself tweaking and redesigning the interface ...
3
votes
1answer
69 views

Singleton With Sub-Singletons

I've found myself wanting an easy way to implement chat into various apps, so I developed a set of classes for the firebase.com backend that make it easy for me to quickly set up the nuts and bolts of ...
1
vote
1answer
154 views

UITableView 'hidden' section causing more memory allocations every time on pull to refresh

I'd like to see how to improve this code. I have a UITableView that I'm 'hiding' a section when the user taps on that section's header. I thought this was a pretty cool implementation I came up with, ...
4
votes
1answer
107 views

AVCaptureMetadataOutputObjects Wrapper

With iOS7, Apple introduced AVCaptureMetadataOutputObjects, which is used for scanning barcodes. If you check out the web for how to scan barcodes in iOS, almost ...
5
votes
1answer
83 views

How can I condense several IBAction methods in a class with a delegate?

I have the following class: MyProtocolClass.h ...
4
votes
1answer
366 views

UITableView cellForRowAtIndexPath

I'd like to see how I can improve this code, as I know it's bad practice to have cell reuse identifiers like this, but I could not find any other way to keep the cells that contain images from calling ...
4
votes
1answer
120 views

UIView subclass – done right?

Generally, UI code is painful and full of kludges. (At least, mine was like that.) Recently I have decided to put an end to it and try to learn how to write good and reusable UI code. So here is the ...
7
votes
2answers
1k views

Game with tile map - Sprite-Kit

I'm a novice programmer learning Objective-C in my spare time. I would greatly appreciate any help or advice with my code. I want to follow best practices whenever possible. I know that I am ...
4
votes
1answer
106 views

Configuring Constructor Parameters and Unit Testing

Currently working on writing out some test for an iOS enterprise application. My concern is in this set up of my overloaded constructor. ...
6
votes
3answers
130 views

HTTP scraper not clean and straightforwardly coded?

A job application of mine has been declined because the test project I submitted was not coded in a clean and straightforward way. Fine, but that's all the feedback I got. Since I like to ...
1
vote
2answers
242 views

UIGraphicsImageContext Memory Spike - Reducing Footprint

I have a UIImage Category for iOS Objective-C which tints an image based on a given UIColor value. You can take a look at the method below: ...
5
votes
0answers
319 views

Canonical Implementation of a Subclass of NSOperation

I would like to develop a kind of template or canonical implementation for a concurrent subclass of NSOperation. Requirements: Thread safe API. ...
3
votes
2answers
338 views

Multiple serial URL requests in Objective-C / iOS

I want to check the existence of various API endpoints by doing serial URL request. If the first one fails, I want to try the second one, if the second fails I want to try the third one, etc. Here is ...
4
votes
1answer
189 views

iOS / Objective-C Basics

Coming from Java & Android development and Objective-C still is a bit strange to me, but I just went in head first and started writing code. Before I started getting really far into it, I just ...
4
votes
1answer
142 views

applicationDidBecomeActive: Am I causing a memory leak?

Using ARC, I'm calling the following function in an iOS app every time the app gets opened in the applicationDidBecomeActive function. My concern is that it could ...
1
vote
0answers
72 views

Sample design Oauth2.0 flow [closed]

I have the following code that I hope developers will use. ...
1
vote
1answer
267 views

A better way to handle web services in an iOS app?

I'm building an iOS app that uses web services extensively. I've built classes that handle the requests. However since there are a lot of web service request - I need to find out how to detect which ...
2
votes
1answer
720 views

I subclassed AFNetworking to handle POST / GET requested - doing it wrong?

So I am pretty new to iOS development - I'm writing an app the uses web services, pretty extensively. With that in mind, I decided to use AFNetworking 2.0 and subclass AFHTTPSessionManager. I ...
2
votes
2answers
201 views

I need code review on using singleton to access local database

As I get to some performance issues in my app and find that I use database access in a bad way. So I decided to move to singleton pattern. I need someone to review this code and confirm me that I made ...
4
votes
2answers
624 views

iOS: Code review of MasterViewController

I plan on including this work in a portfolio. Question: Will this code get me hired or laughed at? More Specifically: How would you rate the general complexity of the code? How bad does the code ...
1
vote
1answer
148 views

iOS App ViewController Refactoring Guidance

My question is: How can I most effectively refactor the code in these 2 ViewControllers. I'm familiar with subclassing in objective-c and have used it extensively else where with NSObjects and ...
1
vote
1answer
638 views
3
votes
1answer
74 views

Is there a better way to make sure a variable is initialized when using blocks?

I have a method to provide an NSManagedObjectContext using UIManagedDocument. I need to ensure that the ...
1
vote
1answer
131 views

AutoreleasePool NSString Automatic Reference Counting

I have some doubt about how NSString is released in ARC Mode. I would like to know if have something i can do to release a nsstring when i want in arc mode. Take a look at this code: ...
2
votes
1answer
317 views

Refactoring to avoid if-else in numberOfRowsInSection and cellForRowAtIndexPath

Below is the code that I would like to refactor in order to avoid if-else statements in cellForRowAtIndexPath and ...
4
votes
1answer
109 views

URL percent encoding function

I wrote a custom URL encoding function and I'd like to run it past a few other experienced C developers. I have tested it on a few strings, and it has worked on all of them. This is to be run on ...
2
votes
1answer
194 views

Pulling Objects & Values From Arbitrarily Nested JSON

I got tired of stringing together objectAtIndex: and objectForKey: and hoping nothing fails along the way. I parse a lot of JSON from sources like the Google Directions API and it was cluttering my ...
0
votes
3answers
304 views

Objective-C class for placing UI elements based on screen size

I'm always programmatically creating and laying out UI elements in multiple ViewControllers and I've wanted an easy way to get relevant Screen information (sizes/points) globally using a helper class. ...
1
vote
0answers
435 views

SDWebImage - Fetch more images

What I am looking to do is, apart from setImageWithURL method of SDWebImage, load other images from the array of URL's. So, in the completion block of ...
2
votes
1answer
142 views

Select first or last object from id<NSFastEnumeration>

So I found this code in our project and it just feels like the wrong way to do what its seems to be doing ...
2
votes
1answer
81 views

Is this proper code for removing a CCSprite under certain conditions?

This is a "answer" to my own question over at stackoverflow, head over there to see what I am trying to accomplish. ...
3
votes
1answer
25 views

Creating an expanding CCSprite cluster

I am creating an "explosion" of circle sprites from the character with this code, and I was wondering if there is a more effective way to do such things, because this just seems too stupid. (This is ...
2
votes
1answer
669 views

How can I improve below Objective-C code to tint an image?

I have an image which is a black ring: In my view, I need to display it as a white ring. So, to tint the image, I have written the below method: ...
3
votes
1answer
162 views

Class design patterns: how to design reusable classes?

I have two classes DigBackground and DigParallaxBackgroundLayer (a parallax background is a image consisting of several images ...
2
votes
1answer
60 views

A structure and helper functions for working with polar coordinates

Cross posting from Stack Overflow (not sure how to more correctly cross-post). This started simple, as most things do... I just wanted a little structure to hold polar coordinates for a totally minor ...
2
votes
2answers
368 views

iOS/Objective-C “if” best practice

I've got this code that I found in a project and I'm wondering how can it be done better: ...
-3
votes
1answer
252 views

iOS multiplayer pong game [closed]

I was trying to make a multiplayer Pong iOS app and ended up with this. It is almost good, except for one big bug. The 2nd player's paddle is moving the same way with yours. Basically, you're ...
1
vote
1answer
81 views

Is there a more optimal way to write the following encoding and then assign the result to a label?

Is there a more optimal (or concise) way to write the following: I have to do some encoding and then assign the result to a label. ...
2
votes
1answer
64 views

A better approach to coding the a string value test for a NSDictionary object

My conditional code here seems repetitive and long. Is there a better approach? I want to test for a string value in a NSDictionary object and then depending upon the value prefix a UILabel with $, £, ...
1
vote
2answers
507 views

Optimizing iOS method in objective-c

I have such method and have a hard time optimizing it to run better. It takes roughly 1 sec with 100 units to get between NSLog(@"Debug2") and ...
0
votes
2answers
1k views

iOS View Controllers - Default Lazy Loaded Properties (Tab Bar Item & Navigation Item)

It is a little thing about UIViewController, but it has always bothered me - the boilerplate code needed to setup some of a view controller's default properties (e.g. the tab bar item and navigation ...