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

0
votes
0answers
13 views

How to unit test this method (write a UIImage to disk) [on hold]

So I have this method in a class which writes an image to disk. How can I unit test it? ...
4
votes
1answer
39 views

Unit Testing Bejeweled Wilds

I created a pretty complex algorithm for calculating matches on a Bejeweled board that kept track of matches involving wilds. After doing some in-game testing, I found quite a few bugs that needed to ...
10
votes
1answer
45 views

Changing image of a UIImageView based on a scrollView contentOffset

My task is pretty simple and my code works, it's just that my code feels a bit clumsy to me (and probably will for you too). I have a view controller (...
2
votes
1answer
55 views

Using NSPredicate with NSFetchRequest in a NSFetchedResultsController

I am learning CoreData and I wanted to have my code reviewed. As usual, I get something to work, then I attempt to refine it. I have a data model that consists of an Item entity and a subItem entity. ...
11
votes
1answer
96 views

Bedazzling My Bejeweled Animations

I've spent a few days working on the animations for my Bejeweled clone and I am pretty happy with the results so I am posting the code for review. This is the most advanced animation code that I have ...
2
votes
0answers
28 views

Store CMTimeRange into Core Data

I wanted to store CMTimeRange structures inside managed objects, so I've worked out the following: ...
2
votes
1answer
35 views

HMSegmentedControl react to tapping on currently selected segment

I'm using HMSegmentedControl, an open-source UISegmentedControl subclass. I'm trying to react to the user tapping on the currently selected segment. HMSegmentedControl only supports reacting to a ...
3
votes
0answers
78 views

Switching between view controllers that are loaded in the background

I have a dining menu app that scrapes the data from a website and redisplays it in a mobile format, displayed below: If the user swipes left and right, the app will show the previous/next meal (ex. ...
9
votes
2answers
141 views

Refilling a Bejeweled Board

When you start thinking about designing a Match 3 type game, you realize that there are a great many ways to structure the rules. In this particular variant, the direction that the player swipes the ...
12
votes
2answers
92 views

LinkedList (doubly) implementation

CKLinkedList is the implementation of a doubly linked list. I'd like to see comments on the memory management (I'm using ARC in the code below) and formatting + ...
12
votes
1answer
62 views

Board Evaluator for Bejeweled Clone

I've been prototyping a Match 3 game (Bejeweled clone) because I have an interesting concept for one, and because it is good practice. One key aspect of my version is that the matches must contain ...
4
votes
2answers
61 views

Saving Separate User Profiles

I am modularizing some of my code in order to make it reusable in future projects. The latest thing that I have created is a simple class that saves user profiles. The list of profiles is loaded ...
6
votes
2answers
65 views

Segue between view controllers using NIB files

I'm learning how to develop for iOS and I want to begin with nib's before storyboard to get a better understanding. I just set up 3 view controllers: ...
4
votes
0answers
48 views

“The Ministry Of Truth” challenge at CodeEval.com

I am working on another challenge from CodeEval.com and this is a bit harder. I would like to get some feedback on my logic of solving the challenge. Also there is probably one edge case that I ...
5
votes
1answer
58 views

Reverse Groups challenge at CodeEval.com

I am working through challenges at CodeEval.com and wanted to get your input on my code for this challenge. Given a list of numbers and a positive integer k, reverse the elements of the list, k ...
1
vote
2answers
57 views

Archiving data in file system for iOS

Being my first time archiving data to the file system, I would like to have my code reviewed. This simple test project works as expected, but I want to see if what I am doing is following best ...
8
votes
2answers
72 views

Simon's Opposites Game

