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

93
votes
5answers
41k 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 ...
68
votes
5answers
14k views

Clang warning flags for Objective-C development

As a C & Objective-C programmer, I'm a bit paranoid with the compiler warning flags. I usually try to find a complete list of warning flags for the compiler I use, and turn most of them on, unless ...
25
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 ...
25
votes
5answers
7k views

MonoTouch vs Objective-C for iPhone/iPod/iPad development [closed]

For someone with .Net experience and wanting to develop for iPhone/iPod/iPad, is it worth learning Objective-C? Is MonoTouch a good alternative? What are some of the trade-offs when using MonoTouch vs ...
24
votes
2answers
7k views

Why is Objective-C not widely used beyond Cocoa environments?

Objective-C features nice object orientation, simplicity, elegance, and (as a superset of C), low level ability. It could seem like the simple, modern alternative to C++ that many people look for and ...
20
votes
7answers
1k views

Continuous Integration : which frequency?

I've always launched builds after each commit, but on this new project, the architects just asked me to change the frequency to "one build every 15 minutes", and I just can't understand why that would ...
19
votes
6answers
1k 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 = ...
17
votes
4answers
8k 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 ...
15
votes
2answers
939 views

Does objective-c's method overhead make a 'many small methods' design approach inadvisable?

I generally favour using small methods, as recommended by, amongst others, Bob Martin in Clean Code. I've also read enough about Objective-C's internals to have at least some idea about how its ...
14
votes
4answers
10k views

Where does Objective-C fall in the language performance continuum?

There seems to be a lot of discussion of the various speed merits to C or C++ as compared to say Java or Python, but I rarely see Objective-C mentioned. Roughly where does it fall in terms of language ...
12
votes
7answers
856 views

Getting My Head Around Immutability

I'm new to object-oriented programming, and one concept that has been taking me a while to grasp is immutability. I think the light bulb went off last night but I want to verify: When I come across ...
12
votes
1answer
565 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 ...
12
votes
4answers
5k views

Best book to learn objective C for experienced programmers [closed]

I am an experienced C#/C++ developer. What is the best book to learn Objective C for programmers like me? PS: I interested in developing for the iPhone.
11
votes
1answer
5k views

Organizing code for iOS app development

I've been developing an app for the iOS platform, and as I've been going along, I've noticed that I've done a terrible job of keeping my files (.h, .m, .mm) organized. Is there any industry standards ...
11
votes
3answers
827 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 ...
9
votes
9answers
1k views

Which Programming Languages Support the Following Features? [closed]

My personal programming background is mainly in Java, with a little bit of Ruby, a tiny bit of Scheme, and most recently, due to some iOS development, Objective-C. In my move from Java to Objective-C ...
9
votes
2answers
2k views

Properties under ARC: Always or public-only?

After reading an article humbly named "The Code Commandments: Best Practices for Objective-C Coding" by Robert McNally a little less than two years ago, I adopted the practice of using properties for ...
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 ...
8
votes
4answers
1k views

Where does Objective-C come from? C++ or C?

I am very confused about this programming language, Objective-C, which I heard is used to develop iOS applications. I know that it uses the principles of OOP. Would it be easier to learn if I already ...
7
votes
5answers
9k views

Why do we need to write a header file?

Before you whip out your snarky comments, I know -- this is a nooby question. This is my first time using a C based language. I'm an undergrad student learning Objective C for a computer science ...
7
votes
5answers
641 views

Does language endorsement by different platforms (Android, iOS) hurt app development?

Developing iOS or OSX based applications typically requires knowledge of Objective C, since XCode is highly tailored to this language. Android, on the other hand, has chosen Java as it's preferred ...
7
votes
3answers
319 views

Where should I put methods that make an Http Request to get data from a web service in iOS development?

I have a Model Car in my iOS application where it's parameters like name, year, value etc are fetched from a web service in order to fill a list with cars data. Where should I put the method that ...
6
votes
1answer
3k views

Is Objective-C an Interpreted or Compiled language?

I want to know if Objective-C is an interpreted or a compiled language.
6
votes
5answers
9k views

Is there a way to publish IOS app from windows/Linux?

I have been using Linux (especially, Ubuntu) and Windows 7 for a long time. I want to publish iOS apps, but I don't have a Mac or an iPhone. I don't have anyone near me who will lend me a Mac, and I ...
6
votes
2answers
3k views

Do people use const a lot when programming in Objective C?

Related: “sending 'const NSString *' to parameter of type 'NSString *' discards qualifiers” warning Sometimes, I think it's useful though. I may need to pass an a table and want to make sure that the ...
6
votes
7answers
1k views

Should a class without instance variables be considered a class?

Say you need to implement a few closely related functions that provide a piece of functionality, but there is no need to track any state between those functions, they just sometimes pass some ...
6
votes
3answers
6k views

