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

-3
votes
0answers
14 views

I cannot quite get this objective-c code right [on hold]

I have had a terrible time trying to understand the process of working with methods. Specifically, I have found no one who can truly explain the concept of a method "returning" something. I believe I ...
1
vote
0answers
12 views

Code Populates a UITableView with Staff Members using Firebase Data

What this tableView accomplishes: The end user will be able to see a list of staff that works at a church. The staff consists of 5 individuals with 5 different position titles (Minister, Pastor, etc....
2
votes
0answers
28 views

Throttling several HTTP parallell requests

I'm using the above piece of code to do some HTTP calls in parallel. This loop is running inside a NSOperation. I must throttle a bit the requests (so I don't overload the server). The code is working ...
1
vote
0answers
31 views

Create a new event and view its details

I have A page, where you can create an event using the name, location, enddate startend date, attendee, URL location, repeat options, alert options and etc. There is two scenario when the user can ...
1
vote
1answer
66 views

CommandLine StreamFormatTester

Using Chris Adamson's book Learning Core Audio I'm getting familiar with Core Audio for Mac/iOS. The code examples are 100% Objective-C. I'm trying to follow along using Swift 3. This small piece of ...
1
vote
0answers
39 views

Checking that a 6-digit number is not repeated and not in sequence

Following is the objective C code snippet to check that the 6-digit number is not repeated and not in sequence/reverse-sequence. I have just printed the proper messages in ...
0
votes
0answers
48 views

Mocking protocol with class/static functions in Swift

I am using one of the open-source Objective-C keychain wrappers to store data in iOS keychain. For test cases, I have created protocol as: ...
-1
votes
1answer
62 views

Initializing a big static array for a card-based iOS app

I have a card-based iOS app that uses a sizable static array of cards. Each card has several properties, mostly strings, numbers and boolean. The first version of this app had 3-4 properties. The ...
3
votes
2answers
63 views

Create a stack implementation that handles the multi thread scenario

MyStack.h @interface MyStack : NSObject - (id)pop; - (void)pushObject:(id)object; @end MyStack.m ...
1
vote
1answer
93 views

Controlling Drone with iOS Speech Recognition

I got a Parrot Mambo which comes with an SDK for creating your own app for controlling it. I decided to use the iOS Speech Recognition library so I could use basic voice commands to control it. The ...
1
vote
0answers
29 views

Block breaking with paddle/ball iOS Game

I created an iOS app that recreates the "ball breaking" game where a paddle is used to deflect the ball to break blocks. The main purpose is to get familiar with UI concepts since I have primarily ...
4
votes
1answer
136 views

Check for iOS version

Here's an approach i came up with for checking IOS versions. ...
0
votes
1answer
47 views

Hard-coded iOS keyboard [closed]

I am starting to write code for a keyboard in iOS. It's pretty much hard-coded and I need suggestions on how I can make it more professional style and more efficient. ...
1
vote
1answer
102 views

Using a webservice with blocks and returning data via callback

I load some data from from my webservice via a method using blocks and callbacks. From my ViewController I make a request to the data loading class and pass the ...
2
votes
1answer
73 views

Storing global constants in app delegate or singleton

I am converting a non ARC projecs to ARC. I just found that after login in my old app, the data is stored in app delegate objects, like Home_DataArray, various ...
0
votes
0answers
67 views

Priority Queue/BinaryHeap Implementation in Objective-C

I don't see a ready-made priority queue class in Objective-C. Please review this. Full xcodeproject with unit test cases at https://github.com/smartiothome/BinaryHeap Heap.h ...
1
vote
0answers
36 views

Functional-style Cocoa XML serializer and object mapper

I'm working on an XML-to-model-object serialization and deserialization library. There are three main design goals for the code: It should parse XML into and serialize from Cocoa-native collection ...
0
votes
2answers
90 views

Convert NSInteger into NSString

This is my sample code to convert a integer into string. Is it very costly to do the multiple loops of [NSMutableString stringWithFormat:..]? I.e should I just use appendString and get the NSString ...
3
votes
0answers
107 views

Sesame Street project

I started a tutorial online to get a little bit more knowledge about views. But after I did the basic I decided to finish the game. The game is a little "I spy" game where the user tries to guess the ...
2
votes
2answers
66 views

UIFont expansion

I wanted to expand the UIFont class in my application so I could use the large/medium/small letters concept. I created but for some reason it looks weird. I ...
1
vote
1answer
47 views

Sorting Timestamped Messages (iOS)

An app I'm building professionally includes rudimentary text messaging. It allows users to send from the phone, and it polls for new messages (I know, yikes. Push notifications are a future task) with ...
2
votes
1answer
187 views

NSURLSession load images on demand

I'm trying to come up with a system to populate my item images on demand, this is what I have so far. One obvious bug is that an item image could be downloaded multiple time since the ...
5
votes
3answers
278 views

Bubble Sort in Objective-C

Following is Objective-C method implementation I did for one of the most simplest sorting algorithms, Bubble Sort to sort an array of integers. Note:- I have defined it as a static method in the ...
2
votes
2answers
380 views

UIButton Subclass - Overriding getters to return placeholder/default values

I'm in the process of converting a custom UIButton from Objective-C to Swift which has custom properties and default values for those properties: MyButton.h ...
1
vote
0answers
50 views

Checking whether a directed graph contains a cycle

I create a myGraph class as shown below. Then I created an instance of the graph by giving the adjacency list as a NSDictionary and then call the isGraphCycleFree method. Will this answer look good ...
2
votes
2answers
72 views

Method to check if TicTacToe board has a winner

