Search Results

Search found 528 results on 22 pages for 'viewcontroller'.

Page 2/22 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Sharing same properties of ViewController for iPhone Stroryboard and iPad Story Board

    - by Ruhul Amin
    I'm developing a universal application. in the first view, I have the login screen for the user. In iPhone storyBoard, I have added 2 text field and one button( login check). I have added properties in ViewController.h file by dragging those objects(Ctrl key + Dragg) to .h file. I have added code for login check and it is working fine for iPhone. This is the code in ViewController.h @property (strong, nonatomic) IBOutlet UITextField *txtUserId; @property (strong, nonatomic) IBOutlet UITextField *txtUserPwd; @property (strong, nonatomic) IBOutlet UIButton *btnLogin; In the iPad storyBoard, I have added 2 text field( userid and password) and i button for login. So now, I want to bind those objects with the veriable which I declared already in ViewController.h file in case of iPhone. My questions: 1. What is the right way to bind properties for both storyboard? 2. Am I on the right direction or should I think in a different way to do it? I am new with iPhone development. Please help. Thanks. --Amin

    Read the article

  • Unbalanced calls to begin/end appearance transitions for <ViewController>,<Tab>

    - by onkar
    I am trying to implement Tabs into my secondView.On button touch(from ViewController.m) I am navigating to secondView(Tabs). In my Tabs.xib file I have added a TabBar at bottom and it is custom class of UITabBar. ViewController.m - (IBAction)touchedInside:(id)sender { NSLog(@"touhced up inside"); Tabs *temp = [[Tabs alloc]initWithNibName:@"Tabs" bundle:nil]; [self.navigationController pushViewController:temp animated:YES]; [self presentViewController:temp animated:YES completion:nil]; } Tabs.m - (void)viewDidLoad { [super viewDidLoad]; AppDelegate *appDelegate = (AppDelegate *)[[UIApplication sharedApplication] delegate]; UITabBarController *tabBarController = [[UITabBarController alloc]init]; /* Tab_1 *firstView = [[Tab_1 alloc] init]; UITabBarItem *item1 = [[UITabBarItem alloc]initWithTitle:@"First" image:nil tag:1]; [firstView setTabBarItem:item1]; NSLog(@"after first tab is added"); Tab_2 *secondView = [[Tab_2 alloc] init]; UITabBarItem *item2 = [[UITabBarItem alloc]initWithTitle:@"Sec" image:nil tag:1] ; [secondView setTabBarItem:item2]; NSLog(@"after second tab is added"); [tabBarController setViewControllers:[NSArray arrayWithObjects:firstView,secondView,nil] animated:NO]; NSLog(@"after tab is added"); [appDelegate.window addSubview:tabBarController.view]; NSLog(@"after view is added"); */ appDelegate.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; // Override point for customization after application launch. UIViewController *viewController1 = [[Tab_1 alloc] initWithNibName:@"Tab 1" bundle:nil]; UIViewController *viewController2 = [[Tab_2 alloc] initWithNibName:@"Tab 2" bundle:nil]; UIViewController *viewController3 = [[Tab_2 alloc] initWithNibName:@"Tab 1" bundle:nil]; tabBarController.viewControllers = [NSArray arrayWithObjects:viewController1, viewController2, viewController3, nil]; appDelegate.window.rootViewController = self.tabBarController; [appDelegate.window makeKeyAndVisible]; Tabs *temp = [[Tabs alloc]initWithNibName:@"Tabs" bundle:nil]; [self.navigationController presentModalViewController:temp animated:NO]; } Errors Unbalanced calls to begin/end appearance transitions for <ViewController: 0x6833c80>. 2012-12-06 09:57:48.963 demoTabs[667:f803] Unbalanced calls to begin/end appearance transitions for <Tabs: 0x6a3fc90>.

    Read the article

  • iPhone Setting ViewController nested in NSMutableArray

    - by Peter George
    Hello I'm trying to set attributes for a viewcontroller nested inside a NSMutableArray, for example I have 3 ViewController inside this array: FirstViewController *firstViewController = [FirstViewController alloc]; SecondViewController *secondViewController = [SecondViewController alloc]; ThirdViewController *thirdViewController = [ThirdViewController alloc]; NSMutableArray *viewControllerClasses = [[NSMutableArray alloc] initWithObjects: firstViewController, secondViewController, thirdViewController, nil]; for (int x=0; x<[viewControllerClasses count]; x++) { // as an example to set managedObjectContext I otherwise would set firstViewController.managedObjectContext = context; [viewControllerClasses objectAtIndex:x].managedObjectContext = context; } But this results in an error: Request for member "managedObjectContext" in something not a structure or union. Shouldn't be "firstViewController" be the same as [viewControllerClasses objectAtIndex:0]?

    Read the article

  • PLCameraController is not adding in viewcontroller

    - by sujyanarayan
    Hi, I've declared PLCameraContoller instance in my AppDelegate class as:- self.cameraController = [PLCameraController performSelector:@selector(sharedInstance)];[cameraController setDelegate:self]; And I'm accessing it in one of my viewcontroller class as:- del = [[UIApplication sharedApplication] delegate]; UIView previewView = [del.cameraController performSelector:@selector(previewView)]; previewView.frame = CGRectMake(0,0, 320, 480); self.view = previewView; [del.cameraController performSelector:@selector(startPreview)]; [del.cameraController performSelector:@selector(setCameraMode:) withObject:(NSNumber)1]; Where "del" is an instance of my AppDelegate class. But i can see only black background in my viewcontroller view in iphone device. Also if i remove "self" from the appdelegate.m code of cameracontroller it also showing blank. How can i get camera in my view controller? I'm pretty much struggling with it. Thanks in Adv.

    Read the article

  • Migrating a simple application from Application Delegate to ViewController Class

    - by eco_bach
    Hi Frst of all wanted to send out a huge thanks for the great feedback and support. I have a simple application working, right now simply loads a sequence of images and alows the user to step thru the images by clicking a button. All of my logic is in my Application Delegate class, with the image loading, initialization of UIImage Views etc happening in my applicationDidFinishLaunching method. My next step is to migrate as much as possible all of the logic from this class to a ViewController, to take advantage of the extra functionality etc in viewcontrollers. All my images and imageViews are initialized like the following in my applicationDidFinishLaunching. img = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@image1.jpg" ofType:nil]]; imgView = [[UIImageView alloc] initWithImage:img]; How would I migrate this to a ViewController based application? Where would I put all of the logic currently in my applicationDidFinishLaunching method, or for loading of images, is it necessary to only load them here? Any feedback, tips, suggestions appreciated.

    Read the article

  • How do IOS know which viewController is being viewed and hence need viewWillAppear to be called

    - by Jim Thio
    How does iOs know? Does each view has a pointer to it's controller? What happened? When we pop a viewController from navigation, does the navigationController arrange which view should be called? For example: If I added: [[BNUtilitiesQuick window] addSubview:[BNUtilitiesQuick searchController].view]; viewWillAppear will be called. However, window doesn't know the viewController. I am passing the view outlet of the controller not the controller. How can iOs 5 knows that it has to call [[BNUtilitiesQuick searchController] viewWillAppear:YES]

    Read the article

  • call addsubview again causes slowdown

    - by Tom
    hi guys, i am writing a little music-game for the iphone. I am almost done, this is the only issue which keeps me from rolling it out. any help to solve this is much appreciated. this is what i do: at my appDelegate I add my menu-view-screen to the window. the menu-view-screen acts as a container and controls which view gets presented to the user. means, on the menu-view-screen I got 4 buttons (new game, options, faq, highscore). when the user clicks on a button something as this happens: if (self.gameViewController == nil) { GameViewController *viewController = [[GameViewController alloc] initWithNibName:@"GameViewController" bundle:nil]; self.gameViewController = viewController; [viewController release]; } [self.view addSubview:self.gameViewController.view]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleSwitchViewNotificationFromGameView:) name:@"SwitchView" object:gameViewController]; when the user returns to the menu, this piece of code gets executed: [[NSNotificationCenter defaultCenter] removeObserver:self]; [self.gameViewController viewWillDisappear:YES]; [self.gameViewController.view removeFromSuperview]; this works fine for all screens but not for the gamescreen(well this is the only one with heaps of user-interaction) means the responsiveness of the iphone(when playing tones) gets really slow. The performance is fine when I display the gameview for the first time. it starts getting slower as soon as I add it to the menu-views-container-subviews again (addsubview) (basically open up a new game) any ideas what causes(or to get around) this? thanks heaps Best regards Tom

    Read the article

  • ViewController init?

    - by fuzzygoat
    I have just noticed that my ViewController does not call init (See below) when it starts up. -(id)init { self = [super init]; if(self) { NSLog(@"_init: %@", [self class]); otherStuff... } return self; } Is there a reason for this, or is it replaced by viewDidLoad -(void)viewDidLoad { otherStuff .. [super viewDidLoad]; } cheers gary

    Read the article

  • Two TableVIew in ONE ViewCOntroller

    - by senthilmuthu
    hi, i i want to activate scrolling vertically through programming for 2 UITableview at sametime?(one table view length 160,another one has 160).is it possible ?In one Viewcontroller's view i have scrollview, on that i have two tableviews(instead of one,like two column)..how can i scroll vertically both at same time?any help please?

    Read the article

  • Save from viewController?

    - by fuzzygoat
    I have a very small bit of data that I would like to archive from my apps view. My question is, its far easier to save this data from the viewController, but should I really be pushing it back into my model and saving it there? BTW: I also need to do a quick load of this data when the app starts up.

    Read the article

  • IPhone UIView:Is it possible to enable userinteraction only on subviews?

    - by Syg
    Hi guys, I created a viewcontroller that displays a button which is used to slide a view onto the screen. The idea is to place for instance three such viewcontrollers onscreen, resulting in three buttons at the bottom of the screen providing navigation. The viewcontrollers get stacked, so to the top one is now overlaying the other views and therefore the other buttons. Only the top viewcontroller's button is working in this situation, where I would like all three of them to be clickable. I tried disabling userinteraction on the view and enabling it on the buttons only, but it looks like the superview settings overrule the subview settings. Any ideas?

    Read the article

  • Accessing functions in a parent controller

    - by meridimus
    I have made a ViewController in XCode for an iPhone project I'm working on, but I have a question about nested ViewControllers and what the best way to access a parents ViewController functions? Essentially, at the moment I have a SwitchViewController with MenuViewController (nested) and GameViewController (nested, which renders OpenGL ES). At the moment, I have animated view switching controlled in the SwitchViewController which works. But I want to call it after a player has selected the level from the MenuViewController and run the appropriate level in GameViewController. Not rocket science, I know. What's the best way to call parent functions?

    Read the article

  • Can a ViewController (AdMob AdViewController) control a view that is a subview of the controlled vie

    - by RexOnRoids
    I am trying to use the IB AdMob ad in my app. I followed the instructions provided but I am getting an EXC_BAD_ACCESS from the AdMob class. I am trying to figure out what the problem is. Anyway, my question is Can a ViewController (AdMob AdViewController) control a view that is a subview of the controlled view of another UIViewController? Here is how I set it up: I start off with a UIViewController in IB. Step 1) I add a UIView sized 320 x 48 to the UIView controlled by the UIViewController. Step 2) I add an Object to the hierarchy (not under any other object). Step 3) I set the class of the Object to AdViewController (AdViewController.h of AdMob SDK) Step 4) I set connect the view outlet of the Object to the UIView of Step 1

    Read the article

  • remove ViewController from memory

    - by user262325
    hello everyone I hope to load an ViewController and do something then unload it from memory. if (self.vViewController5.view.superview==nil) { ViewController5 *blueController = [[ViewController5 alloc] initWithNibName:@"View5" bundle:nil]; self.vViewController5 = blueController; [self.vViewController5 setDelegate:self]; [blueController release]; } [self presentModalViewController:vViewController5 animated:YES]; later, call [self dismissModalViewControllerAnimated:YES]; but I found that dismissModalViewControllerAnimated does not trigger the event viewDidUnload of Viewcontroller5. I try function release but it caused program collapse. I also try removeFromSuperView but it does not trigger the event ViewDidUnload neither. Welcome any comment Thanks interdev

    Read the article

  • UIWebView in multithread ViewController

    - by Tao
    I have a UIWebView in a viewcontroller, which has two methods as below. The question is if I pop out(tap back on navigation bar) this controller before the second thread is done, the app will crash after [super dealloc], because "Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread.". Any help would be really appreciated. -(void)viewDidAppear:(BOOL)animated { [super viewWillAppear:animated]; NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:self selector:@selector(load) object:nil]; [operationQueue addOperation:operation]; [operation release]; } -(void)load { [NSThread sleepForTimeInterval:5]; [self performSelectorOnMainThread:@selector(done) withObject:nil waitUntilDone:NO]; }

    Read the article

  • iOS 6&7: Storyboard, master detail ViewController when detailViewController is dynamic

    - by Cam
    I'm building an app for iPhone, I want to use storyboard in XCode to do a simple selection from a tableView (let's call it master table view controller with couple rows) then through navigation it goes to next page and shows a detail view for that selection. I have in my code a base class representing my detailViewController, and have 2-3 driver classes of this base class representing what I want to show in detail view controller in second page, can someone give me an idea how to set destination viewController (detailViewController) dynamically to one of my child class based on the selected row in master view controller using storyboard? Usually you assign a class to destination class in storyboard for your detail view controller with using segue, but since my destination class could be a different (child class) how you set this in storyboard? Thank you, Kam

    Read the article

  • release viewcontroller after presenting modally

    - by Jonathan
    I was watching CS193P Stanford course on Itunes, and in one of the lectures a demo was given and There it was said you could present the viewcontroller modally and then release it. Roughly like this (I know this isn't perfect but I'm on my PC atm) [self.view presentcontentmodally:myVC] [myVC release]; However this seems to produce problems. If I put a NSLog(@"%d", [myVC retainCount]) between those two lines then it returns 2 implying it is ok to release. However when I dismiss the myVC the app crashes. Nothing in the NSlog and the debugger won't show where it stopped. But I used malloc-history or something that some blog said would help. And found that it was the myVC. So should I be releasing myVC? (also when the modalVC has been dissmissed should the app's memory usuage go back to before the modalVC was presented?)

    Read the article

  • Setting a ViewController's properties after instantiation

    - by Craig
    I'm creating an instance of a viewController, and then trying to set the text on of it's properties, a UILabel. BoyController *boyViewController = [[BoyController alloc] initWithNibName:@"BoyView" bundle:nil]; NSString *newText = [astrology getSignWithMonth:month withDay:day]; boyViewController.sign.text = newText; NSLog(@" the boyviewcontroller.sign.text is now set to: %@", boyViewController.sign.text); [newText release]; I tried this, but it didn't work... So I tried the following: BoyController *boyViewController = [[BoyController alloc] initWithNibName:@"BoyView" bundle:nil]; UILabel *newUILabel = [[UILabel alloc] init]; newUILabel.text = [astrology getSignWithMonth:month withDay:day]; boyViewController.sign = newUILabel; NSLog(@" the boyviewcontroller.sign.text is now set to: %@", newUILabel.text); [newUILabel release]; But no avail.. I'm not sure why I can't set the text property of the UILabel "sign" in boyViewController..

    Read the article

  • show activity indicator while loading ViewController

    - by Crystal
    I have a ViewController that takes time to load its views. When I run Instruments, I see from the home screen, if I tap on the icon that pushes that view controller onto the stack, it's half laying out the views, and half getting the data for the views. I tried adding an activity indicator to display on the home screen over the button when the button is pressed to push the LongRunningViewController onto the stack. So I basically do this: - (IBAction)puzzleView:(id)sender { dispatch_async(dispatch_get_main_queue(), ^{ [self.activityIndicator startAnimating]; }); PuzzleViewController *detailViewController = [[[PuzzleViewController alloc] init] autorelease]; [self.navigationController pushViewController:detailViewController animated:YES]; [self.activityIndicator stopAnimating]; }

    Read the article

  • Passing a NSString to another ViewController using classes

    - by Jeff Kranenburg
    I know this insanely simple, but I am re-teaching myself the basics and trying to get my head around this:-) I have one ViewController called MainVC and I have one called ClassVC In ClassVC I have this code: @interface ClassVC : UIViewController { NSString *mainLine; } @property (nonatomic, retain) NSString *mainLine; @end and I have this in the implementation file: @synthesize mainLine = _mainLine; -(NSString *)_mainLine { _mainLine = @"This a string from a Class"; return _mainLine; } Now I was thinking that if I #import the ClassVC into MainVC I would be able to transfer that string along as well like so: This code is in the viewDidLoad _mainLabel.text = _secondClass.mainLine; NSLog(@"%@", _secondClass.mainLine); But that is not working - so cannot I not pass strings in through this way???

    Read the article

  • ViewController access data

    - by Giovanni Filaferro
    Today i would ask you if there is a way to call a method of another view controller just not initializing it or just how to get that viewController as a global variable declared in .h file. Help me please. I'm using a PageViewController and I have to use a method of the contentViewController alredy initialized. here I create my ViewControllers: - (void)createTheContent { NSLog(@"createTheContent"); pageController = nil; //[pageController removeFromParentViewController]; //[pageController awakeFromNib]; NSDictionary *options = [NSDictionary dictionaryWithObject:[NSNumber numberWithInteger:UIPageViewControllerSpineLocationMin] forKey: UIPageViewControllerOptionSpineLocationKey]; self.pageController = [[UIPageViewController alloc] initWithTransitionStyle:UIPageViewControllerTransitionStylePageCurl navigationOrientation:UIPageViewControllerNavigationOrientationHorizontal options: options]; pageController.dataSource = self; [[pageController view] setFrame:CGRectMake(0, 0, 320, 365)]; initialViewController = [self viewControllerAtIndex:0]; NSMutableArray *viewControllers = [NSArray arrayWithObject:initialViewController]; [pageController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:NO completion:nil]; [self addChildViewController:pageController]; [[self view] addSubview:[pageController view]]; [pageController didMoveToParentViewController:self]; } here are my propertys in .h file: contentViewController *initialViewController; } //Page View Controller Properties @property (strong, nonatomic) UIPageViewController *pageController; @property (strong, nonatomic) NSArray *pageContent; @property (strong, nonatomic) NSMutableArray *pageStrings; @property (strong, nonatomic) id dataObject;

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >