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

24
votes
3answers
1k 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 ...
3
votes
3answers
685 views

Why use protocol, not call the method directly?

I was asked this question in an interview. For eg: UITableviewDelegate protocol has CellForRowAtIndexpath. Why make it a delegate method in a protocol not a method in the UITableView class and call it ...
0
votes
1answer
442 views

Which is faster NSDictionaries or object properties?

If I abandon creating model objects which I only use to pass information and use NSDictionaries instead and have constant for keys in the same place where I am using the model, then does it have any ...
1
vote
2answers
452 views

Why do we use networking libraries instead of plain NSURLRequests and NSURLConnection ?

in iOS development, I have often seen people creating a networking module to interact with their APIs. This module generally sits on top of a networking framework like MKNetWorkKit or AFNetWorking. ...
0
votes
1answer
151 views

Truth condition testing with BOOL

BOOL myBool; myBool = YES; ... if (myBool) { doFoo(); } I have read that because there are instances where the above does not actually call the doFoo() function, it is best to instead always test ...
1
vote
1answer
218 views

PayPal proof of payment - is there a need to store it at our server?

I am developing an iPhone app, which I am integrating with PayPal. I did it successfully using PayPal library. I am testing it on sandbox mode. When I transfer money from one account to the other ...
0
votes
1answer
186 views

NSException in init when having a custom designated initialiser?

I have a custom View Controller that is a subclass of UIViewController that requires a data object to be set up properly. Without this object, showing the VC doesn't make any sense. So I created a ...
4
votes
1answer
822 views

Getting rid of Massive View Controller in iOS?

I had a discussion with my colleague about the following problem. We have an application where we need filtering functionality. On any main screen within the upper navigation bar, there is a button ...
2
votes
2answers
2k views

Programming against a protocol in Objective-C

I stumbled accross the SOLID principles. There is one burning question. Should I always use protocols? I never saw someone using them in the way that a Java developer would use them. I tried it in a ...
2
votes
4answers
536 views

Is Objective C a reasonable way to learn C?

I want to learn C but I tend to learn best when I have a project to work on. I've never done iPhone development, so I'm hoping to kill two birds with one stone. Will learning objective c also teach me ...
2
votes
2answers
537 views

What is expected of an intern iOS SDK programmer from self-taught arena? [duplicate]

edit: I'm asking for samples an intern would want to show, please don't answer soft-skills that get this marked as a dupe, it is NOT. To be more specific, what sample apps and background, is minimum ...
2
votes
1answer
1k views

Why is it impossible for Google to port V8 along with Chrome's codebase in C/Obj-C on iOS?

Google has given a reason that All apps on iOS have to run in the sandbox environment except for special apps by apple that get to tap into some private APIs. So Chrome on iOS uses whatever the ...
2
votes
1answer
214 views

Objective C - nested messages … confusion about

Wonder if anyone could shed some light on this messaging construct: The documentation says that messages appear btwn brackets [] and that the msg target/object is on the left, whilst the msg itself ...
3
votes
2answers
186 views

Is it a good idea to put declaration of protocols for delegates in a private category interface?

I have a View Controller or a View that implements delegate and dataSource methods of UITableView. These methods are not going to be used outside this class. So is it a good idea to make the ...
1
vote
1answer
984 views

How to implement a Theme for View Controllers in an iOS app?

I have an application, where font size, font type, color, background color, image and a lot of things change based on theme. I realised in the beginning itself that using enums to denote themes and ...
-1
votes
1answer
103 views

Using third party/ open source controls [closed]

I usually feel reluctant to use any third party or open source controls while coding in Objective-C iPhone due to following reasons. Open source controls are developed in incremental manner. So once ...
4
votes
2answers
404 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 ...
3
votes
3answers
659 views

Why did Apple choose to design its programming language with future and past tense method names?

There are a lot of methods like this in iOS/Objective C: - viewDidLoad - viewWillAppear: - applicationDidFinishLaunching I've just been having a discussion with some colleagues about this design ...
1
vote
1answer
148 views

How to embed an article in the source code?