Is it better to target iOS 5 and ARC or an earlier version with MRC?

I personally don't know much about iOS 5, but it seems like with automatic reference counting (ARC), you get rid of much of the memory management issues of the previous operating systems. So is it ...
6
votes
2answers
808 views

What is the standard for naming variables and why?

I'm going through some training on objective-c. The trainer suggests setting single character parameter names. The .NET developer in me is crying. Is this truly the convention? Why? For example, ...
6
votes
1answer
299 views

What is the convention for the star location in reference variables?

I have been learning Objective-C, noting that different books and examples use differing conventions for the location of the star (*) when naming reference variables: MyType* x; MyType *y; MyType*z; ...
6
votes
2answers
6k views

Best Way To Bring C++ Into Objective-C Project

For an upcoming XCode iOS project I'm planning on writing my views and view controllers in Objective-C. My model will be provided to me in C++. I am aware of 2 ways of using C++ in an objective-c ...
6
votes
2answers
1k views

Observing MVC, can/should the Model be instantiated in the ViewController? Or where?

I'm writing an experimental iPhone app to learn about the MVC paradigm. I instantiate my Model class in the ViewController class. Is this stupid? I'm asking because storing the id of the Model class, ...
5
votes
8answers
796 views

Learning OO for a C Programmer [closed]

I've been programming professionally in C, and only C, for around 10 years in a variety of roles. As would be normal to expect, I understand the idioms of the language fairly well and beyond that ...
5
votes
1answer
333 views

Can anyone explain to me what problem Core Data solves? [closed]

Core Data seems to add a needless layer of complexity. If you want to save data created natively by the user in an app why not just use an object and then write the data all to SQLite or back to a ...
5
votes
5answers
383 views

When designing a protocol, is it better for a method to accept a single object of a specific type, or an array?

I'm currently designing a protocol for internal use, so it doesn't make a huge difference in this particular case, but it got me wondering: Is it better for a method to accept a single object of a ...
5
votes
1answer
637 views

New to iPhone Development - iOS5 Storyboard

I'm new here and pretty new to iOS development. My question is basically, should I learn the old school development methods or just learn how to do things using the latest tools (i.e. Storyboard)? ...
5
votes
1answer
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 ...
5
votes
2answers
1k views

WWDC 2012 announced features on iOS 5?

I am relatively new to iOS development, so after watching a bunch of WWDC videos announcing new awesome features for the iPhone SDK, I still got a few questions regarding their support for older ...
5
votes
1answer
431 views

Stuff a lead developer for an Objective-C team should know

Advice on being a lead developer is welcome. Advice on being a lead developer of an Objective-C team more so. Unfortunately, I don't have experience in Objective-C (I suppose the first thing to do ...
5
votes
1answer
183 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 ...
5
votes
2answers
314 views

Data structures for storing finger/stylus movements in drawing application?

I have a general question about creating a drawing application, the language could be C++ or ObjectiveC with OpenGL. I would like to hear what are the best methods and practices for storing strokes ...
5
votes
1answer
706 views

How can I manage my ViewControllers in my game?

I'm building a very simple iOS game that doesn't require any fancy OpenGL; I'd like to stick with Core Graphics & Core Animation. I'd like to make this a fullscreen game, and my question is of ...
5
votes
1answer
373 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, ...
4
votes
7answers
1k views

Design patterns: moving object references around an application

I'm new to Programmers and I am looking to increase my knowledge of programming. Recently, a user on Stack Overflow told me using singletons is a bad idea, that they encourage tight coupling and that ...
4
votes
3answers
2k views

Objective-C As A First OOP Language?

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, ...
4
votes
5answers
627 views

iPhone development options for the [from-my-cold-dead-hands] C developer [closed]

Please forgive the humor of the title but it certainly gets my point across. I am quite familiar with C code, I can write it in my sleep and after reading through a few tutorials on iPhone ...
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 ...
4
votes
3answers
9k views

As an iOS developer, what type of technical interview questions should you be prepared with? [closed]

I just finished a technical interview yesterday and the interviewer asked about graph theory, data structure, and traversals. This has nothing to do with iOS stuff. So I came un-prepared. This was ...
4
votes
3answers
956 views

C++ vs Objective-C design principles of setters and getters

In C++ I was told that my classes shouldn't have getters and setters: Doing it wrong... blog post. On the other hand, in Objective-C, the direct use of ivar is discouraged, because the getters allow ...
4
votes
2answers
1k views

What patterns book for iOS development contains this specific information? [closed]

I've read several books on iOS development and Objective-C, however what a lot of them teach is how to work with interfaces and all contain the model inside the view controller, i.e. a ...
4
votes
2answers
9k views

IOS Variable vs Property

Just started diving into Objective-C and IOS development and was wondering when and the correct location I should be declaring variables/properties. The main piece of code i need explaining is below: ...