Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Feedback on X-Code needed.

  • 11-04-2012 7:28pm
    #1
    Registered Users Posts: 36


    I'm a VERY inexperienced App developer.

    Through books and online tutorials, I'm in the final stages of creating an App for a customer.

    I was wondering is there any possibility of someone checking out my project if I put it into Dropbox?

    It would be GREATLY appreciated.

    Thanks


Comments

  • Registered Users, Registered Users 2 Posts: 2,030 ✭✭✭Colonel Panic


    Feedback is in the app well written? Does it crash?

    Is the customer paying you for the app. If I test it, will you pay me a cut of what you get?


  • Registered Users Posts: 36 adie1988


    Customer is not paying for the App.

    Just want to see if it's well written.


  • Registered Users, Registered Users 2 Posts: 7,182 ✭✭✭Genghiz Cohen


    Post up a few snippets. Especially things you think could be done better.
    Not like 50 lines of code mind, just give us an idea of your coding standards.
    Wrap them in [code][/code]tags


  • Registered Users Posts: 36 adie1988


    I know you said not to write 50 lines of code but it's pretty repetitive.

    The main thing I'm worrying about is my multiple views.

    It works fine on the simulator, but i think the amount of views I have may be too much.

    In the app there's the main menu view with 8 views off that view. Each of those views has four of them. Making 34 views altogether (including main menu and a contact information thing)

    In my MainWindow.xib file I've 34 views.

    The Outlets are as follows:
    
    IBOutlet UIWindow *View3;
    IBOutlet UIWindow *View31;
    IBOutlet UIWindow *View32;
    IBOutlet UIWindow *View33;
    IBOutlet UIWindow *View34;
    IBOutlet UIWindow *View4;
    IBOutlet UIWindow *View41; 
    IBOutlet UIWindow *View42; 
    
    ... and so on until...
    
    IBOutlet UIWindow *View104;
    
    

    The actions are like this...
    
    -(IBAction)SwitchTo3 {
    	[View31 setHidden:YES];
    	[View32 setHidden:YES];
    	[View33 setHidden:YES];
    	[View34 setHidden:YES];
    	[window setHidden:YES];
    	[View3 setHidden:NO];
    	
    }
    
    -(IBAction)SwitchTo31 {
    	[View3 setHidden:YES];
    	[View31 setHidden:NO];
    	
    }
    
    -(IBAction)SwitchTo32 {
    	[View3 setHidden:YES];
    	[View32 setHidden:NO];
    	
    }
    -(IBAction)SwitchTo33 {
    	[View3 setHidden:YES];
    	[View33 setHidden:NO];
    	
    }
    -(IBAction)SwitchTo34 {
    	[View3 setHidden:YES];
    	[View34 setHidden:NO];
    	
    }
    
    

    ... and so on.

    Does this sound Ok?

    It seems like a lot of views for one .xib file.


  • Registered Users, Registered Users 2 Posts: 11,987 ✭✭✭✭Giblet


    Are you doing a lot of drag and dropping with the interface builder / Storyboard view?


  • Advertisement
  • Registered Users Posts: 36 adie1988


    I am with Interface Builder. With my 'Touch up Inside's... and setting the views and stuff.

    Have all that done though.


  • Registered Users, Registered Users 2 Posts: 11,987 ✭✭✭✭Giblet


    It just looks like you are using tools to build an application. This isn't the best idea as you are hands off with the inner workings of the code, which will cause problems when you want to change functionality or debug something. You should try doing a lot of this stuff by hand, and you should be named variables properly. Whats view23 ? Why is it different to view32.


  • Registered Users, Registered Users 2 Posts: 2,030 ✭✭✭Colonel Panic


    What is in all the views? Usually an iPhone app hangs off a UINavigationController and a main view, and when you touch things, it'll instantiate and push new views on to the view stack along with any other data it needs like a database context or whatever.


  • Registered Users Posts: 36 adie1988


    I'm not really sure what you're talking about.

    I actually am doing the coding by hand. It took me a while to figure out the coding for multiple views and when I figured out how to change one view then I just kept going and kept adding more code until I got it right.

    The app is an app for a small art gallery.

    Off the main main menu are links to bios of artist, and off each bio are 4 links with each having an image of an art work and its details.

    e.g.
    window (main menu), which contains links to View3, View4, View5, etc.

    View2 (Contact Page)

    View3 (Artist No. 1)
    View31 (Artist No. 1, painting No. 1)
    View32 (Artist No. 1, painting No. 2)
    View33 (Artist No. 1, painting No. 3)
    View34 (Artist No. 1, painting No. 4)
    View4 (Artist No. 2)
    View41 (Artist No. 2, painting No. 1)
    View42 (Artist No. 2, painting No. 2)
    etc.

    When I 'Build and Run' in XCode, it runs fine on the simulator with no bugs, but will that actually be the case when I uplode it to iStore?


  • Registered Users, Registered Users 2 Posts: 11,987 ✭✭✭✭Giblet


    You only need one viewcontroller that can dynamically load any artist + picture. You can wire up events to switch between artists or pictures.
    You just pass in the Artist ID + Picture ID and load it from a datasource.

    What you are doing is hardcoding each artist + picture into it's own separate view, which is inefficient, and will be a nightmare to extend.


  • Advertisement
  • Registered Users Posts: 36 adie1988


    Will the way I've done it cause problems?


  • Registered Users, Registered Users 2 Posts: 11,987 ✭✭✭✭Giblet


    Hard to tell. but it might be terribly slow, and be prone to memory leaks.


  • Registered Users, Registered Users 2 Posts: 7,182 ✭✭✭Genghiz Cohen


    You have UIWindows instead of UIViews. You're only supposed to have 1 UIWindow at a time.

    You'd probably get away with like 5 view classes, then create and populate them as the user taps around the app.

    Something I did in a recient project was to have an NSMutableArray of UIViews (called viewHierarchy or something) and 2 methods to move between the views.
    When the user taps a button to go to a new view, you create the new view add it to the end of the NSMutableArray and call a method like:
    nextView()
    {
        if([viewHierarchy count] < 2) return; //If there is less than 2 views in the array, crap out
        [[viewHierarchy objectAt:[viewhierarchy count-1]] setHidden:Yes];
        [[viewHierarchy lastObject] setHidden:No];
    }
    
    and the opposite for moving back a view.

    Having that number of views and methods to do the same thing is crazy.


Advertisement