Sometimes, I notice typos in articles (blog posts) or books in source code that appears in the body of the article. It may be an indication that the code has been manually copied and pasted (e.g. ...
4
votes
1answer
1k 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
1answer
303 views

Implement a file system for ios devices

I've read that ios apps can communicate via unique urls. An online tutorial on tutsplus says Communication between apps provides your application with an opportunity to take advantage of other ...
3
votes
3answers
2k views

What is a static method compared to instance/class/private/public methods?

I'm learning programming in Objective-C and I can't understand what a static method is. I know what class/instance/private/public methods are. Can someone explain what it is using an example and ...
0
votes
1answer
68 views

Program Structure for Table Cells Representing Objects

So I have a program with "cue" objects and each have their own table cell. The thing is that the table cells have loading bars on them that represent the progress of the cues. This presents the ...
1
vote
1answer
339 views

Is object-oriented conceptual thinking something you build with experience? [closed]

I know that the answer is pretty clear because you get better on everything with time and experience. But I'll tell you where I'm coming from: A couple of months ago I decided to learn iOS ...
2
votes
4answers
252 views

Should I read a chapter about Memory management if now a days we mostly use ARC?

I'm reading a book on Objective C, and I was wondering about 2 things: Should I take the time currently to read a whole chapter on memory management? If you are doing a really good job on manual ...
0
votes
2answers
277 views

Why is “working with files” is an important subject when learning Objective C?

I'm reading a book on Objective C, and I was wondering how important the subject Working with files for learning to develop iOS in particular? On you tube the tutorials are very short, maybe 10 min ...
4
votes
3answers
794 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 ...
3
votes
1answer
628 views

Can Objective C categories serve the same purpose as Traits do in Scala?

The statement of the question seems little abstract to me, so please read the details below. Since the time when C++ was the first choice Object Oriented Language for almost anything, we had a big ...
13
votes
4answers
5k 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 ...
4
votes
2answers
972 views

Core data syncing (deletion) using a custom REST web service

I need to sync my local core data stack against a server running a persistent data storage underneath the covers. (I've gone through other posts here and on SO on similar topics) My requirements: ...
0
votes
1answer
874 views

Preventing override of methods in Objective-C [closed]

Objective-C lacks private methods or java-esque final methods. This means that it is possible for a subclass to (accidentally) override some of the internals of a superclass. How does one prevent ...
1
vote
1answer
275 views

How to avoid huge functions with made up of enums and if-else or switch case when dealing with server response in iOS?

in my application, I have a request type associated with variety of API calls I make to the REST server. when the response from server comes in the same delegate method for web engine's response, I ...
0
votes
1answer
990 views

Pictures from iPhone to clients FTP server - Directly (iPhone->FTP) or Cloud (iPhone->Amazon->FTP)

My clients wants to take pictures with their iPhone's and place them collectible on their server, suggested by FTP. I can see there is two solutions: Directly upload from the iPhone to the FTP ...
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 ...
1
vote
3answers
758 views

When should one use “out” parameters?

In Objective-C, there are several methods like initWithContentsOfFile:encoding:error: where one passes in a reference to an NSError object for the error: parameter. In this example, the value of the ...
2
votes
4answers
554 views

Strategy for avoiding duplicate object ids for data shared across devices using iCloud

I have a data intensive iOS app that is not using CoreData nor does it support iCloud synching (yet). All of my objects are created with unique keys. I use a simple long long initialized with the ...
3
votes
6answers
4k views

Why was Objective-C popularity so sudden on TIOBE index?

I'd like to ask a question that is pretty similar to the one being asked here, but for Objective-C. According to TIOBE rankings, the rise of popularity of Objective-C is unprecedented. This is ...
6
votes
1answer
281 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; ...
2
votes
2answers
428 views

Objective C style nil in java?

Objective C has a concept of a nil object which would accept any method call with any parameters without complaining and silently return another nil. I have used something similar in Java using ...
2
votes
2answers
193 views

see what ARC does?

If I understand correctly, all ARC does is automatically add memory-management statements such as retain and autorelease in the proper places in a program. Is there any way to see all the ...
1
vote
2answers
1k views

Adhering to a protocol and being a subclass at the same time?

In objective C, I have a situation where I would like to have an abstract protocol (interface) with 5 methods and 4 properties, but at the same time, I'd like to have a common implementation of 3 of ...
3
votes
4answers
363 views

Is conditional return type ever a good idea?

So I have a method that's something like this: -(BOOL)isSingleValueRecord And another method like this: -(Type)typeOfSingleValueRecord And it occurred to me that I could combine them into ...
3
votes
2answers
618 views

Something similar to Objective-C categories in other languages?

I understand Objective-C categories and how they become useful, but I always have a hard time explaining the concept to other programmers that are not familiar with Objective C. Maybe I'm just bad ...
4
votes
2answers
764 views

Design pattern and best practices [closed]

I am an iPhone developer. I am quite confident on developing iPhone application with some minimal feature. I would consider myself as a fair application developer but the code I write is not so much ...
5
votes
2answers
260 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 ...
6
votes
5answers
5k 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 ...
1
vote
2answers
289 views

Let a model instance choose appropriate view class using category. Is it good design?

Assume I have abstract base model class called MoneySource. And two realizations BankCard and CellularAccount. In MoneysSourceListViewController I want to display a list of them, but with ListItemView ...
5
votes
8answers
687 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 ...
2
votes
1answer
86 views

What is the name of the method to find index from array, in Objective-c?

I have a following method to find index of a book object which have a book name: +(NSInteger)indexXXX:(NSString *)bookName XXX:(NSArray *)books { for (NSInteger i = 0; i < books.count; i++) { ...
6
votes
2answers
5k 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 ...