Objective-c is a highly dynamic message-based object-oriented language, superset of C, that is a primarily used for programming Apple's Mac OS X and iOS platforms.

learn more… | top users | synonyms

-3
votes
0answers
10 views

popViewController doesn't work on UITableViewController [on hold]

I have a UITableViewController embedded in a UINavigationController. Calling self.navigationController popViewControllerAnimated:YES in didSelectRowAtIndexPath method has no effect. My ...
-2
votes
0answers
30 views

How and where is Swift and Objective-C interoperability implemented?

The question seems very generic but it does have a good meaning. For some time, I'm trying to find out exactly how objective-C and Swift can work together. I have been using them both and it works ...
0
votes
1answer
193 views

Do iOS frameworks require the same internal versioning as OSX frameworks?

I have been reading through the apple documentation for creating frameworks for OSX and iOS. Reading about the structure of frameworks, I began to wonder if there is really any need to create the ...
1
vote
1answer
258 views

Manage the persistence of entities on iOS in several places: CoreData on the device, iCloud and on a REST API

For the needs of a project, I would persist the datas contained in Core Data in several places depending on the state of the user. If the user is logged to my API -> Persist the datas on my API. ...
2
votes
3answers
208 views

Objective-C Lesson in Class Design

I have the following classes: Teacher Student Class (like a school class) They all extend from KObject that has the following code: - initWithKey - send - processKey Teacher, Student ...
0
votes
1answer
60 views

Does variable type specification lead to any performance difference?

Let's say I have a very long method which basically creates a responsive and resizable layout for a user interface by using a few fixed values and a few variable ones taken from an element's ...
1
vote
0answers
18 views

How should I manage updates for a this document object?

I have a object model like Document->Section->Value but Value can also be a table type so I then have Value->Row->Column->Value. The problem is that the object graph for a single document can be ...
0
votes
2answers
102 views

Which design pattern to choose when supporting multiple analytic tools?

I have spent quite some time learning all possible design patterns but I cannot find the ideal one for the following case. I am developing an iOS app where we are using multiple analytics tools like ...
4
votes
3answers
231 views

How do you define stateless methods while keeping them together in Objective-C?

I have a few methods which are stateless: loginWithEmail: password: completion: signUpWithEmail: password: completion: resetPasswordForUsername: completion: Currently what I do is I create a class ...
21
votes
5answers
12k views

success:/failure: blocks vs completion: block

I see two common patterns for blocks in Objective-C. One is a pair of success:/failure: blocks, the other is a single completion: block. For example, lets say I have a task that will return an object ...
2
votes
2answers
191 views

Do nested conditionals have a significant performance impact? [duplicate]

This is a question that lives in my mind from a long time. Does the use of multiple nested conditional statements impact the performance of a taken code? So far I know that programmers have created a ...
2
votes
3answers
2k views

Objective-C As A First OOP Language? [closed]

