Questions tagged [cocoa-design-patterns]

Use this tag for questions about design patterns that apply specifically to using the Cocoa and Cocoa-Touch frameworks used in MacOS and iOS development. Examples of such design patterns include, but are not limited to, 'MVC' (model-view-controller), 'delegation', 'observer', 'singleton', 'responder chain', and more. Some of these are well-known patterns but may be used in Cocoa and Cocoa-Touch in more specialised ways.

174 questions
1
vote
1 answer

Design Pattern for web service application (using APNS)

I have a web service application and i fetch my data using GET request from my server. I wanted to activate APNS on my application and read some good tutorials on this topic. And i discovered we can send about 200bytes of data inside a push. My…
ilhnctn
  • 2,210
  • 3
  • 23
  • 41
0
votes
2 answers

UIView & UIViewControllers desing pattern

Is that correct, when ViewController creates another ViewController inside its' methods (let's say viewDidLoad or viewWillAppear)? In my case - I have a view A, that contains several other views - B and C, which are quite complex by themselves, so…
peetonn
  • 2,942
  • 4
  • 32
  • 49
0
votes
1 answer

iOS Airplay viewcontroller data sychronisation

I've built an iOS 5 iPad app which makes use of a second screen. We have an admin view (on the iPad) and an external view through an HDMI enabled TV connected via the Apple DVI adapter. Both the iPad view and the TV view get the same data updates…
Ben
  • 91
  • 1
  • 5
0
votes
1 answer

Data structure based on JSON object

I just had a question based on MVC model, which I want to utilize with respect to JSON object. I am parsing some values from web services, and at this point, I don't want to store any credentials on the device at any given point for security…
topgun
  • 2,463
  • 8
  • 31
  • 46
0
votes
1 answer

Is it good to access View controller from Custom Gesture via the view it is connected to?

I am trying to manipulate a 3D object with gestures. In order to accomplish my task I need to implement some custom GesturesRecognizer. I am subclassing UIGestureRecognizer to detect the gestures. What I need to do is to access the vertices of the…
0
votes
1 answer

Set view background color according to window state

The standard source view-style side bar used in many Apps (Mail, for instance) has a blue-ish color when the window is active, and another when it is inactive - following the state change of the title bar. For various reasons, I have developed a…
Monolo
  • 18,205
  • 17
  • 69
  • 103
0
votes
1 answer

Programming Guide on General Cocoa Application Architecture

I've done quite a bit of Cocoa programming, both on OS X and iOS, and I've gained quite a bit of experience on what works, and what doesn't, with regards to how things generally fit together. However, there are still a lot of aspects of Cocoa…
jstm88
  • 3,335
  • 4
  • 38
  • 55
0
votes
1 answer

How to Set Superview From Outside of Delegate?

I have a weird design pattern for one of my aps where I have a tool bar that acts as a tab bar. Basically I add this toolbar to all of my view controllers, and the tool bar itself contains pointers to the 3 different nav controllers in my app. When…
Ser Pounce
  • 14,196
  • 18
  • 84
  • 169
0
votes
1 answer

Implement UIToolBar so it acts like a UITabBar and UIToolBar at the same time

I have an interesting problem. I have an app that I'm developing that involves photos so screen space is at a premium. Also, using disappearing and reappearing nav / tool bar controllers (like in the camera app) doesn't make sense for me. In a…
0
votes
1 answer

How do I finish tasks in the background when the tasks is not in AppDelegate?

I have an app with the following hierrachy: - Tab bar controller: - Table view controller -> Some buttons - Table view controller -> Some buttons When pressing the buttons, the user may have to wait between 1-10 seconds (depending on…
Enrico Susatyo
  • 19,372
  • 18
  • 95
  • 156
0
votes
1 answer

Xcode 4 and controllers with xibs

I have main xib with a splitview controller and ive dragged the ibactions and properties on to the AppDelegate code. So in my applicationDidFinishLaunching i would like to load a controller which uses a xib into one of the nsviews that i have linked…
Joseph Le Brech
  • 6,541
  • 11
  • 49
  • 84
0
votes
1 answer

What is the right pattern for instantiating a device specific view controller in a Universal App?

I'm new to objective-C so, bear with me. I started with the Universal App template in Xcode4 and built my application. There is a convention that the template starts you off with that I tried to stick with. For each View Controller, there's a main…
0
votes
1 answer

Objective c inheritance/protocol confusion: UITableViewController

Right now I'm trying to wrap my head around Objective C and XCode. I'm playing around with UITableView and I have problems separating the concepts behind UITableViewController UITableViewDelegate UITableViewDataSource I'm familiar with the MVC…
das_weezul
  • 6,082
  • 2
  • 28
  • 33
0
votes
1 answer

How to populate a stack with objects of various types

Using an NSMutableArray ivar, I plan to write a class that acts like a stack and which objects of various types should be able to be retrieved from. Whenever that stack threatens to run out of objects because almost all have yet been retrieved, it…
carsten
  • 3
  • 1
0
votes
4 answers

Is there a preferred way of naming instance variables in Cocoa subclasses?

When subclassing a class like MKMapView, is there a preferred way of naming the newly added instance variables? Apple says it reserves the underscore prefix for their own use, so can I just go ahead and use whatever I like without worrying about…
esad
  • 2,660
  • 1
  • 27
  • 23