I have a class called TicTacToeBoard that has a [3][3] array of TicTacToeBoardCells. Doc neck if board has a winner, I check if ...
4
votes
2answers
54 views

Given a set of random strings, write a function that returns a set that groups all the anagrams together in objective-c

I would like to get feedback on the solution and a question regarding Big O. I am first converting each character in the string into the array and that would be O(n) then i am sorting the array O(n ...
1
vote
2answers
183 views

Current user as a class-level property in Objective-C and Swift

I was recently tasked with architecting a user/profile object in Objective-C and wanted the ability to access a static instance from the class level, similar in style to the way Parse manages their ...
1
vote
0answers
301 views

Implementing a HashTable in Objective-C

I am trying to implement a hash table in Objective-C. I did some testing and the implementation seems to work. I am using an NSMutableArray to store linked lists ...
4
votes
0answers
147 views

Unit Testing Against Exceptions

I am writing a Swift library. I'm writing unit tests for that library. I am afraid that some of the code that I am testing will possibly throw exceptions. In Swift, we can handle errors, but we can ...
1
vote
0answers
36 views

Create or update a row in a queue with the given new item

This works just as documented, but the code doesn't make it very clear that it does: ...
4
votes
1answer
248 views

Finding number of times each string in an Array of strings occurs in a large stream of characters (i.e large string)

Interview problem: Given a stream of characters (e.g. acacabcatghhellomvnsdb) and a list of words (e.g. ["aca","cat","hello","world"] ) find and display count of each and every word once the stream ...
0
votes
4answers
69 views

iOS SDK object to represent a place

I am building an iOS SDK to be consumed by apps. I am building an object that represents a physical place. The interface looks like so: ...
5
votes
1answer
78 views

Sorting an array of time-specific tasks of varying importance

RULES: Strict tasks must occur at the time the user selected no matter what. Flex tasks are in a priority order. Even if there is a gap big enough to fit several flex tasks with lower priority, no ...
4
votes
1answer
52 views

Reporting the status of the actions of a group of SKSpriteNodes

Working on a little Sprite Kit game, I had the problem that I wanted a couple of things to wait until a group of sprite nodes had stopped their animation. I decided to use a GCD dispatch group to ...
5
votes
2answers
485 views

First Tic Tac Toe game

I've been learning Objective C for a few days so to test my skills I went ahead and made a simple Tic Tac Toe game using the console. I already have some experience with languages such as C++, Java ...
5
votes
1answer
105 views

Custom Navigation Bar View Implementation

In one of my app, i m using custom navigation bar view to handle all Navigation Bar Properties. Is it good practice to use custom navigation in given below way? Any Optimizations need to be done. It ...
3
votes
2answers
199 views

Basic ToDo App in Objective-C

This is my first app I have made after learning programming on iOS. Most of the app is complete just the UI and some features are left to be added. Any optimizations and coding practices would be ...
6
votes
1answer
209 views

Generic singleton array with archiving and insertion functions

I find that I often have to maintain a singleton primarily to hold an array that is sometimes persisted between user sessions, that should have only one class of items, and that sometimes needs to be ...
4
votes
3answers
135 views

Amanda's Relationship Tips app, with scroll performance issues

I am having some major issues with scrolling in my active app "Amanda's Relationship Tips" Under the User Advice tab: I'm using the Parse Database as a backend to pull user data. This lag is ...
3
votes
1answer
152 views

NSUser defaults cellForRowAtIndexPath

I have been going back and forth on one certain part of my code. It works, but it doesn't seem right for some reason, as I believe there must be an easier/cleaner way to implement the ...
1
vote
1answer
85 views

Using nested if statements to select textfield for update of associated label

So I have written a very simple program using a cocoa pods library to calculate the distance between different cities. Here is what the UI looks like: So I have a textfield on top for entry of ...
6
votes
1answer
154 views

Ensuring non-expired token before every request

I'm developing an iOS application where data is fetched from a third-party REST API. Each request must contain an authorization token. In order to implement this, I've written a ...
6
votes
1answer
570 views

Unity3D native iOS plug-in to read pedometer data

I've made a plug-in for Unity3d for iOS. The plug-in's job is to get the Pedometer data from history within a specified period of time and return that to Unity for later use. I am confident in my C# ...
5
votes
1answer
64 views

Simple plotting abstract base class and example subclass

I came across a CocoaControl ZFPlot and wanted to extend here. I ended up writing a base class (ZFPlot shown below) as well as several extensions (ZFLine, ZFScatter, ZFBar, none shown here for brevity)...
3
votes
1answer
91 views

Downloading and parsing data

I developed this class to download a JSON from a server, parse the result and call a delegate back on the class that called it. Since I am self started I want to know if this is a good practise. ...
3
votes
0answers
164 views

Algorithm for downloading images

I am working on a product application where user could sell/buy. This application is based on collection view. Collection view has collection cell where it displays product image thumbnail. The ...
3
votes
1answer
94 views

Creating a class which has a method running every frame

I’m working in Objective-C, SKSpriteKit and am trying to create a class which will work in both OS X and iOS for flexibility. ...
2
votes
1answer
72 views

Have I created the <mutableDeepCopying> protocol properly?

I’m working in Objective-C, SKSpriteKit and am trying to create a class which will work in both OS X and iOS for flexibility. I have just created a new protocol for my programs: ...
2
votes
0answers
69 views

Quartz2D, circular slider performance optimization

I have a circular slider. Each time i move finger i call [self setNeedDisplay], get new angle to change handle position and mask arc. When i move very fast my CPU load about 70%, it's very hight as ...