I cooked up this little game today for the community challenge mentioned here. The idea of the game is that sometimes when Simon gives you a color, you should choose the opposite color (the color in ...
6
votes
4answers
100 views

Obj-C wrapper for OpenLDAP

This section of code reside in a utility class (LDAPUtility). It's purpose is to subscribe or unsubscribe a user from an LDAP group. My main questions are if I am using the LDAP library correctly and ...
4
votes
2answers
103 views

MD5 Brute Force Algorithm

I am coding an Objective-C MD5 hash "decrypter". Since you cannot decrypt such a hash function, I am approaching it with a brute force algorithm, that tries every single password combination until it ...
4
votes
2answers
74 views

NSAssert or NSLog in defaults switch case

I am wondering if I should use NSLog(@"Switch out of range") or NSAssert(FALSE,@"Switch out of range"); in the following ...
5
votes
2answers
63 views

Consecutive animations

I'm new to Core Animations, I want to fade out two different layers one after another.I write them in a CATransaction block. I wonder if there is better approach to make such animations. ...
4
votes
3answers
84 views

Unit Testing for a Complex Game

I have known about unit testing for a while now, but I am just now finally understanding how to implement it. I think that my initial implementation is a little rough so I could use some feedback. ...
2
votes
1answer
161 views

Updating UITableView rows from Core Data

I am fetching or querying all the entries from my database (core-data) at three different times in my code, which I find to be an inefficient approach to writing the code. The method ...
6
votes
1answer
100 views

Creating view rects in loop

I don't use constraints or IB to create views so it's easier to create rects this way. Does it wrong totaly? ...
4
votes
2answers
94 views

Bats Challenge from CodeEval.com

I am going through coding challenges and I would like to get feedback on one of them. I am not sure if i can post the link to the challenge but here it is. CodeEval Challenge Outside of your ...
4
votes
2answers
77 views

Too little in common to use superclass?

Is there something as "they have too little in common to use a superclass"? In my case, doing iOS programming, in a project, every screen has the same background. So I created a superclass which only ...
4
votes
2answers
91 views

Fetch plist file

I have a plist file with many nested dictionaries inside of it, and I wanna fetch them all to my code. Isn't there any more efficient way to do that than nested for-loops? ...
3
votes
0answers
103 views

UIScrollView Category utility function for auto sizing contentSize

I wanted a utility function on UIScrollView to automatically size the contentSize based on the content inside the scrollView. How is this? ...
10
votes
3answers
116 views

BOOL declaration

I have an if statement which compares two NSString. If the two strings are equal, I assign the 'YES' value to a ...
3
votes
1answer
123 views

Error-handling #ifdefs for AFNetworking requests

I am using AFNetworking 1.4.3 to send and receive network messages in iOS. My application works slightly differently in DEBUG and RELEASE mode, so I need to use ...
2
votes
1answer
261 views

Implementing NSCopying and copyWithZone

I've read some resources on implementing NSCopying and copyWithZone, but things are still not very clear. I see many ...
5
votes
2answers
69 views

Finding the Greatest Integer and Ties

I'm trying to find the greatest integer of four integers and its ties. I used the following code. Is there anyway to simplify this more effectively? ...
8
votes
1answer
150 views

Saving bytes instead of objects to write smaller files

This question is about reducing the size of files saved to disk in an infinite world 2D mining game. I finally added code to my game to save and load distant chunks instead of keeping all of them ...
5
votes
3answers
74 views

Solving first- and second-degree degree polynomials

I was writing a bit of code and I was just wondering if I was doing it the right way. I know all the syntax is right and It all works perfectly. I was just wondering if I'm doing it the right way. ...
1
vote
1answer
136 views

Correct Implementation of Custom UIView into ViewController Programatically

I am familiar with using scoreboards to construct UI elements in Xcode, but I am only beginning to learn how to make UI programmatically (with out storyboard). I wanted to know if this is the correct ...
3
votes
1answer
788 views

Generic class for displaying UIAlertView / UIAlertController on iOS

To address backwards compatibility for UIAlertView, I have come up with an interface that would seem to work for both iOS ...
4
votes
1answer
145 views

Dirty but Efficient Texture Atlas in Spritekit

I have spent quite a bit of time trying to optimize the performance of my 2D mining game. After a lot of research, experimentation, and testing, I finally found something very interesting that ...
5
votes
1answer
96 views

My iPod is slower than my iPad

Many of the variables in my 2D mining game were declared as constants like so: DWConstants.h ...
3
votes
1answer
66 views

Non-concurrent write creates bottleneck

I have some efficient methods that recursively creates a tree structure (NSTreeNode) of by looping recursively over a directory structure. The result is displayed ...
6
votes
0answers
74 views

Multithreading in a 2D Mining Game

I have implemented some basic multithreading in my 2D mining game that I asked about in a previous question. The first part is working out great (creating the initial object instances in the ...
3
votes
5answers
420 views

Turning JSON objects into custom NSObjects

Was advised to post this question here after posting to Stack Overflow. I'm pre-populating a UITableView app with data using a local JSON file. The JSON itself is very simple: ...
10
votes
1answer
97 views

Chunk Loader for 2D Mining Game

I've spent a couple days on my latest project, and I believe that I have achieved a sufficient level of efficiency to post it here for review. The idea of the game is to mine out an "infinite" world ...
3
votes
3answers
157 views

Speeding up storage of about 220000 values in Core Data

I use this code on the app's first run to save about 220000 values into core data. The file Navaids.txt has about 200000 and Waypoints.txt has about 20000 lines, where I get data from each line and ...
1
vote
1answer
56 views

Reading a property on a main thread that is set on a background thread

I am currently handling some setup of an object on a background thread (I am using a concurrent queue within the following initWithDocumentFileURL method): ...
5
votes
0answers
77 views

Modularizing a Game Scene in Sprite Kit

I am trying to modularize the main SKScene of my strategy game. I am not sure that my approach is correct so I would love to get a review of the following code. The SKScene adds the top level node of ...
4
votes
1answer
133 views

Core Data model for test-taking iOS app

I'm building an iOS app for test-taking and I want to be sure of my model before proceeding. I found this post very helpful and tried to implement a simplified version for Core Data. Here are some ...
4
votes
1answer
144 views

Reading and Parsing JSON from a Game Server

This is my naive (but currently working) attempt at reading JSON commands from a Java game server in Objective-C. I am afraid I might be doing something wrong, so hopefully this question will be a ...
3
votes
3answers
386 views

Determine if a string has all unique characters

I'm practicing algorithms (for future interviews) while learning about Big O notation and was wondering if there's a faster or more optimal way of writing an algorithm to see if a string has all ...
1
vote
2answers
286 views

Repurposing UITableView infinite scroll configuration/properties

Had my first go at implementing infinite scrolling for UITableView's in my iOS app last night, and I noticed I ended up copying/pasting quite a bit of boilerplate from one VC to the next (if I wanted ...
3
votes
1answer
56 views

Factory Class for Game World

The world in my strategy game is comprised of a number of towers. At the start of the game, only one tower is generated, and when the player discovers new towers they are created and added to the ...