veryy simple answer needed.

Discussion in 'iOS Development' started by veeloc, Mar 13, 2009.

  1. veeloc

    veeloc New Member

    Joined:
    Sep 6, 2008
    Messages:
    815
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    ok so i made up a pretty little thing

    Please Register or Log in to view images



    so then i write class files, and i put em in the classes, then i build and go and the screen shows up white.

    ok so first i dunno how to load it and then how do i make it switch to another view when i click the button XXX at the bottom.

    and then i have another view with a bunch of images, and when you click the images they go back to the first view, and load a specific URL in the UIWebView.

    I recall something in a tutorial about addSuperView or removeFromSuperView but i just can't seem to find how to do it.

    I also think i need IBActions and Outlets, but i don't know how to use them.
    VERY simple stuff, just i don't know and can't find any tuts...

    EDIT: I get how to connect the goBack and refresh and stuff to the arrows and the refresh/stop buttons.
  2. Chicken

    Chicken Retired Moderator

    Joined:
    Feb 17, 2008
    Messages:
    2,494
    Likes Received:
    7
    Device:
    iPhone 5S
    For some reason the XXX is putting me off helping you, anyway this could easily be found using google.
  3. veeloc

    veeloc New Member

    Joined:
    Sep 6, 2008
    Messages:
    815
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    i havnt chosen the titles yet.
    ------------------double post merged------------------
    and ive been at this for quite a bit.

    dnt u think i woulda tried google.
  4. Steaps

    Steaps New Member

    Joined:
    Oct 24, 2007
    Messages:
    5,074
    Likes Received:
    41
    Device:
    iPod touch
    Inside the window in your application, that will be the same as the window is this screenshot named ViewBasedViewControll.xib

    Please Register or Log in to view images


    Click your view, go to the connections tab (Second tab from the left) and connect "view" to "Files Owner".
    Tell me if that works.
  5. veeloc

    veeloc New Member

    Joined:
    Sep 6, 2008
    Messages:
    815
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    I don't have a window or anything, here are all my files:

    Please Register or Log in to view images



    im going to load a view in the viewcontroller like:

    viewcontroller, with view. write the views class files
    then i [self addSubView: ];
    but that will only add the one view that i will write

    the one i attached has like a UIWebView and the navbar, and buttons and such.

    thats what i need help with, and then also how to load something when you click a button instead of just my initial step of -(void)awakeFromNib
  6. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    What do you mean "switch to another view?" Do you want the view to be pushed, a la a [self.navigationController pushToViewController]? Do you simply want to add a view, a la [self.view addSubview:anotherView]? Or, to you want to refresh the current UIWebView with a webpage, [webView loadRequest... ]?

    Also, about using IBActions/IBOutlets, and connecting them, see my InterfaceBuilder tutorials in the tutorial section of this forum. Parts I and II are one tutorial, and part III is another tutorial.

    Also, I just finished making a mini web browser and incorporating it into my next AppStore app. It includes everything but a field for the user to enter an address (as that is far from the intended purpose of why I added it in). As soon as I submit the app to Apple, I'll rip the mini web browser out and post it in the tutorial section of this forum.
  7. veeloc

    veeloc New Member

    Joined:
    Sep 6, 2008
    Messages:
    815
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    well i would like it to just slide in from the side.

    but when you go to the second view, i want it to, when you click the image, have it remove itself, and then load the URL that went with the image in the first UIWebView.

    I think I'm doing something terribly wrong. I tried to simplify it and i keep having it crash. its like 10 lines of code...
    ------------------double post merged------------------
    heres my mainview.h

    Code:
    #import <UIKit/UIKit.h>
    #import <Foundation/Foundation.h>
    
    @interface MainView : UIView {
        IBOutlet UIWebView *webView;
    }
    
    @end
    
    and mainview.h

    Code:
    #import "MainView.h"
    
    @implementation MainView
    
    
    -(void)awakeFromNib
    {
    	[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com"]]];
    }
    
    @end
    

    all it does is load a stupid webview. and it crashes.
  8. SkylarEC

    SkylarEC Super Moderator Emeritus Staff Member

    Joined:
    Sep 19, 2007
    Messages:
    6,642
    Likes Received:
    129
    What you're doing terribly wrong is failing to type in concise, or even coherent sentences. I want to help you, but I still have no clue what you want.
  9. veeloc

    veeloc New Member

    Joined:
    Sep 6, 2008
    Messages:
    815
    Likes Received:
    0
    Device:
    iPhone 3GS (Black)
    Ok let me start over. Maybe I should show you with a picture, instead of trying to explain in without writing a paragraph. A picture is worth a thousand words!

    Please Register or Log in to view images



    Hope that helped, sorry if my arrows are kinda messy.

    All the images that are in the upper-right picture, those all are going to be "links" that load in the upper-left picture's UIWebView.

    (Also i couldn't fit it in the picture, but the bottom-right picture has a home button in the upper-left hand corner, which also brings it to picture 1, sorry)
  10. NolesFans

    NolesFans New Member

    Joined:
    Sep 23, 2008
    Messages:
    404
    Likes Received:
    0
    Device:
    iPod touch
    webView = [[UIWebView alloc] init];
    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString

    Please Register or Log in to view images

    "http://www.apple.com"]]];

    - (void)dealloc {
    [webView release];
    [super dealloc];
    }

    I think it needed [self.view addSubview:webView]; too

    looks up for UIButton.

Share This Page