I am just finishing the second semester of my CS degree. So far I learned C, all the fundamental algorithms and data structures (e.g., searching, sorting, linked lists, heaps, hash tables, trees, ...
5
votes
2answers
2k views

Objective-C class cluster pattern

I have many sublcasses of one class. I choose concrete class based on type (simple enum). I like idea of class cluster. Should i use it or just create factory class (but each class in objective-c is ...
1
vote
2answers
900 views

Is it necessary to use “-” or “+” before every property or method declaration in Interface and why?

I'm new to objective C, I'm following "Objective C 5th Edition Stephen Kochan and I don't have anyone to ask my doubts to. I'm confused with this question: Q. Is it necessary to use "-" or "+" before ...
3
votes
3answers
600 views

Why does Objective-C store objects on the heap instead of on the stack?

I have a basic understanding of what a "stack" and "heap" are. You use a stack to store items in memory that should be read and/or removed in a last-in-first-read/removed manner. To steal another ...
1
vote
1answer
242 views

Mixing OOP and Non-OOP

I'm working on a command line interface text based game. I'm writing it in C but there are various ways in which I could refactor the code by using Objective-C: using NSDictionary to allow me to ...
0
votes
1answer
79 views

Swift: Creating an empty array [closed]

The following: var emptyArray = [String](); What do I need the parentheses () for? [String] says, that the array accepts strings only. But why do I have to put the () there?
1
vote
1answer
195 views

Why isn't the isa pointer hardwired in Objective-C classes?

I've been studying the Objective-C runtime for some years, and even hacked libobjc a little bit (both Apple's and GNUStep's), and I've been wondering about a design decision on the compilers. Every ...
1
vote
0answers
39 views

Xcode rolling video architecture

I am going to writing an App that records video but to save on memory space I want to allow the user to continually record and then, when something happens, they can save that period of time (post the ...
7
votes
2answers
1k views

Why does Swift not require semicolons? [closed]

I normally code in either c# or Objective-C and recently took it upon myself to learn Apple's new programming language - Swift. The first thing I noticed is that you don't need to add semicolons to ...
14
votes
3answers
2k views

Massive View Controller - IOS - Solutions

I'm sure every new iOS developer has the following problem: The View Controllers get very fast crowded with code for various purposes, easily getting to 500 + lines of code. This is how it looks like ...
1
vote
0answers
145 views

Securing a private API used by an iOS App

I have an app that uses an API server and I do not want to have anything other than it to be able to use that API. I know this isn't totally possible, but I want to do what I can. I don't think my ...
0
votes
2answers
339 views

Why can't I use an operator like plus sign to concatenate strings? [closed]

Why in Objective-C we should be typing explicit references to methods like stringByAppendingString to concatenate strings, when in some other languages we can use operators for that? For example, ...
4
votes
1answer
194 views

Is Apple sample code the “correct” way to go?

I'm in a place were I know how to build apps and have submitted at least 5 for different clients to the app store and wanted to step up my game. So of course I went to Apple resources and analyse the ...
5
votes
1answer
217 views

Why check if object is nil

What's the point of the if statement in the following code: - (NSArray *)myMethod { NSArray *array = nil; if (!array) { array = [[NSArray alloc] initWithObjects...] } return ...
0
votes
0answers
52 views

Abstracting AutoLayout sensibly - why is this so conceptually tough and where should I begin?

Below are some babbling, probably incoherent thoughts, but I am so stuck on this problem and I feel like an elegant solution is possible. Though it is indisputably awesome, and makes programatic view ...
2
votes
2answers
250 views

Example of writing unit test for a method

I am writing unit tests for an iOS application. I clearly understand the benefits of writing unit tests & TDD, but I am confused about what kind of tests you can write for methods like this; ...
1
vote
1answer
102 views

Is Objective-C the only language with infix arguments?

One of the things I like about Objective-C is the use of infix arguments when calling a method. [myDictionary setObject:myObject forKey:@"key"]; where the method name is setObject:forKey:. Does any ...
3
votes
3answers
379 views

In Objective C, what English words can I conceptually associate to the symbols?

I'm learning Objective C (from a C# background) and am having difficulty understanding the unusual method signatures and am looking for a shortcut to make the learning curve less steep. When reading ...
1
vote
1answer
93 views

Objective-c anonymous property coding style

If I have an interface defined like @interface MyClass @property (nonatomic, copy, readonly) NSString *myString; @end so that myString is externally visible but can't be written, what would be ...
12
votes
1answer
716 views

Naming convention for iOS/OSX open-source projects

Not always but most of the time, you will find iOS or Mac OS X open-source projects with names starting with the initial letters of the author first and last names. If a project were to be authored by ...
0
votes
1answer
1k views

How static functions are better than Class Methods in Objective-C [closed]

I was going to through this post by Mattt Thompson in which he mentions that Static functions are nicer than shoe-horned class methods I just don't see any flaw with Class methods in ...
5
votes
1answer
823 views

How do you write tests for methods that interact with data in system files?

I'm trying to be proactive about writing an iOS app in a test-driven manner. However, I'm stumped as to how to test a method that is to interact with real system files. For those familiar with iOS, ...
-2
votes
1answer
162 views

How come the keyword for declaring a class is 'interface' [closed]

What is the relationship between a class and an interface in objective-c? How come we declare a class using @interface instead of @class?
1
vote
1answer
286 views

Does key-value observing between model and view violate MVC?

In MVC the Controller is the go-between for the View and the Model. So the Controller should be the one that observes or receives changes from the Model and View and updates the other accordingly. I ...
103
votes
5answers
50k views

How can Swift be so much faster than Objective-C in these comparisons?

Apple launched its new programming language Swift at WWDC14. In the presentation, they made some performance comparisons between Objective-C and Python. The following is a picture of one of their ...
2
votes
1answer
713 views

Performance of Class methods vs singleton instance methods

In my app, I'm using both strategies: I have a Utils class, it only has class methods that I call for doing common global methods, like NSString validation, etc. I have an app-wide singleton class ...
5
votes
2answers
513 views

What is the most appropriate testing method in this scenario?

I'm writing some Objective-C apps (for OS X/iOS) and I'm currently implementing a service to be shared across them. The service is intended to be fairly self-contained. For the current functionality ...
4
votes
1answer
1k views

Inheritance, Composition and Protocols

I'm reading a book on general object oriented concepts to try and gain a solid understanding of everything. One thing that is throwing me off is the difference between Inheritance and Composition. I ...
26
votes
3answers
2k views

Is it considered a bad practice to add logic in a property setter?

I jumped in to a project and I see that the other developers are adding a lot of logic in the setters of synthesized properties. I understand how this works, but I think that it makes it hard to ...
2
votes
1answer
7k views

Calling static method from instance of class

As a developer I am fan of static methods. Recently I come across difference between OOP languages about this static methods. All OOP language use static method to access any method without ...
8
votes
3answers
3k views

Is objective-C++ being phased out? [closed]

Is apple phasing out support for objective-c++? Note the following: In the Objective-C language manual, there used to be a section on mixing objective-c and c++. That section is now missing. Links ...
6
votes
1answer
4k views
1
vote
4answers
322 views

Security in an iOS game?

I'm part of a team building an iOS game which has multiplayer elements. A concern right now is how to make the game more secure, from user manipulation. I know there's a lot of multiplayer games out ...
4
votes
5answers
1k views

Are design patterns independent of programming languages?

I have been recently working on Objective C and came across use of Delegate pattern. I had seen most of the common patterns theoretically in Java, thanks to the Head First book. But at times looking ...
19
votes
6answers
2k views

The importance of duplicate code removal [duplicate]

I tried to explain to a coworker the gravity of having duplicate code in a project, on this piece of code: + (void)createIapInParse:(SKPaymentTransaction *)transaction { Reachability *reach = ...
0
votes
1answer
197 views

What effect does using multiple childViewControllers views inside a ContainerViewController have on memory?

I have three childViewController views inside my ContainerViewController and these three views are inside a horizontal scroll view. My intention is to build an app that has a custom camera on one ...
0
votes
1answer
178 views

Macro guard in Objective-C

I have noticed that many famous libraries written in Objective-C (eg. AFNetworking) use the macro guard inside their header files. Im aware that the #import directive, which works exactly like ...
0
votes
0answers
287 views

Delegate method privately called from delegate itself?

One has established design patterns so ingrained in their brain, that when sometimes somebody does something unexpected, it is a revelation. My colleague in an iOS project did call the delegate ...
0
votes
1answer
394 views

Approach to managing multiple services like Evernote, Google drive, dropbox in iOS

I'm trying to think up a scenario when I'd have three different forms of NSData (or whatever) to be sent to three different services like Evernote, Google drive, Dropbox. Granted, each of those has ...