As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I am new to iOS development and am trying to figure out how it is MVC.
I see how there are controllers that produce views.
However, where are the models that represent data? I just see iOS development as controllers that "delegate" (I still don't see what that çlearly means.) functionality to each other.
iOS development done the right way is a great example of true MVC programming. If you really want to see this in action, check out Stanford's iTunes U videos.
The model for iOS will be either a CoreData store, a manually built class, etc. The ViewController is the controller and the View will be the nib or storyboard scene that contains the UI elements and is wired up to the VC.
There is a summary of MVC in the Core Competencies Guide
And there is a more detailed description in the Cocoa Fundamentals Guide
Simply put - MVC in Cocoa means that views don't get their data directly from the model objects, and model objects don't update their state directly from the views. There is always a controller in the middle that is mediating the communication.
In simply words you create views and code separately. Then you link them between themselves using class name, variables and methods. Likewise for program data.
But it is too basic question. You can learn it from the first pages of all the books about objective-c
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I usually used to do every thing programmatically, what I mean is I am not using the Interface builder instead I do every thing in the code, like UIButton or UITableView, etc..
So can anyone tell me what is the best for programming iOS, or does that make any difference on the application performance or any thing else?
I am new to programming so I wanna hear that from someone in the field, I searched in Google but I couldn't find a clear answer.
Thanks.
The advantage of using IB is that it allows you make interface really quickly without checking a hundred times that a label should be moved up or down by pixel or two. But when you use IB you can't inherit nib files so if you have a lot of common interface features in several view controllers across your app you probably should use just code.
You really should separate your views from the code. This is what for Interface Builder was made for.
It builds xml files, apart from your application logic, so when you'll need to change anything in design you won't have to touch your code, and mess anything by mistake.
All modern program designs separate view from business logic: MVC, MVVM, MVP and so on. It is considered the best pattern for programming.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I'm trying to create an application for the iPad but I would like to create a user interface with different styles and controls to those offered in xcode. I would like to create something with an interface like StumblUpon, Flipboard or any other applications that you can see over here http://www.iospirations.com/. I don't know if those kind of interfaces are created with custom controls or some kind of library. If any of you can give some pointers or directions for things to read or try I'll be very grateful. I don't think i can build an interface like those just dragging the standard controls...so that's why I'm completely lost here.
Thanks for your time!
It really depends on what you want to build specifically. You might customise some standard components using UIAppearance Proxy:
http://developer.apple.com/library/ios/#documentation/uikit/reference/UIAppearance_Protocol/Reference/Reference.html
and some other components you would build from scratch, perhaps by stacking up several views and moving them around programmatically, with custom backing classes and logic. Move them around using UIView animations, or apply transforms to them using C drawing.
Another option might be to look at if there is any open-source components on GitHub that you could use/customize. iCarousel is a good example of this, take a look through the source code.
https://github.com/nicklockwood/iCarousel
Your question is very general, the bottom line is if you want a custom component you need to build it from scratch. I'd advise against doing too much of this, as it makes your code harder to maintain, harder to to keep inline with iOS updates, and usually includes doing loads of work to achieve roughly the same function that Apple gives you for free
Another good resource (not free though) - http://www.appdesignvault.com
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
From the UIWebView, The UIWebView class should not be subclassed.
I just want to know why. There is no more detail about this.
Because I met a memory out issue in my project, which create one extended UIWebView, which could cause memory out issue. Otherwise, just create the UIWebView instance will not cause the issue.
That is why I want to address this problem and try to analyze more.
Thanks for the guy to give some comments in terms of the design pattern with MVC.
I hope to close this once get some comments for memory management.
Thanks,
iOS development works on MVC concept and V part which is View should be as generic as possible. If you write a custom view, when the model changes the view has to change as well. It becomes interlinked..This means the view cannot be reused, especially when a new UI comes out..Better to put the code in the controller portion...Key: Keep the view as generic as possible..
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
So I want to start working on specific pages on my website to have a mobile version. I was wondering how I should go about it? Do I create a new controller for each controller so that if it detects mobile then it redirects to that controller? or do i just use css to change how the page gets viewed?
If I need to create a new controlelr do I host it on a subdomain?
Comments are greatly appreciated.
Thanks!!
#TheRealKingK is right about picking up some books on the matter. There are always 1000 ways to solve a problem, so it really depends on the variables involved in your project. I read an article in the latest MSDN that touches on mobile/desktop strategies and it had some good insight.
CSS media queries are excellent for helping render things for different sized screen, but do not help with detecting hardware capabilities, or filtering out heavy media out of the site for faster downloads on say a 3G mobile network.
Having a seperate controller base could be a decent strategy. I would have ALL your controller inherit from a custom base controller that (among other things), would determine where the request is coming from, and route them to the right controller. This really depending on what the site is for and what your client needs on the desktop versus a mobile app (native or HTML5)
I am playing around with rolling an MVC4 blogging application with a custom content management on the backend. Thus far it is pretty lightweight, so CSS is working for me.
I dunno if this sounds like a nerd-rambling or not, but hopefully it gives you some insight.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 11 years ago.
I have achieved a beginner skills in mvc3 and now want to try next level.
I want to create a super simple CMS that has following features:
Support extensible skinning, i.e. start with some default dynamic skin and when change database setting for skin name, it should work with the new skin / theme
Dynamic pages loaded from database
partial view I think that can show available pages from database
Can somebody point me on how to get started? I tried to look into source code of orchard, and couple of other popular cms in mvc3 but because of lots of code, I am not just getting it properly to get started with.
Thanks in advance.
Don't worry about what other people are doing at the moment..
If this is just a learning exercise then you should look at what you want to do and then look at how to achieve that...
So your reqs are:
Extensible skinning (like themes in say WP?)
Dynamic pages
An admin area to manage pages
I guess the first thing is to get your areas setup if you want to do it that way.. (add an area for the admin section).
see here -> http://msdn.microsoft.com/en-us/library/ee671793.aspx
or
here -> http://mvccoderouting.codeplex.com/ -> this way could mean no need to set up areas... more detail on the page.
For the dynamic pages you are probably going to do something with routing a default controller.
do you reference the pages by id in the url... or do you have a key that makes up part of the url? that's one design choice you will have to make.