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.
12
votes
3answers
297 views
A flashing ! exclamation ! point ! bar
I have this Objective-C code for use in an iOS app that makes a 'bar' on the screen, with a red exclamation mark that flashes in it at random places.
Here's what it looks like:
Header file:
...
1
vote
2answers
86 views
Passing Row Index of TableViewCell (custom) to another view controller [closed]
I have been trying to achieve the below requirements to get them working. Am I doing it the right way?
We have a table with customised Cell (say: ...
3
votes
1answer
56 views
Potentially superfluous iOS interface system
I have written an interface system for iOS that allows interface elements to be moved around on the screen as actors move around on stage. It can operate within a ...
4
votes
1answer
73 views
Created 2 new classes to represent my backend service and persisted data in iOS app
I just created 2 model class for my iOS app:
HALUserDefaults represents the persisted data in my app. It has the ability to both retrieve persisted data and store ...
5
votes
1answer
63 views
Calculating delta in SpriteKit using Swift
I am attempting to learn swift by refactoring one of my old games and I need to rewrite my update method which calculates a delta time. This code works but is ugly. ...
11
votes
2answers
2k views
Is it still necessary to check for a front camera?
I'm trying to clean up redundant old code, so I'm asking this general question. Since all iOS 7 devices have a front camera, would it be safe to remove the code to check if the device has a front ...
4
votes
1answer
53 views
Cleaned up a small MVC refactor in iOS app
I have a view controller on my app, where the user is shown a table view. The table view displays their address book contacts and allows the user to select any friends that they would like to invite ...
3
votes
1answer
57 views
Very small start to MVC refactor in iOS app
I started to refactor my app to MVC today. I wasted a lot of time because of simple mistakes.
One was I kept trying to access the getter method inside of my custom getter method, which just causes ...
8
votes
1answer
115 views
Unhandled Exception handler that captures a screenshot
So, whether you're still in the development stages or your app is already on the app store, you always hope your app isn't crashing. But if it is, you want to be sure you've got good crash reports, ...
9
votes
1answer
94 views
First simple program; counting button presses
This is my first solo Objective-C program... it does the complicated task of displaying a button and counting how many times it's been pressed. It retains that count (along with the last time it was ...
3
votes
1answer
69 views
Class / Superclass / Specific class matching condition, can it be simpler?
I recently built a way to automagically dismiss firstResponders for an app I'm building. Is there a more efficient way to approach this?
...
6
votes
2answers
131 views
User Interface for Strategy Game
I've been working a strategy game for iOS for a little while, and each time I add functionality to the game model I'm finding myself building a lot of UI code to sync up with it. I believe that my ...
7
votes
1answer
133 views
iOS7 ChessGame UIChessboardView Design
I've been designing UIChessboardView in the likeness of UITableView using protocols and delegates.
UIChessboardView.h
...
3
votes
1answer
109 views
Model to handle all the data/networking from Foursquare API in IOS
I posted not too long ago, asking for tips/improvements I could use on my models. I have changed quite a lot, so I thought I'll give it another go.
My model is supposed to handle all the data I get ...
5
votes
1answer
69 views
App for listing places close by - building up models
I'm fairly new to Objective-C. The app I'm trying to make, is using the foursquare API to list up places that is close by. I've re-written this app more times than I care to admit, because I feel the ...
4
votes
1answer
848 views
Better way to fetch JSON data from a server from iOS app
I have successfully coded a network request to fetch JSON data from our server. The remote function is written in ColdFusion. However, the code is quite lengthy and involved. I also noticed in the API ...
1
vote
1answer
556 views
App for making calls to web services - AFNetworking 2.0
I've built a base class that I use a lot in my iOS app to make calls to web services. I built the base class to make the actual call and this base class is only ever used by another class.
The idea ...
3
votes
2answers
133 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 ...
6
votes
1answer
140 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
88 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
259 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
277 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
162 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
220 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
85 views
1
vote
0answers
296 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
824 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
106 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 ...
6
votes
2answers
255 views
iOS App - Interface for user log in using a call to a web service API
I have a navigation controller set up with a user code and password and a log in button. When the user clicks on the Log In button or the return key on the keyboard on the password text box - the ...
2
votes
1answer
335 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
185 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 ...
6
votes
1answer
107 views
How can I condense several IBAction methods in a class with a delegate?
I have the following class:
MyProtocolClass.h
...
4
votes
1answer
2k 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 ...
5
votes
1answer
224 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 ...
8
votes
2answers
3k 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
152 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.
...
4
votes
1answer
89 views
Assigning initial value via getter or viewDidLoad
I've been coding in a vacuum for several years and am trying to get up to speed on best practices, in anticipation of my eventual return to employment. I'm hoping this is the best forum in which to ...
6
votes
3answers
144 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 ...
2
votes
2answers
521 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:
...
6
votes
1answer
696 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
899 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
218 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
181 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
89 views
1
vote
1answer
612 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 ...
3
votes
1answer
1k views
Subclassing AFNetworking to handle POST / GET requests
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 ...
2
votes
2answers
324 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
768 views
MasterViewController
I plan on including this work in a portfolio.
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 smell?
Is ...
3
votes
1answer
205 views
iOS App ViewController
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 ...
4
votes
2answers
1k views
Asynchronous networking iOS API calls
I have the code above in my iOS SDK that I am building that makes it easy for users of the SDK to make API calls. Basically, users can specify an API endpoint and easily make API calls.
Is there any ...