Search Results

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

Page 20/22 | < Previous Page | 16 17 18 19 20 21 22  | Next Page >

  • UIAlertView choice causing resignFirstResponder to fail

    - by Chazbot
    Hi everyone. I'm having a similar issue to Anthony Chan's question, and after trying every suggested solution, I'm still stuck. Somehow, only after interacting with my UIAlertView, I'm unable to dismiss the keyboard in another view of my app. It's as though the Alert is breaking my UITextField's ability to resignFirstResponder. Below I instantiate my UIAlertView, which then calls its didDismissWIthButtonIndex method. Then, I call the showInfo method, which loads another UIViewController. UIAlertView *emailFailAlert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"error message text." delegate:self cancelButtonTitle:@"Not now" otherButtonTitles:@"Settings", nil]; [emailFailAlert setTag:2]; [emailFailAlert show]; [emailFailAlert release]; Once the 'Settings' option is pressed, I'm calling this method: - (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { if ([alertView tag] == 2) { if (buttonIndex == 1){ [self showInfo:nil]; } } } My showInfo method loads the other ViewController, via the code below: - (IBAction)showInfo:(id)sender { FlipsideViewController *fscontroller = [[FlipsideViewController alloc] initWithNibName:@"FlipsideView" bundle:nil]; fscontroller.delegate = self; fscontroller.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal; [self presentModalViewController:fscontroller animated:YES]; [fscontroller release]; } Upon clicking any textField in this Flipside VC, I'm unable to dismiss the keyboard as I normally can with - (BOOL)textFieldShouldReturn:(UITextField *)textField, and [textField resignFirstResponder]. I've omitted this code bc this question is getting long, but I'm happy to post if necessary. The interesting part is that if I comment out the [self showInfo:nil] call made when the button is clicked and call it by clicking a test button (outside the alertView didDismissWithButtonIndex: method), everything works fine. Any idea what's happening here? Thanks in advance!

    Read the article

  • What would cause objectForKey: to return null with a valid string in place?

    - by theMikeSwan
    I am having an issue with NSDictionary returning null for an NSString even though the string in in the dictionary. Here is the code: - (void)sourceDidChange:(NSNotification *)aNote { NSDictionary *aDict = [aNote userInfo]; DLog(@"%@", aDict); NSString *newSourceString = [aDict objectForKey:@"newSource"]; DLog(@"%@", newSourceString); newSourceString = [newSourceString stringByReplacingOccurrencesOfString:@" " withString:@""]; DLog(@"%@", newSourceString); NSString *inspectorString = [newSourceString stringByAppendingString:@"InspectorController"]; DLog(@"%@", inspectorString); newSourceString = [newSourceString stringByAppendingString:@"ViewController"]; DLog(@"%@", newSourceString); } And I get the following log statements: 2010-04-17 23:50:13.913 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] newSource = "Second View"; 2010-04-17 23:50:13.914 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) 2010-04-17 23:50:13.916 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) 2010-04-17 23:50:13.917 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) 2010-04-17 23:50:13.917 CoreDataUISandbox[13417:a0f] -[RightViewController sourceDidChange:] (null) As you can see the string is in the dictionary under the key newSource, yet when I call objectForKey: I get null. I have even tried the fallback option of cleaning the project. Has anyone ever run into this, or have I just forgotten something really basic?

    Read the article

  • Personalized UIView created with Interface Builder

    - by Malox
    I need to project a personalized UIView with a UIImageView and 3 UILabel. I need to allocate more of this view because I want put it into a UIScrollView. I would avoid to generate the view programatically because it's difficult and boring design it. My idea is to create a new class that extends UIView and design it with interface builder. For example my Personalized View code is like that: #import <UIKit/UIKit.h> @interface PersonalizedPreview : UIView { IBOutlet UIImageView *image; IBOutlet UILabel *first_label; IBOutlet UILabel *second_label; IBOutlet UILabel *third_label; } -(void) setImage:(UIImage *)image; @property (nonatomic, retain) IBOutlet UIImageView *image; @property (nonatomic, retain) IBOutlet UILabel *label; .... @end I would create an associated xib file for this view and initialize it simply specifing the xib file. Note that I don't want create a specific ViewController for this view and PersonalizedView is instantiate at runtime not when the app runs, moreover I don't know how many PersonalizedView I will instantiate, it depends on runtime execution. Anyone can help me? Thank you very much.

    Read the article

  • Problem with UITextView

    - by user367039
    I have a strange problem with trying to pass a string from one viewcontroller to another view controller if the string originates from a UITextview instead of UITextfield. Both UITextview.text and UITextfield.text are of type NSString. The following code takes either Textfield.text or Textview.text depending on the fieldType and puts it into a string called aString. NSString *aString = [[NSString alloc] init]; if (fieldType == 3) { aString = textView.text; } else { aString = textField.text; } When I examine aString on either cases, I can see that it has successfully assigned the text into aString. I then pass the string to the other view controller using this code. [delegate updateSite:aString :editedFieldKey :fieldType]; [self.navigationController popViewControllerAnimated:YES]; This works fine if aString originated from textfield.text but nothing happens except the view controller is popped if aString was from textview.text This is the code that takes aString and does stuff with it, however it doesn't even execute the first line of code "NSLog(@"Returned object: %@, field type:%@", aString,editedFieldKey);" if aString was from textview.text Any help will be appreciated. -(void)updateSite:(NSString *)aString :(NSString *)editedFieldKey :(int)fieldType { NSLog(@"Returned object: %@, field type:%@", aString,editedFieldKey); switch (fieldType) { case 0: //string [aDiveSite setValue:aString forKey:editedFieldKey] ; NSLog(@"String set %@",[aDiveSite valueForKey:editedFieldKey] ); break; case 1: //int [aDiveSite setValue:[NSNumber numberWithInt:aString.intValue] forKey:editedFieldKey]; NSLog(@"Integer set"); break; case 2: //float NSLog(@"Saving floating value"); [aDiveSite setValue:[NSNumber numberWithFloat:aString.floatValue] forKey:editedFieldKey]; NSLog(@"Float set"); break; case 3: //Text view [aDiveSite setValue:aString forKey:editedFieldKey]; NSLog(@"Textview text saved"); default: break; } [self.tableView reloadData]; }

    Read the article

  • Moving UIScrollView in App

    - by jsetting32
    Currently, I am attempting to create the same effect as Yahoo! Weather's App where the vital day information is at the bottom of the page on the top of a UIScrollView, that's contained by a UIView. I am having a hard time thinking about how this is going to happen or how I should implement this. If the user taps on the top of the UIScrollView which is located near the bottom of the laoded UIView, and starts to scroll up (/), the UIScrollView's frame should be moved to the TOP of the current UIView's frame. So the UIScrollView's y-value should change to UIView's (self.view.frame.origin.y) if the user starts scrolling UP on the UIScrollView which is located on the UIView's y-pixel ~280. Here's what the UIViewController should look like in the beginning of loading the ViewController... Then once the user slides his finger from the bottom to the top of the screen... this should happen........ And when the user scrolls to the top of the UIScrollView with all the content within it... the view should go back to the start picture shown... How is this done? I was thinking several UIGestureRecognizer's and Instantiating the UIscrollview at the lower part of the UIView... _weatherView = [[UIScrollView alloc] initWithFrame:CGRectMake(self.view.frame.origin.x, self.view.frame.origin.y + 250, self.view.bounds.size.width, self.view.bounds.size.height - 44)]; _weatherView.contentSize = CGSizeMake(self.view.bounds.size.width, self.view.bounds.size.height * 4); _weatherView.backgroundColor = [UIColor clearColor]; [self.view addSubview:_weatherView]; The adding some UIGestureRecognizer delegate method.... But anyone have any ideas on the UIGestureRecognizer delegate method? And how it should be implemented? I can write the psuedo-code but I am having problems finding the delegate methods :P Thank you!!! ---- Break Time.... :)

    Read the article

  • App crashes every second time a tableview row is selected in navigation controller setup

    - by Thaurin
    Disclaimer first: I'm pretty new to Objective-C and the retain model. I've been developing in a garbage collected .NET environment for the last five years, so I've been spoiled. I'm still learning. I'm having my iPhone app crash with EXC_BAD_ACCESS. It happens in a navigtation controller/tableview setup. When I select a row the first time, no problems. It switches in the child controller without problems. I go back and select the same row again. Program then proceeds to crash. Every other row works fine, but every second time a row is accessed, it's a crash. I've pinpointed the location where this happens. The child controller (which is a class that I reuse for every row of the same type) that's being switched into has an array of NSString's representing the rows that will be displayed. I set it before pushing the child viewcontroller. It's there where this apparently happens. I'm having a hard time debugging this problem, still wrestling with xcode and all. I fear there may be some vital information missing here, but maybe there is something you recognize here.

    Read the article

  • @selector and return value

    - by user320926
    The idea it's very easy, i have an http download class, this class must support the http authentication but it's basically a background thread so i would like to avoid to prompt directly to the screen, i would like to use a delegate method to require from outside of the class, like a viewController. But i don't know if is possible or if i have to use a different syntax. This class use this delegate protocol: //Updater.h @protocol Updater <NSObject> -(NSDictionary *)authRequired; @optional -(void)statusUpdate:(NSString *)newStatus; -(void)downloadProgress:(int)percentage; @end @interface Updater : NSThread { ... } This is the call to the delegate method: //Updater.m // This check always fails :( if ([self.delegate respondsToSelector:@selector(authRequired:)]) { auth = [delegate authRequired]; } This is the implementation of the delegate method //rootViewController.m -(NSDictionary *)authRequired; { // TODO: some kind of popup or modal view NSMutableDictionary *ret=[[NSMutableDictionary alloc] init]; [ret setObject:@"utente" forKey:@"user"]; [ret setObject:@"password" forKey:@"pass"]; return ret; }

    Read the article

  • iOS - Passing variable to view controller

    - by gj15987
    I have a view with a view controller and when I show this view on screen, I want to be able to pass variables to it from the calling class, so that I can set the values of labels etc. First, I just tried creating a property for one of the labels, and calling that from the calling class. For example: SetTeamsViewController *vc = [[SetTeamsViewController alloc] init]; vc.myLabel.text = self.teamCount; [self presentModalViewController:vc animated:YES]; [vc release]; However, this didn't work. So I tried creating a convenience initializer. SetTeamsViewController *vc = [[SetTeamsViewController alloc] initWithTeamCount:self.teamCount]; And then in the SetTeamsViewController I had - (id)initWithTeamCount:(int)teamCount { self = [super initWithNibName:nil bundle:nil]; if (self) { // Custom initialization self.teamCountLabel.text = [NSString stringWithFormat:@"%d",teamCount]; } return self; } However, this didn't work either. It's just loading whatever value I've given the label in the nib file. I've littered the code with NSLog()s and it is passing the correct variable values around, it's just not setting the label. Any help would be greatly appreciated. EDIT: I've just tried setting an instance variable in my designated initializer, and then setting the label in viewDidLoad and that works! Is this the best way to do this? Also, when dismissing this modal view controller, I update the text of a button in the view of the calling ViewController too. However, if I press this button again (to show the modal view again) whilst the other view is animating on screen, the button temporarily has it's original value again (from the nib). Does anyone know why this is?

    Read the article

  • UITableView reloaddata doesn't reload immediately

    - by D33
    Hi everyone. I'm trying to work with online data in my iPhone app. But I'm getting mad because of this: I have object for downloading data with NSURLConnection. Method starting the work with connection (and other stuff) in separate thread - [ NSThread detachNewThreadSelector:@selector( doConnectionInNewThread ) toTarget: self withObject: nil ]; When data are loaded (connectionDidFinishLoading) I give them to my viewController. This all stuff works fine. When I use breakpoints or NSLog I have the data ready to show in UITableView. When I call reloadData, nothing happens immediately. It reloads data after maybe 2 seconds (- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath is called after this delay). BUT when I slide the tableView, it reloads data immediately. So the connection and so on works fine but it just doesn't reload the data. Why? I thought it could be due to blocked mainThread by URLConnection. But now I use it in separate thread and it is still the same...

    Read the article

  • MapView EXC_BAD_ACCESS (SIGSEGV) and KERN_INVALID_ADDRESS

    - by user768113
    I'm having some 'issues' with my application... well, it crashes in an UIViewController that is presented modally, there the user enters information through UITextFields and his location is tracked by a MapView. Lets call this view controller "MapViewController" When the user submits the form, I call a different ViewController - modally again - that processes this info and a third one answers accordingly, then go back to a MenuVC using unwinding segues, which then calls MapViewController and so on. This sequence is repeated many times, but it always crashes in MapViewController. Looking at the crash log, I think that the MapView can be the problem of this or some element in the UI (because of the UIKit framework). I tried to use NSZombie in order to track a memory issue but it doesn't give me a clue about whats happening. Here is the crash log Hardware Model: iPad3,4 Process: MyApp [2253] OS Version: iOS 6.1.3 (10B329) Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Codes: KERN_INVALID_ADDRESS at 0x00000044 Crashed Thread: 0 Thread 0 name: Dispatch queue: com.apple.main-thread Thread 0 Crashed: 0 IMGSGX554GLDriver 0x328b9be0 0x328ac000 + 56288 1 IMGSGX554GLDriver 0x328b9b8e 0x328ac000 + 56206deallocated instance 2 IMGSGX554GLDriver 0x328bc2f2 0x328ac000 + 66290 3 IMGSGX554GLDriver 0x328baf44 0x328ac000 + 61252 4 libGPUSupportMercury.dylib 0x370f86be 0x370f6000 + 9918 5 GLEngine 0x34ce8bd2 0x34c4f000 + 629714 6 GLEngine 0x34cea30e 0x34c4f000 + 635662 7 GLEngine 0x34c8498e 0x34c4f000 + 219534 8 GLEngine 0x34c81394 0x34c4f000 + 205716 9 VectorKit 0x3957f4de 0x394c7000 + 754910 10 VectorKit 0x3955552e 0x394c7000 + 582958 11 VectorKit 0x394d056e 0x394c7000 + 38254 12 VectorKit 0x394d0416 0x394c7000 + 37910 13 VectorKit 0x394cb7ca 0x394c7000 + 18378 14 VectorKit 0x394c9804 0x394c7000 + 10244 15 VectorKit 0x394c86a2 0x394c7000 + 5794 16 QuartzCore 0x354a07a4 0x35466000 + 239524 17 QuartzCore 0x354a06fc 0x35466000 + 239356 18 IOMobileFramebuffer 0x376f8fd4 0x376f4000 + 20436 19 IOKit 0x344935aa 0x34490000 + 13738 20 CoreFoundation 0x33875888 0x337e9000 + 575624 21 CoreFoundation 0x338803e4 0x337e9000 + 619492 22 CoreFoundation 0x33880386 0x337e9000 + 619398 23 CoreFoundation 0x3387f20a 0x337e9000 + 614922 24 CoreFoundation 0x337f2238 0x337e9000 + 37432 25 CoreFoundation 0x337f20c4 0x337e9000 + 37060 26 GraphicsServices 0x373ad336 0x373a8000 + 21302 27 UIKit 0x3570e2b4 0x356b7000 + 357044 28 MyApp 0x000ea12e 0xe9000 + 4398 29 MyApp 0x000ea0e4 0xe9000 + 4324 I think thats all, additionally, I would like to ask you: if you are using unwind segues then you are releasing view controllers from the memory heap, right? Meanwhile, performing segues let you instantiate those controllers. Technically, MenuVC should be the only VC alive in the heap during the app life cycle if you understand me.

    Read the article

  • Disable ARC with Xcode 5

    - by user2187565
    First, sorry for my bad english, I'm french and had 15years old but StackOverFlow is for me the best forum for developers. So, in the previous versions of Xcode, we can disable ARC (Automatic Reference Counting) in the project settings when we create the project. Not now with Xcode 5 and ARC to pose me a problem: with an property list file, for the reading step, Xcode send me an error: "implicit conversion of 'int' to 'id' is disallowed with ARC". I had not the problem with the same code with Xcode 4. In my property list file, The keys are numbers and also in my viewController.m . NIKOS M.: No problem, but I don't see how I can add compiler flag with the 5th version of Xcode. The code (with french string...): NSString *error; NSString *rootPath = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) objectAtIndex:0]; NSString *plistPath = [rootPath stringByAppendingPathComponent:@"Save.plist"]; NSArray *keys = [NSArray arrayWithObjects:@"valeurCompteur1", @"valeurCompteur2", @"valeurCompteur3", @"valeurCompteur4", @"valeurCompteur5", @"nomCompteur1", @"nomCompteur2", @"nomCompteur3", @"nomCompteur4", @"nomCompteur5", nil]; NSArray *objs = [NSArray arrayWithObjects: compteur1, compteur2, compteur3, compteur4, compteur5, nameC1, nameC2, nameC3, nameC4, nameC5, nil]; REVIEW: When I disallow ARC for the target, an warning persist. How I can resolve that please ? Thank you very much.

    Read the article

  • How do I pass an NSString through 3 ViewControllers?

    - by dBloc
    hey, I'm currently using the iPhone SDK and I'm having trouble passing an NSString through 3 views I am able to pass an NSString between 2 view controllers but I am unable to pass it through another one. My code is as follows... `- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)index`Path { NSString *string1 = nil; NSDictionary *dictionary = [listOfItems objectAtIndex:indexPath.section]; NSArray *array = [dictionary objectForKey:@"items"]; string1 = [array objectAtIndex:indexPath.row]; //Initialize the detail view controller and display it. ViewController2 *vc2 = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:[NSBundle mainBundle]]; vc2.string1 = string1; [self.navigationController pushViewController:vc2 animated:YES]; [vc2 release]; vc2 = nil; } in the "ViewController 2" implementations I am able use "string1" in the title bar by doing the following.... - (void)viewDidLoad { [super viewDidLoad]; self.navigationItem.title = string1; UIBarButtonItem *addButton = [[[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"icon_time.png"] style:UIBarButtonItemStylePlain //style:UIBarButtonItemStyleBordered target:self action:@selector(goToThirdView)] autorelease]; self.navigationItem.rightBarButtonItem = addButton; } but I also have a NavBar Button on the right side that I would like to push a new view - (void)goToThirdView { ViewController3 *vc3 = [[ViewController3 alloc] initWithNibName:@"ViewController3" bundle:[NSBundle mainBundle]]; [self.navigationController pushViewController:NESW animated:YES]; vc3.string1 = string1 ; [vc3 release]; vc3 = nil; } How do I pass on that same string to the third view? (or fourth)

    Read the article

  • drawRect gets called on UIView subclass but not on UIViewController

    - by HotFudgeSunday
    My code is working so far but I had to create a Class for the UIView. This is a bit inconvenient because I need to interact with the ViewController too. BTW, I did try [self setNeedsDisplay] on the ViewDidLoad of the UIViewController subclass file but it didn't work. Here's the code, which works on UIView Subclass but doesn't get called on a UIViewController one: - (void)drawRect:(CGRect)rect { UIColor *currentColor = [UIColor redColor]; CGContextRef context = UIGraphicsGetCurrentContext(); someNum = 1; CGContextBeginPath(context); CGContextMoveToPoint(context, 30, 40); [self addDotImageX:30 andY:40]; CGContextSetLineWidth(context, 2); CGContextSetStrokeColorWithColor(context, currentColor.CGColor); CGContextStrokePath(context); } Any ideas on what to try? BTW, this is a TabBar App. I know those can somehow block the calls to drawRect. The Tabs where created programatically, not through a Nib. Eg: NSMutableArray *listOfViewControllers = [[NSMutableArray alloc] init]; UIViewController *vc; vc = [[Education alloc] init]; vc.title = @"Education"; [listOfViewControllers addObject:vc]; vc.tabBarItem.image = [UIImage imageNamed:@"info.png"]; [vc release]; I would appreciate any ideas. I've been through the answers on this site related to setNeedsDisplay not calling drawRect and haven't found an answer for my particular case. Thanks.

    Read the article

  • Does tableViewController behave incorrectly when hosted by a popoverController?

    - by dugla
    I have made countless test examples of a tableViewController hosted by a popoverController and I have come to the following conclusion: It does not appear possible to pre-select a tableView cell. It is possible to do pre-selection when a tableViewController is hosted by a splitviewController. I am using the exact same tableViewController code. Here is the relevant tableViewController view lifecycle method that is misbehaving: static BOOL firstTime = YES; - (void)viewDidAppear:(BOOL)animated { NSLog(@"Root ViewController - view Did Appear"); [super viewDidAppear:animated]; if (firstTime == YES) { firstTime = NO; NSIndexPath *preselectedCell = [NSIndexPath indexPathForRow:5 inSection:0]; [self.tableView selectRowAtIndexPath:preselectedCell animated:NO scrollPosition:UITableViewScrollPositionTop]; detailViewController.detailItem = [NSString stringWithFormat:@"Row %d", preselectedCell.row]; } // if (firstTime == YES) } The above code correctly preselects a tableView cell the first time the tableView is unfurled in the splitViewController case (device in portrait mode). Can someone please, please, explain what I am doing wrong. I am completely stumped. Thanks, Doug

    Read the article

  • Correct way to switch between UIView with ARC. My way leads to memory leaks :( (iOS)

    - by Andrei Golubev
    i use xcode 4.4 with ARC on.. I have dynamically created UIViews in the ViewController.m: UIView*myviews[10]; Then in the - (void)viewDidLoad function i fill each of it with pictures i need myviews[viewIndex] = [[UIView alloc]initWithFrame:myrec]; UIImage *testImg; UIImageView * testImgView; testImg = [UIImage imageNamed:[NSString stringWithFormat:@"imgarray%d.png", viewIndex]; testImgView.image = testImg; viewindex++; So all seems to be fine, when i want to jump from one view to another i do with two buttons next: [self.view addSubview:views[viewIndex]]; CATransition *animation = [CATransition animation]; [animation setDelegate:self]; [animation setDuration:1.0f]; [animation setType:@"rippleEffect"]; [animation setSubtype:kCATransitionFromTop]; //[animation setTimingFunction:[CAMediaTimingFunction functionWithName:kCAMediaTimingFunctionEaseInEaseOut]]; [self.view.layer addAnimation:animation forKey:@"transitionViewAnimation"]; Nothing seems to be bad, but the memory consumption grows with huge speed when i switch between views.. and then i get low memory warning or sometimes application will just crash. I have tried to use UIViewController array and was switching between the controllers: nothing changes, the memory low warning is what i end up with.. Maybe i need to clean the memory somehow? But how? ARC does not allow to use release and so on.. last what i have tried (sorry, maybe not very professional) before to add new subview is this NSArray *viewsToRemove = [self.view subviews]; for (UIView *views in viewsToRemove) { [views removeFromSuperview]; } But this does not help either.. Please don't judge too strong, i am still new to iOS and Objective-c..

    Read the article

  • How is an AppDelegate instanciated?

    - by pwny
    I have an iOS application for which I want to create a ViewController programmatically. I started an empty XCode project and modified the main method so it looks like this int main(int argc, char *argv[]) { NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; int retVal = UIApplicationMain(argc, argv, nil, @"MyAppDelegate_iPad"); [pool release]; return retVal; } The app is a Universal Application, MyAppDelegate_iPad is a subclass of MyAppDelegate, which is a subclass of NSObject <UIApplicationDelegate>. My problem is that the applicationDidFinishLoading method I've overridden in MyAppDelegate_iPad is never called (break point on the first line never hits). The method looks like this -(void) applicationDidFinishLaunching:(UIApplication *)application { window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]]; if(!window) { [self release]; return; } window.backgroundColor = [UIColor whiteColor]; rootController = [[MyViewController alloc] init]; [window addSubview:rootController.view]; [window makeKeyAndVisible]; [window layoutSubviews]; } I removed the line to link to a nib file from my plist file (I used to get the default "My Universal app on iPad" white screen) and now all that is displayed is a black screen. applicationDidFinishLoading is still not being called. Am I doing something wrong? How should I properly create my AppDelegate instance?

    Read the article

  • NSString , EXC_BAD_ACCESS and stringByAppendingString

    - by amnon
    Hi, i wrote the following code : NSString *table = [[NSString alloc]initWithString:@"<table>"] ; for (NSDictionary *row in rows) { table = [table stringByAppendingString:@"<tr>"]; NSArray *cells = [row objectForKey:@"cells"]; for (NSString *cell in cells){ table = [table stringByAppendingString:@"<td>"]; table = [table stringByAppendingString:cell]; table = [table stringByAppendingString:@"</td>"]; } table = [table stringByAppendingString:@"</tr>"]; index++; } table = [table stringByAppendingString:@"</table>"]; return [table autorelease]; the rows are json response parsed by jsonlib this string is returned to a viewcontroller that loads it into a webview ,but i keep getting exc_bad_access for this code on completion of the method that calls it , i don't even have to load it to the webview just calling this method and not using the nsstring causes the error on completion of the calling method... any help will be apperciated thanks .

    Read the article

  • passing info from facebook to UITabBarController

    - by EquinoX
    When my app first start, it shows up a main page showing to login to facebook and then it goes to the UITabBarController. The code that I have in my app delegate is the following: //this is the .h @interface NMeAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window; MainViewController *controller; UITabBarController *tabBar; } @property (nonatomic, retain) IBOutlet UITabBarController *tabBar; @property (nonatomic, retain) MainViewController *controller; @property (nonatomic, retain) IBOutlet UIWindow *window; @end //this is the .m of the app delegate #import "NMeAppDelegate.h" @implementation NMeAppDelegate @synthesize window; @synthesize tabBar; @synthesize controller; #pragma mark - #pragma mark Application lifecycle - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after application launch. controller = [[MainViewController alloc] init]; [window addSubview:tabBar.view]; [window addSubview:controller.view]; [window makeKeyAndVisible]; return YES; } Inside of MainViewController, I actually have a Facebook * facebook object, which basically has all of the information that I need. Every information that I need for this apps is queried in the MainViewController. The problem is that after getting this info and now I am in the UITabViewController... how do I get those information that I already queried facebook for? I have a class called UserInfo as well, which basically has everything essential I need. I need to have the info from UserInfo so that the other ViewController in the UITabBarController have access to it.... I hope my question makes sense

    Read the article

  • For a 1view/scene to 2view/scene app, what application should I choose in Xcode?

    - by Tony Xu
    The question may be simple to some others, but I have been struggling with this for a while. The app I want would be like this: first scene/view with two big buttons (no toolbar item), click each one to get into two new scenes. So totally three scenes. In Xcode, what application should I choose? And in storyboard how/should I drag/draw? Thanks. Update: thanks for the link, the big-number-user. I actually read that tutorial before I asked. A little update on what I got so far: 1, I selected "single view", so there's view controller 1 (VC1) in the storyboard. 2, dragged a navigation controller (NC), and move the initial view arrow pointing to NC 3, control-drag to link NC and VC1, selected "relationship segue root view controller" when some small dialog popup. IS THIS CORRECT? 4, created two additional VC, VC3 and VC4, control-drag link each to NC. selected "push", IS THIS CORRECT? 5, in VC1, I added two buttons, showVC3 and showVC4. NOW I DON'T KNOW how to add IBAction to button showVC3 and showVC4. I tried to control-drag it to ViewController.m file @interface and @end section, but failed. What should I do next?

    Read the article

  • iPhone loading view from nib only works once

    - by The Swissdude
    Hi Forum I'm trying to add a «loader-view» to my app which shows a spinner while doing stuff. This works fine the first time, but it doesn't work a second time. here's what I do: I have a viewController for the spinner (spinnerViewController) and a nib-file which I made in IB (spinner.xib). I load the nib in the viewDidLoad-event: spinnerView = [[spinnerViewController alloc] initWithNibName:@"spinner" bundle:nil]; [spinnerView retain]; spinnerView is declared in the .h-file (spinnerViewController *spinnerView;) next, I show the spinner-view: [self.view addSubview:spinnerView.view]; [self.view bringSubviewToFront:spinnerView.view]; which works fine... And now the trouble starts. No matter what I do, I can't show the spinner view again. I tried just hiding it (self.view sendSubViewToBack: spinnerView.view) which works for hiding, but when I try to bring it to the front again (self.view bringSubViewToFront: spinnerView.view) it doesn't work. I also tried removing the spinner-view and add it again with no success (within the spinnerViewController: [self.view removeFromSuperview] and to show it again [self.view addSubview... ) Any ideas what I'm doing wrong??? ;) Thanks for the help!

    Read the article

  • Button not moving on my interface

    - by user1500134
    First before I say anything I want to announce that i'm fairly new to this kind of stuff so don't get all super techie on me :D ! Ok so i'm making an app and i'm trying to get a button to move to certain coordinates depending on the screen size of the phone (4, 4S, 5, etc...). I have correct syntax but the button will not move at all. Here is the part of my .m ViewController file... - (void)viewDidLoad { if([[UIScreen mainScreen] respondsToSelector:NSSelectorFromString(@"scale")]) { if ([[UIScreen mainScreen] scale] < 1.1) { CGRect frame = done.frame; frame.origin.x = 129; //New x coordinate frame.origin.y = 401; //New y coordinate done.frame = frame; NSLog(@"Standard Resolution"); } if ([[UIScreen mainScreen] scale] > 1.9) { NSLog(@"High Defenition Resolution"); } } [super viewDidLoad]; // Do any additional setup after loading the view from its nib. } The NSLog is triggering int he console saying 'Standard Resolution'but the button doesn't move from where I placed it in the XIB file. This may be a small stupid mistake but hopefully you can help me anyways... Thanks guys! :) P.S. Yes I did link my IBOutlet to the button

    Read the article

  • Popovercontroller doesn't display full

    - by user2959234
    I have an UIPopovercontroller in with an content that generate from an viewcontroller. popOverController = [[UIPopoverController alloc]initWithPopUp:emLightPopUp]; popOverController.delegate = self; // Get device position. CGRect position = {parentButton.frame.origin,emLightPopUp.popUpView.frame.size}; CGSize popUpViewFrameSize = emLightPopUp.popUpView.frame.size; Link screenshot: http://i.stack.imgur.com/AxqoG.png The issue is that when I change the position of select devices (touched button) upwards, the displayed popup will be resized like the screenshot. I already try to set content size inside the subclass of uipopover but it still doesn't work: self.popoverContentSize = emLightPopUp.popUpView.frame.size; EDIT: I solved this problems by calculate the position that display the popup and scroll the scrollview inside into an upper position. Check out this code: -(void)moveDeviceOutMiddleScreen:(id)deviceButton { UIButton* button = (UIButton*)deviceButton; CGFloat yPositionRange = button.frame.origin.y - self.floorZoomScrollView.contentOffset.y; int middle_top_y = 70; int middle_bottom_y = 166; if (yPositionRange > middle_top_y && yPositionRange < middle_bottom_y) { CGRect newRect = CGRectMake(self.floorZoomScrollView.contentOffset.x, self.floorZoomScrollView.contentOffset.y +yPositionRange*0.6, self.floorZoomScrollView.frame.size.width, self.floorZoomScrollView.frame.size.height); [self.floorZoomScrollView scrollRectToVisible:newRect animated:NO]; } } Thanks for your responses.

    Read the article

  • Achieve Named Criteria with multiple tables in EJB Data control

    - by Deepak Siddappa
    In EJB create a named criteria using sparse xml and in named criteria wizard, only attributes related to the that particular entities will be displayed.  So here we can filter results only on particular entity bean. Take a scenario where we need to create Named Criteria based on multiple tables using EJB. In BC4J we can achieve this by creating view object based on multiple tables. So in this article, we will try to achieve named criteria based on multiple tables using EJB.Implementation StepsCreate Java EE Web Application with entity based on Departments and Employees, then create a session bean and data control for the session bean.Create a Java Bean, name as CustomBean and add below code to the file. Here in java bean from both Departments and Employees tables three fields are taken. public class CustomBean { private BigDecimal departmentId; private String departmentName; private BigDecimal locationId; private BigDecimal employeeId; private String firstName; private String lastName; public CustomBean() { super(); } public void setDepartmentId(BigDecimal departmentId) { this.departmentId = departmentId; } public BigDecimal getDepartmentId() { return departmentId; } public void setDepartmentName(String departmentName) { this.departmentName = departmentName; } public String getDepartmentName() { return departmentName; } public void setLocationId(BigDecimal locationId) { this.locationId = locationId; } public BigDecimal getLocationId() { return locationId; } public void setEmployeeId(BigDecimal employeeId) { this.employeeId = employeeId; } public BigDecimal getEmployeeId() { return employeeId; } public void setFirstName(String firstName) { this.firstName = firstName; } public String getFirstName() { return firstName; } public void setLastName(String lastName) { this.lastName = lastName; } public String getLastName() { return lastName; } } Open the sessionEJb file and add the below code to the session bean and expose the method in local/remote interface and generate a data control for that. Note:- Here in the below code "em" is a EntityManager. public List<CustomBean> getCustomBeanFindAll() { String queryString = "select d.department_id, d.department_name, d.location_id, e.employee_id, e.first_name, e.last_name from departments d, employees e\n" + "where e.department_id = d.department_id"; Query genericSearchQuery = em.createNativeQuery(queryString, "CustomQuery"); List resultList = genericSearchQuery.getResultList(); Iterator resultListIterator = resultList.iterator(); List<CustomBean> customList = new ArrayList(); while (resultListIterator.hasNext()) { Object col[] = (Object[])resultListIterator.next(); CustomBean custom = new CustomBean(); custom.setDepartmentId((BigDecimal)col[0]); custom.setDepartmentName((String)col[1]); custom.setLocationId((BigDecimal)col[2]); custom.setEmployeeId((BigDecimal)col[3]); custom.setFirstName((String)col[4]); custom.setLastName((String)col[5]); customList.add(custom); } return customList; } Open the DataControls.dcx file and create sparse xml for customBean. In sparse xml navigate to Named criteria tab -> Bind Variable section, create two binding variables deptId,fName. In sparse xml navigate to Named criteria tab ->Named criteria, create a named criteria and map the query attributes to the bind variables. In the ViewController create a file jspx page, from data control palette drop customBeanFindAll->Named Criteria->CustomBeanCriteria->Query as ADF Query Panel with Table. Run the jspx page and enter values in search form with departmentId as 50 and firstName as "M". Named criteria will filter the query of a data source and display the result like below.

    Read the article

  • Building Tag Cloud Declarative ADF Component

    - by Arunkumar Ramamoorthy
    When building a website, there could a requirement to add a tag cloud to let the users know the popular tags (or terms) used in the site. In this blog, we would build a simple declarative component to be used as tag cloud in the page. To start with, we would first create the declarative component, which could display the tag cloud. We will do that by creating a new custom application from the new gallery. Give a name for the app and the project and from the new gallery, let us create a new ADF Declarative Component We need to specify the name for the declarative component, attributes in it etc. as follows For displaying the tags as cloud, we need to pass the content to this component. So, we will create an attribute to hold the values for the tag. Let us name it as "value" and make it as java.lang.String  type. Once after this, to hold the component, we need to create a tag library. This can be done by clicking on the Add Tag Library button. Clicking on OK buttons in all the open dialogs would create a declarative component for us. Now, we need to display the tag cloud based on the value passed to the component. To do that, we assume that the value is a Tree Binding and has two attributes in it, say "Name" and "Weight". To make a tag cloud, we would put together the "Name" in a loop and set it's font size based on the "Weight". After putting our logic to work, here is how the source look Attributes added to the declarative components can be retrieved by using #{attrs.<attribute_name>}. Now, we need to deploy this project as ADF Library Jar file, so that this can be distributed to the consuming applications. We'll select ADF Library Jar as type and create the profile. We would be getting the jar file after deployment. To test the functionality, we could create a simple Fusion Web Application. To add our custom component to the consuming application, we can create a file system connection pointing to the location where the jar file is and add it or, add through the project properties of the ViewController project. Now, our custom component has been added to the consuming application. We could test that by creating a VO in the model project with a query like, select 'Faces' as Name,25 as Weight from dual union all select 'ADF', 15 from dual  union all select 'ADFdi', 30 from dual union all select 'BC4J', 20 from dual union all select 'EJB', 40 from dual union all select 'WS', 35 from dual Add this VO to the AppModule, so that it would be exposed to the data control. Then, we could create a jspx page, and add a tree binding to the VO created. We can now see our Tag Cloud declarative component is available in the component palette.  It can be inserted from the component palette to our page and set it's value property to CollectionModel of the tree binding created. Now that we've created the Declarative component and added that to our page successfully, we can run the page to see how it looks. As per the query, the Tags are displayed in different fonts, based on their weight.

    Read the article

  • Deploying Oracle ADF Essentials Applications to Glassfish

    - by Shay Shmeltzer
    With the new Oracle ADF Essentials offering you can now deploy applications that leverage Oracle ADF on the open source Glassfish 3.1 server. Deployment is documented in the official JDeveloper and ADF documentation (here) but below is a summary of the steps and a video of the steps you'll need to take to get a basic Oracle ADF Essentials application to work on GlassFish. Note - to make starting/stopping GlassFish easier for my demo I used my GlassFish extension that you can get here. First we'll install some ADF Runtime libraries on GlassFish Download and install Glassfish (Note - if you also have an Oracle DB on the same machine, you'll want to switch GlassFish's HTTP port to something else instead of 8080). Download the Oracle ADF Essentials packaging - this will get you an adf_essentials.zip file. Copy the adf_essentials.zip to the lib directory of your Glassfish domain - on a default windows install this would be: C:\glassfish3\glassfish\domains\domain1\lib Go the the above lib directory and issue a unzip -j adf_essentials.zip This will extract the ADF libraries to the directory. Now you can start the Glassfish server. Now let's configure Glassfish to handle applications of the ADF type: Invoke the admin console of glassfish (http://localhost:4848) and log into your admin account. Go to Configurations->Server-config->JVM Settings and choose the JVM Options tab Add the following entries: -XX:MaxPermSize=512m (note this entry should already exist so just make sure it has a big enough value) -Doracle.mds.cache=simple While we are in the admin console, we can also define JDBC connections that will be used by our application. Go into Resources->JDBC->JDBC Connection Pools and click to create a New one Give it a name and choose the resource type to be javax.sql.XADataSource and choose Oracle as the Database Driver vendor. Click Next Scroll down to the Additional Properties section and start filling in the information for your database. The values for an Oracle XE will be (user=hr, databaseName = XE, Password=hr, ServerName=localhost, DriverType=thin, PortNumber=1521) Click Finish Click Ping to check your connection works. Now define a new JDBC Resource that will use the pool you just defined. In my example I called the resource jdbc/HRDS You will need this name to match the name in your Application Module connection configuraiton.Now you can re-start the Glassfish server for the changes to take effect. Get an ADF application going (you can use the regular Fusion Application template for this) Go into the project properties of your viewController project, under the deployment section click to edit the deployment profile that is defined there. Go to Platform and choose Glassfish 3.1 from the drop down list. Click ok to go back to your project. Go to Application -> Application Properties-> Deployment Go to Platform and choose Glassfish 3.1 from the drop down list. Click ok to go back to your project. This step will make sure that JDeveloper will autoamtically add the necessary ADF libraries to the EAR file that is being generated for deployment on Glassfish  Go to your Application->Deploy and deploy either to an EAR file or directly to a Glassfish server connection that you created. Things should just work, but if they don't then look up the server.log in the log directory and check out what error is in there. Here is a video demo of the various steps: Note - right now the deployment of an ADF application takes about 2 minutes on my machine we are hoping to be able to improve this timing in the future. People who are more familiar with Glassfish might want to explore using exploded directory deployment and see if they can get it to work.

    Read the article

< Previous Page | 16 17 18 19 20 21 22  | Next Page >