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.
1
vote
0answers
27 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
1answer
30 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
0answers
22 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 ...
0
votes
0answers
26 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
130 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
170 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
33 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 ...
0
votes
0answers
34 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 ...
3
votes
2answers
45 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
0answers
106 views
Class Level Properties in Objective-C and Swift Classes
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
48 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
91 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
31 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
108 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 ...
0
votes
4answers
63 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
70 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
47 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
228 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
79 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
153 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
154 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
111 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
141 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
77 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
147 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
309 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
54 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
82 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
106 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
78 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
62 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
56 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 ...
2
votes
2answers
65 views
Method for finding all classes
This was inspired by a Stack Overflow question about getting all the classes of an application and I took it a little too seriously (or perhaps not seriously enough).
It's rather silly to do it this ...
1
vote
0answers
134 views
Synchronize access to an instance method using a static serial queue
In my current project I have a number of data services classes, each one dedicated to a specific source of data so that it's responsible of downloading data from its API, checking for local database ...
5
votes
1answer
81 views
Optimise Code for KukuKube Game
I developed a Kuku Kube game for iOS. Each time I choose a correct different color tile, it will increase a number of tile quantity 2x2 3x3...10x10. How to optimise the code each time the tile ...
0
votes
4answers
822 views
My own method for sorting numbers in array
I've written some method for sorting asc and desc numbers in array. All I want to know is this good logic, and is there a space for improving this code?
...
5
votes
1answer
250 views
Repeatedly check URL for change on iOS
I am wanting to constantly check a URL http://www.example.co.uk/untitled.php which will either return 1 or ...
-1
votes
1answer
225 views
Reading QR Code
What I need to accomplish is matching the QR code to the one I have created. This code works, except it takes at least 30 seconds to verify that it has matched my QR Code. How can I make it faster?
...
10
votes
1answer
223 views
Blurring an Image
Lately, I've been part of a team working on a utility library for iOS called Thundercats (on Github). We're about to start working on some changes and upgrades in preparation for a 2.0 release, so we ...
8
votes
2answers
433 views
iOS Utility methods for UIView
Lately, I've been part of a team working on a utility library for iOS called Thundercats (on Github). We're about to start working on some changes and upgrades in preparation for a 2.0 release, so we ...
3
votes
2answers
183 views
Find all multiples of a number in given range in reverse order
I have a problem set which requires me to print all the multiples of a number in given range in reverse order.
So far I have tried this but not sure it is optimized or not!
...
-1
votes
2answers
429 views
Quicksort for Objective-C
This is quite plain vanilla, but I'm hoping for Objective-C specific feedback. Also I'd be interested in what folks think about sorting in Objective-C vs. doing all sorting in C or C++ (and which?) ...
7
votes
1answer
68 views
Draw editable angles
One of the first things I did when I learned Objective-C was to create a little canvas with editable angles. Basically, you tap to create points. Every tap connects to the previous tap. So if you tap ...
4
votes
1answer
119 views
Imitate UITableView reordering interaction
I have a UIScrollView full of vertically stacked subviews which I want the user to rearrange as they desire. I've implemented a ...
11
votes
1answer
102 views
Top wiki pages as an app
I recently did an interview task. I was rejected because of bad code quality. There was two tasks. Here I will present the first, second will be posted in time.
This project is avalible on GitHub
...
2
votes
2answers
115 views
Getting hours during the day
I have this method that returns an array of all the hours for the past 24 hours, ex: if the current time is 3:24pm it looks like @[3pm,4pm...12am,1am...2pm,3pm];
...
2
votes
1answer
111 views
Intercept URL containing values or not
I need to intercept a URL and go outside the WebView if the URL contains MAPS or DOCUMENTS ...
5
votes
1answer
323 views
Fetching Background Data in iOS View Controller
I am trying to come up with a way to fetch the same data both when the application is running and when it is in the background. The code I have written so far works... I just think it is very messy ...
3
votes
2answers
71 views
Comparing IDs in two arrays
I have two arrays that I need to compare if their IDs are equal. This is how I am currently doing it:
...
7
votes
1answer
120 views
Comparing 2 arrays of dictionaries and saving user preferences
I will start by explaining the situation and then show some code. I have an app that has an array of "default" settings to display on a user's dashboard. The user can modify these settings to enable ...