2
votes
1answer
123 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 ...
1
vote
2answers
153 views

How can NSObject contain an NSString if NSString is an NSObject

How can NSObject contain an NSString if NSString is an NSObject /* NSObject.h Copyright (c) 1994-2012, Apple Inc. All rights reserved. */ (NSString *)description; NSObject has a property named ...
4
votes
1answer
701 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 ...
3
votes
3answers
1k 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
331 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 ...
1
vote
1answer
258 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 ...
3
votes
2answers
551 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
717 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
8answers
636 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 ...
3
votes
3answers
3k views

Can I use a child class variables in its parent class?

I am programming in Objective C, iOS. I create a Class A which is a parent class, and Class B inherits to Class A. Now I have Class B variables which I also need to use in Class A. And also one ...
1
vote
2answers
1k views

Ongoing confusion about ivars and properties in objective C

After almost 8 months being in ios programming, I am again confused about the right approach. Maybe it is not the language but some OOP principle I am confused about. I don't know.. I was trying C# a ...
5
votes
8answers
692 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 ...
1
vote
1answer
355 views

Is Rule 9 of Object Calisthenics applicable in Objective C?

Rule 9 in Object Calisthenics by Jeff Bay (RTF) is: Rule 9: No getters/setters/properties The last sentence of the previous rule leads almost directly to this rule. If your objects are now ...
2
votes
2answers
3k views

Is this a proper implementation of an iOS MVC pattern?

After browsing the apple docs, I came across this sample of their MVC pattern: Using NSNotificationCenter and without using KVO, would this diagram below represent a correct implementation of the ...
4
votes
3answers
328 views

Which of these algorithms is best for my goal?

I have created a program that restricts the mouse to a certain region based on a black/white bitmap. The program is 100% functional as-is, but uses an inaccurate, albeit fast, algorithm for ...
4
votes
3answers
1k 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, ...
3
votes
3answers
306 views

Do simple accessors and mutators benefit from commented block headers?

Short Question Is it necessary to add the function header comments for simple accessors and mutators? Example u8 OBJ_get_state_x(void) {return obj.state_x;} void OBJ_set_state_x(u8 x) ...
1
vote
1answer
531 views

Views, View Controllers, Properties and Object-Oriented Programming

I'm new to OOP, having been a procedural programmer for many years. I'm learning iOS development in Objective-C and could use some clarity on when and how objects and properties are used. Say I have ...
-1
votes
2answers
345 views

I'm a iOS developer and I want to learn game programming [closed]

I programmed for the iphone (and a bit for mac) for the last 1 or 2 years and now I want to learn Java. I know OOP and am also farmiliar with a bit of the c syntax! Are there any books like java for ...
12
votes
7answers
803 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 ...
5
votes
5answers
374 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 ...
3
votes
4answers
1k views

Objective-C Categories and Sprawling Classes

The generally accepted programming practices I've come across tend to advise against big, sprawling classes. Does using Objective-C categories change the conventional wisdom somehow? Is it more ...