A late-binding, message-based, object-oriented language that is a strict superset of C and is primarily used for programming on Apple's Mac OS X and iOS platforms. Objective-C can also be used on other platforms that support gcc or clang.

learn more… | top users | synonyms

5
votes
1answer
47 views

Objective-C code clean up

I am tasked with cleaning up someone else Objective-C code, and will admit, it is not my language of choice. I am not sure if this is a valid question but was hoping someone could double check my ...
8
votes
4answers
844 views

Decision Table for the Movement AI in a Game

I posted a question on Stack Overflow about how to implement Decision Tables in Objective-C after reading about them for the first time in chapter 18 of Code Complete. Nobody provided an answer, so ...
12
votes
3answers
275 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
73 views

Passing Row Index of TableViewCell (custom) to another view controller [on hold]

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
3answers
65 views

Working with Classes (inheriting), @ properties and Initialization

I'm working on this Objective C programming assignment I found online. I'm not sure if I have met all the requirements, especially part C. Any help or suggestion will be appreciated. Part 6 ...
4
votes
1answer
40 views

Website parsing optimizations: cleaner way to deal with special cases and improving data transfer between classes

I have a DiningHall class that has the 3 properties: openingTime, closingTime, and ...
3
votes
1answer
48 views

Revised worker movement AI for strategy game

A while ago I posted this question about worker AI and Job Queues for a strategy game. I have posted other questions about the Job Queue, and now I would like to post this revised question about ...
0
votes
0answers
27 views

Returning factorials greater than 12 [closed]

I have the following code, and I want it to give me factorial values up to 20. ...
4
votes
1answer
59 views

Seeking improved Objective-C permutation algorithm

This algorithm seeks to find all of the possible permutations of a word: ...
3
votes
1answer
52 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
65 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 ...
8
votes
1answer
58 views

Immutable Fraction class

Inspired by this question: Fraction class implemented in Objective-C, I have written what I feel is an improved version of the Fraction class in Objective-C. As per the tips in this answer, the class ...
7
votes
5answers
320 views

Fraction class implemented in Objective-C

Inspired by this question: Fraction (rational number) structure with custom operators, I have written this class for doing some simple work with fractions. ...
7
votes
5answers
468 views

FizzBuzz in Objective-C

In my quest for learning Objective-C, I have created the common FizzBuzz code in it. This is due to a suggestion/challenge from @nhgrif to re-implement anything he does in Swift in Objective-C. ...
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
51 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
40 views

Filling text boxes with player names received from an array

I'm currently trying to make the code of an app I'm developing a bit more efficient and easier to read. Basically what this does is after the user taps with two fingers (gesture) it retrieves a ...
3
votes
1answer
53 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 ...
5
votes
2answers
75 views

Revised Job Queue for Strategy Game

After posting my previous question about this Job Queue, I decided I wasn't actually very happy with it. I am embarrassed to admit that upon further testing it did not function properly in all ...
5
votes
1answer
129 views

Replacing occurrences in NSString and NSMutableString

I ran it and it's working, but I just want someone to double check that I followed the directions. Any suggestions or corrections will be appreciated. Assume you have a ...
8
votes
1answer
99 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
89 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 ...
5
votes
3answers
107 views

Job Queue for Strategy Game

I've posted a revised version of this here. I posted about this basic problem a while ago, and I got the recommendation to move the code for managing the Jobs of my game to another class. I have ...
6
votes
1answer
71 views

Save Games on iOS with NSCoding

This is the second time I have implemented saving and loading for a game using Objective-C. I am using the built in NSCoding methods. I would love to hear opinions about NSCoding and whether or not ...
4
votes
2answers
116 views

Skill Upgrades for Strategy Game

I built a simple class to handle skill increases for the workers in a strategy game for iOS. The basic idea is that whenever a worker finishes a job, their skill (which starts at 0) will increase by ...
3
votes
1answer
100 views

Model Implementation That Calls RESTful API

I am working on a ground-up rebuild for an app that has a relatively simple purpose. Users can view/favorite entities that are backed by a RESTful API. I own both the client code as well as the API. ...
5
votes
2answers
103 views

Adding features to a strategy game

I'm working on a basic strategy game for iOS and I have a question about the overall layout of the code in the program. I added some features to the game today and I had to add code to several ...
3
votes
1answer
66 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? ...
5
votes
1answer
137 views

Simple timer class for game model

I have a simple strategy game, and I implemented a simple counter object to count down a number whenever the game ticks. I have heard about something called NSTimer but I haven't messed with it at ...
6
votes
2answers
127 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
131 views

iOS7 ChessGame UIChessboardView Design

I've been designing UIChessboardView in the likeness of UITableView using protocols and delegates. UIChessboardView.h ...
3
votes
1answer
107 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 ...
4
votes
2answers
166 views

Worker AI and Job Queue Management for Simulation Game

So I've been working on AI for a Tower Building simulation game for quite a few days, and I think the code would really benefit from review. I'm a hobbyist programmer, but I really care about doing ...
5
votes
1answer
68 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
695 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
480 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 ...
4
votes
1answer
102 views

Dynamically setting unknown properties of a subclass from parent class in Objective-C

I'm doing my best to explain how this works, but it's pretty confusing and lengthy. Let me know if there's something I can do to clarify. I'm building a class that models a custom Plist and sets its ...
5
votes
1answer
119 views

Managing People in a SimCity Clone

So I am working through a few different game ideas as I learn programming, and I could definitely use some feedback on my latest project. This is a simple SimCity clone. So far I have created a City ...
7
votes
2answers
186 views

Creating a better NSLog

So, generally when I write iOS code, I will start with a lot of calls to NSLog, which is a macro that with print the string you send it to the console. There's a ...
3
votes
2answers
128 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 ...
5
votes
1answer
118 views

Cleaning up repeated calls to NSMakeRange()

In Objective-C, many of the NSString or NSMutableString methods for comparing or manipulating strings require a range argument--that is, an argument of data type ...
3
votes
2answers
44 views

Search/Match algorithm between 2 vectors

I have 2 vectors of Facebook like pages which are represented by an ID from 2 different users. I want to verify how many liked pages are the same between these 2 users. This is my algorithm that I am ...
3
votes
1answer
46 views

Compare words in one file

I have started learning programming in ObjC from "Objective-C Programming: The Big Nerd Ranch Guide" In a task to exercise the learned stuff I've had to write a program what compares the the names in ...
6
votes
1answer
136 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? ...
3
votes
2answers
150 views

Random Name Generator

I've had ideas for something like this in the past but I've finally implemented one and I could definitely use some code review for it. Obviously the quality of the names generated will depend on ...
4
votes
1answer
86 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
245 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
65 views

Job queue that performs actions

A brief background: I'm working on a game prototype for a simple strategy game. After I created a number of possible jobs I wanted to create something to manage them. This is the first time I've ...
2
votes
1answer
249 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
154 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. ...