Advertise here




Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Right way to set up UITableView inside a UIView

MaxnerMaxner Posts: 50Registered Users
edited July 2011 in iOS SDK Development
This is just to make sure that I did it right. So i have the UIView which is the view of Files Owner, and inside the UIView i have a small UITableView. Since Files owner is a subclass of UIViewController i cant use File Owner as data source (the app will crash). So what i do is add a UITableViewController to the .xib and set the class to the UITableView Subclass class file. Then i connect data source with the TableViewController and delegate with files owner, then everything works, but is it the right way to do it?
Post edited by Maxner on
Check out my first App: <a href="http://itunes.apple.com/us/app/canada-taxes-tip-calculator/id449443981?l=de&ls=1&mt=8" target="_blank">Canada Taxes & Tip Calculator</a>
· ·

Replies

  • shadowfaxshadowfax Posts: 8New Users
    edited July 2011
    I'm a bit uncertain of what you're trying to do, or the steps you describe (A screenshot would be useful)... or maybe it's because I'm still a newbie to X-Code.

    However, why would the app crash? If you implement the protocols and the delegate correctly there should be no problem. I've got a UIView subclass (Not even UIViewController) handling a UIPickerView and a UIToolbar inside it (All in one class).

    However, why don't you use a UITableViewController?

    Usually a UITableView that doesn't reach the edges of the screen doesn't show up nicelly. Usually when someone ask for this kind of layout it is because there is something at the top or at the bottom of the list. If that is the case, I guess it would be best to use the tableHeaderView or tableHeaderView.

    Best regards
    · ·
  • MaxnerMaxner Posts: 50Registered Users
    edited July 2011
    shadowfax wrote: »
    I'm a bit uncertain of what you're trying to do, or the steps you describe (A screenshot would be useful)... or maybe it's because I'm still a newbie to X-Code.

    However, why would the app crash? If you implement the protocols and the delegate correctly there should be no problem. I've got a UIView subclass (Not even UIViewController) handling a UIPickerView and a UIToolbar inside it (All in one class).

    However, why don't you use a UITableViewController?

    Usually a UITableView that doesn't reach the edges of the screen doesn't show up nicelly. Usually when someone ask for this kind of layout it is because there is something at the top or at the bottom of the list. If that is the case, I guess it would be best to use the tableHeaderView or tableHeaderView.

    Best regards

    I can't use a TabelViewController as said before, but the table goes till the edges apart from the bottom, where i have other stuff, the app isn't crashing, i just wanted to clarify things and know if im doing it right.
    Check out my first App: <a href="http://itunes.apple.com/us/app/canada-taxes-tip-calculator/id449443981?l=de&ls=1&mt=8" target="_blank">Canada Taxes & Tip Calculator</a>
    · ·
  • BrianSlickBrianSlick Treadmill Desk Ninja Posts: 10,507Tutorial Authors, Registered Users @ @ @ @ @ @ @ @
    edited July 2011
    See the table view link in my signature for guidance.
    BriTer Ideas LLC - WWW | Facebook | Twitter | LinkedIn - Professional iOS App Development. Available for hire.

    SlickShopper 2 | Leave a PayPal donation

    Free Xcode Tools: NSLog Utility | Getter Utility
    GitHub Projects: BTIKit | BTICoreDataKit

    Are you a newbie? Things you should read:
    Definitive Guide To Properties | UITableView Series | A Model (Object) Is A Beautiful Thing
    · ·
Sign In or Register to comment.